mirror of
https://github.com/eclipse/upm.git
synced 2025-03-14 20:47:30 +03:00
SWIG: Moved common SWIG syntax to ${libname}.i
This commit moves common SWIG syntax to a ${libname}.i for sensor libraries. Much of the swig content was originally duplicated for each wrapper language which has lead to inconsistencies between wrappers over time. This commit moves all swig syntax to a common file. Language specific swig syntax can be added with #ifdef SWIG<LANGUAGE>. The src/CMakeLists.txt will look first for a language-specific .i file, then fall back to ${libname}.i. In this way, it's possible to override the common ${libname}.i file. If a fallback .i file does NOT exist, UPM CMake will generate a simple interface file for all languages. Example: If no src/abp/pyupm_abp.i and no src/abp/abp.i then generate ${CMAKE_CURRENT_BINARY_DIR}/abp.i When src/CMakeLists.txt uses a common ${libname}.i, it adds a -module <language>upm_${libname} to the swig command line. In the example below, a -module argument is provided for both Java and Javascript, while the python module takes all syntax from pyupm_abp.i. SWIG FILE Language CMake added SWIG args --------------- ---------- --------------------- src/abp/abp.i java -module javaupm_abp src/abp/abp.i javascript -module jsupm_abp src/abp/pyupm_abp.i python This commit removes ~4500 redundant lines for the UPM repository and helps promote uniformity for the SWIG'ed languages. Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
parent
3d674efb51
commit
20aa4962f0
@ -259,7 +259,7 @@ We extend the sensor class with another method, _installISR\(jobject runnable\)_
|
|||||||
|
|
||||||
Java callbacks are added at the SWIG interface level. For ease-of-use, a collection of macros are available in src/_upm.i.
|
Java callbacks are added at the SWIG interface level. For ease-of-use, a collection of macros are available in src/_upm.i.
|
||||||
|
|
||||||
src/a110x/javaupm_a110x.i:
|
src/a110x/a110x.i:
|
||||||
```c++
|
```c++
|
||||||
JAVA_ADD_INSTALLISR(upm::A110X)
|
JAVA_ADD_INSTALLISR(upm::A110X)
|
||||||
```
|
```
|
||||||
|
@ -14,8 +14,7 @@ First thing to do is to create a tree structure like this in upm/src/max31855:
|
|||||||
|
|
||||||
* max31855.cxx
|
* max31855.cxx
|
||||||
* max31855.hpp
|
* max31855.hpp
|
||||||
* jsupm_max31855.i
|
* max31855.i
|
||||||
* pyupm_max31855.i
|
|
||||||
* CMakeLists.txt
|
* CMakeLists.txt
|
||||||
|
|
||||||
And then an example file to use & test our lib with in upm/examples/max31855.cxx.
|
And then an example file to use & test our lib with in upm/examples/max31855.cxx.
|
||||||
|
@ -66,7 +66,7 @@ cmake \
|
|||||||
make -j8 -Cbuild
|
make -j8 -Cbuild
|
||||||
|
|
||||||
# Anotate the .java src from doxygen
|
# Anotate the .java src from doxygen
|
||||||
find src/ -name "javaupm_*.i" > build/upm.i.list
|
find src/ -name "*.i" > build/upm.i.list
|
||||||
#../doxy/doxyport build/upm.i.list \
|
#../doxy/doxyport build/upm.i.list \
|
||||||
# -s src/interfaces/,src/bacnetmstp,src/bmg160,src/bma250e,src/bmm150 \
|
# -s src/interfaces/,src/bacnetmstp,src/bmg160,src/bma250e,src/bmm150 \
|
||||||
# -m doxy/samples.mapping.txt \
|
# -m doxy/samples.mapping.txt \
|
||||||
|
@ -22,10 +22,10 @@ mkdir -p ${BUILD_LOGS_DIR}
|
|||||||
cd ${ROOT_DIR} && make -j8 -Cbuild 2> ${BUILD_LOGS_DIR}/build-doc.log
|
cd ${ROOT_DIR} && make -j8 -Cbuild 2> ${BUILD_LOGS_DIR}/build-doc.log
|
||||||
|
|
||||||
# Make Java Documentation
|
# Make Java Documentation
|
||||||
cd ${BUILD_DIR} && find ../src/ -name "javaupm_*.i" > upm.i.list && \
|
cd ${BUILD_DIR} && find ../src/ -name "*.i" > upm.i.list && \
|
||||||
../doxy/doxyport/doxyport upm.i.list \
|
../doxy/doxyport/doxyport upm.i.list \
|
||||||
--cmake ./compile_commands.json \
|
--cmake ./compile_commands.json \
|
||||||
--source ../src/interfaces/,../src/bacnetmstp \
|
--source ../src/interfaces/,../src/bacnetmstp,src \
|
||||||
--destination src/ \
|
--destination src/ \
|
||||||
--convert-protected-to-private \
|
--convert-protected-to-private \
|
||||||
--output upm-java-files.txt \
|
--output upm-java-files.txt \
|
||||||
|
@ -228,18 +228,63 @@ function (_get_target_dependency_interface_include_dirs target varIncludeDirs)
|
|||||||
set(${varIncludeDirs} "${${varIncludeDirs}}" PARENT_SCOPE)
|
set(${varIncludeDirs} "${${varIncludeDirs}}" PARENT_SCOPE)
|
||||||
endfunction (_get_target_dependency_interface_include_dirs target varIncludeDirs)
|
endfunction (_get_target_dependency_interface_include_dirs target varIncludeDirs)
|
||||||
|
|
||||||
|
# This function decides which swig interface file to use for the
|
||||||
|
# CMAKE_CURRENT_SOURCE_DIR. If no .i file exists, create one.
|
||||||
|
#
|
||||||
|
# if ${filePrefix}_${libname}.i exists
|
||||||
|
# return its full path
|
||||||
|
# elif ${libname}.i exists
|
||||||
|
# return its full path
|
||||||
|
# else
|
||||||
|
# create ${libname}.i via template and return its full path
|
||||||
|
#
|
||||||
|
function (_get_current_dot_i_file filePrefix varDotIFile)
|
||||||
|
set(${varDotIFile} "${CMAKE_CURRENT_SOURCE_DIR}/${libname}.i")
|
||||||
|
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${filePrefix}_${libname}.i")
|
||||||
|
set(${varDotIFile} "${CMAKE_CURRENT_SOURCE_DIR}/${filePrefix}_${libname}.i")
|
||||||
|
endif()
|
||||||
|
# If a SWIG .i file DOES NOT exist, make a simple one from the template
|
||||||
|
if (NOT EXISTS "${${varDotIFile}}")
|
||||||
|
# This file will exist OUTSIDE the source tree
|
||||||
|
set(${varDotIFile} "${CMAKE_CURRENT_BINARY_DIR}/${libname}.i")
|
||||||
|
|
||||||
|
# First, create the include variables
|
||||||
|
set(SWIG_HASH_INCLUDES)
|
||||||
|
foreach (_hpp ${module_hpp})
|
||||||
|
set(SWIG_HASH_INCLUDES "#include \"${_hpp}\"")
|
||||||
|
endforeach()
|
||||||
|
string(REPLACE "#" "%" SWIG_PERCENT_INCLUDES "${SWIG_HASH_INCLUDES}")
|
||||||
|
|
||||||
|
# Write the interface file
|
||||||
|
configure_file (${PROJECT_SOURCE_DIR}/src/swigme.i.in "${${varDotIFile}}" @ONLY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(${varDotIFile} "${${varDotIFile}}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
# Create a single swig target for python
|
# Create a single swig target for python
|
||||||
|
# This is a macro since the function which calls it (upm_swig_python) depends
|
||||||
|
# on values set inside this macro
|
||||||
macro(_upm_swig_python)
|
macro(_upm_swig_python)
|
||||||
# Transitive headers don't appear to get picked up by swig_add_module call for
|
# Transitive headers don't appear to get picked up by swig_add_module call for
|
||||||
# wrapper generation. Get them manually and add them here.
|
# wrapper generation. Get them manually and add them here.
|
||||||
_get_target_dependency_interface_include_dirs(${libname} DEPEND_DIRS)
|
_get_target_dependency_interface_include_dirs(${libname} DEPEND_DIRS)
|
||||||
|
|
||||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/..
|
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/..
|
${CMAKE_CURRENT_BINARY_DIR}/..
|
||||||
${DEPEND_DIRS})
|
${DEPEND_DIRS})
|
||||||
|
|
||||||
set_source_files_properties (pyupm_${libname}.i PROPERTIES CPLUSPLUS ON)
|
# Decide between ${libname}.i or a language-specific .i
|
||||||
set_source_files_properties (pyupm_${libname}.i PROPERTIES SWIG_FLAGS "-I${CMAKE_CURRENT_BINARY_DIR}/..")
|
_get_current_dot_i_file(pyupm SWIG_CURRENT_DOT_I_FILE)
|
||||||
|
# If this module is using ${libname}.i, provide a module name for UseSWIG AND SWIG_FLAGS
|
||||||
|
if (${SWIG_CURRENT_DOT_I_FILE} MATCHES ${libname}.i)
|
||||||
|
set_source_files_properties(${SWIG_CURRENT_DOT_I_FILE} PROPERTIES
|
||||||
|
SWIG_MODULE_NAME pyupm_${libname}
|
||||||
|
SWIG_FLAGS ";-module;pyupm_${libname};")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Tell UseSWIG that this is CXX
|
||||||
|
set_property(SOURCE ${SWIG_CURRENT_DOT_I_FILE} PROPERTY CPLUSPLUS ON)
|
||||||
|
|
||||||
# Set current python binary dir
|
# Set current python binary dir
|
||||||
set (CMAKE_CURRENT_PYTHON_BINARY_DIR
|
set (CMAKE_CURRENT_PYTHON_BINARY_DIR
|
||||||
@ -255,9 +300,9 @@ macro(_upm_swig_python)
|
|||||||
# Swig module name (example: pyupm_a110x-python2)
|
# Swig module name (example: pyupm_a110x-python2)
|
||||||
set (python_wrapper_name pyupm_${libname}-python${PYTHON_VERSION_MAJOR})
|
set (python_wrapper_name pyupm_${libname}-python${PYTHON_VERSION_MAJOR})
|
||||||
if (CMAKE_VERSION VERSION_LESS "3.8")
|
if (CMAKE_VERSION VERSION_LESS "3.8")
|
||||||
swig_add_module (${python_wrapper_name} python pyupm_${libname}.i)
|
swig_add_module (${python_wrapper_name} python ${SWIG_CURRENT_DOT_I_FILE})
|
||||||
else ()
|
else ()
|
||||||
swig_add_library (${python_wrapper_name} LANGUAGE python SOURCES pyupm_${libname}.i)
|
swig_add_library (${python_wrapper_name} LANGUAGE python SOURCES ${SWIG_CURRENT_DOT_I_FILE})
|
||||||
endif ()
|
endif ()
|
||||||
# Get target library name (example _pyupm_a110x-python2)
|
# Get target library name (example _pyupm_a110x-python2)
|
||||||
set (python_wrapper_target ${SWIG_MODULE_${python_wrapper_name}_REAL_NAME})
|
set (python_wrapper_target ${SWIG_MODULE_${python_wrapper_name}_REAL_NAME})
|
||||||
@ -361,16 +406,29 @@ function(upm_swig_node)
|
|||||||
# wrapper generation. Get them manually and add them here.
|
# wrapper generation. Get them manually and add them here.
|
||||||
_get_target_dependency_interface_include_dirs(${libname} DEPEND_DIRS)
|
_get_target_dependency_interface_include_dirs(${libname} DEPEND_DIRS)
|
||||||
|
|
||||||
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/..
|
include_directories (${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/..
|
${CMAKE_CURRENT_BINARY_DIR}/..
|
||||||
${DEPEND_DIRS})
|
${DEPEND_DIRS})
|
||||||
|
|
||||||
set_property (SOURCE jsupm_${libname}.i PROPERTY SWIG_FLAGS "-node" "-DV8_VERSION=${V8_VERSION_HEX}")
|
# Decide between ${libname}.i or a language-specific .i
|
||||||
set_source_files_properties (jsupm_${libname}.i PROPERTIES CPLUSPLUS ON)
|
_get_current_dot_i_file(jsupm SWIG_CURRENT_DOT_I_FILE)
|
||||||
|
# If this module is using ${libname}.i, provide a module name for UseSWIG AND SWIG_FLAGS
|
||||||
|
if (${SWIG_CURRENT_DOT_I_FILE} MATCHES ${libname}.i)
|
||||||
|
set_source_files_properties(${SWIG_CURRENT_DOT_I_FILE} PROPERTIES
|
||||||
|
SWIG_MODULE_NAME jsupm_${libname}
|
||||||
|
SWIG_FLAGS ";-module;jsupm_${libname};")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Tell UseSWIG that this is CXX
|
||||||
|
set_property(SOURCE ${SWIG_CURRENT_DOT_I_FILE} PROPERTY CPLUSPLUS ON)
|
||||||
|
# Append additional flags for NodeJS
|
||||||
|
set_property(SOURCE ${SWIG_CURRENT_DOT_I_FILE} APPEND PROPERTY
|
||||||
|
SWIG_FLAGS ";-node;-DV8_VERSION=${V8_VERSION_HEX}")
|
||||||
|
|
||||||
if (CMAKE_VERSION VERSION_LESS "3.8")
|
if (CMAKE_VERSION VERSION_LESS "3.8")
|
||||||
swig_add_module (jsupm_${libname} javascript jsupm_${libname}.i)
|
swig_add_module (jsupm_${libname} javascript ${SWIG_CURRENT_DOT_I_FILE})
|
||||||
else ()
|
else ()
|
||||||
swig_add_library (jsupm_${libname} LANGUAGE javascript SOURCES jsupm_${libname}.i)
|
swig_add_library (jsupm_${libname} LANGUAGE javascript SOURCES ${SWIG_CURRENT_DOT_I_FILE})
|
||||||
endif ()
|
endif ()
|
||||||
add_dependencies(jsupm_${libname} ${libname})
|
add_dependencies(jsupm_${libname} ${libname})
|
||||||
swig_link_libraries (jsupm_${libname} ${NODE_LIBRARIES} ${libname})
|
swig_link_libraries (jsupm_${libname} ${NODE_LIBRARIES} ${libname})
|
||||||
@ -427,20 +485,33 @@ function(upm_swig_java)
|
|||||||
# wrapper generation. Get them manually and add them here.
|
# wrapper generation. Get them manually and add them here.
|
||||||
_get_target_dependency_interface_include_dirs(${libname} DEPEND_DIRS)
|
_get_target_dependency_interface_include_dirs(${libname} DEPEND_DIRS)
|
||||||
|
|
||||||
include_directories (
|
include_directories (${JAVA_INCLUDE_PATH}
|
||||||
${JAVA_INCLUDE_PATH}
|
${JAVA_INCLUDE_PATH2}
|
||||||
${JAVA_INCLUDE_PATH2}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/..
|
${CMAKE_CURRENT_BINARY_DIR}/..
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/..
|
${DEPEND_DIRS})
|
||||||
${DEPEND_DIRS}
|
|
||||||
)
|
# Decide between ${libname}.i or a language-specific .i
|
||||||
|
_get_current_dot_i_file(javaupm SWIG_CURRENT_DOT_I_FILE)
|
||||||
|
# If this module is using ${libname}.i, provide a module name for UseSWIG AND SWIG_FLAGS
|
||||||
|
if (${SWIG_CURRENT_DOT_I_FILE} MATCHES ${libname}.i)
|
||||||
|
set_source_files_properties(${SWIG_CURRENT_DOT_I_FILE} PROPERTIES
|
||||||
|
SWIG_MODULE_NAME javaupm_${libname}
|
||||||
|
SWIG_FLAGS ";-module;javaupm_${libname};")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Tell UseSWIG that this is CXX
|
||||||
|
set_property(SOURCE ${SWIG_CURRENT_DOT_I_FILE} PROPERTY CPLUSPLUS ON)
|
||||||
|
|
||||||
|
# Set a -package as well (which is slightly different than the module name,
|
||||||
|
# module: javaupm_a110x vs package: upm_a110x
|
||||||
|
set_property(SOURCE ${SWIG_CURRENT_DOT_I_FILE} APPEND PROPERTY
|
||||||
|
SWIG_FLAGS ";-package;upm_${libname}")
|
||||||
|
|
||||||
set_source_files_properties (javaupm_${libname}.i PROPERTIES CPLUSPLUS ON)
|
|
||||||
set_source_files_properties (javaupm_${libname}.i PROPERTIES SWIG_FLAGS ";-package;upm_${libname};-I${CMAKE_BINARY_DIR}/src")
|
|
||||||
if (CMAKE_VERSION VERSION_LESS "3.8")
|
if (CMAKE_VERSION VERSION_LESS "3.8")
|
||||||
swig_add_module (javaupm_${libname} java javaupm_${libname}.i)
|
swig_add_module (javaupm_${libname} java ${SWIG_CURRENT_DOT_I_FILE})
|
||||||
else ()
|
else ()
|
||||||
swig_add_library (javaupm_${libname} LANGUAGE java SOURCES javaupm_${libname}.i)
|
swig_add_library (javaupm_${libname} LANGUAGE java SOURCES ${SWIG_CURRENT_DOT_I_FILE})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# If the C++ target depends on C++ interfaces, make the JAVA target
|
# If the C++ target depends on C++ interfaces, make the JAVA target
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* This file provides additional non-wrapper code functionality for use
|
* This file provides additional non-wrapper code functionality for use
|
||||||
* throughout the UPM repository. This file is intended to be %imported
|
* throughout the UPM repository. This file is intended to be %imported
|
||||||
* from the top-level upm.i (not directly by UPM libraries).
|
* from the top-level common_top.i (not directly by UPM libraries).
|
||||||
*
|
*
|
||||||
* No wrapper code will be generated from importing this .i file.
|
* No wrapper code will be generated from importing this .i file.
|
||||||
*/
|
*/
|
||||||
|
18
src/a110x/a110x.i
Normal file
18
src/a110x/a110x.i
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
/* Macro for loading javaupm_a110x */
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_a110x)
|
||||||
|
|
||||||
|
/* Macro adding an installisr call w/JAVA runnable to A110X */
|
||||||
|
JAVA_ADD_INSTALLISR(upm::A110X)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "a110x.hpp"
|
||||||
|
%}
|
||||||
|
%include "a110x.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,6 +0,0 @@
|
|||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "a110x.hpp"
|
|
||||||
%}
|
|
||||||
%include "a110x.hpp"
|
|
@ -1,11 +0,0 @@
|
|||||||
%module javaupm_a110x
|
|
||||||
%include "stdint.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
|
|
||||||
%include "common.i"
|
|
||||||
|
|
||||||
/* Macro for loading javaupm_a110x */
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_a110x)
|
|
||||||
|
|
||||||
/* Macro adding an installisr call w/JAVA runnable to A110X */
|
|
||||||
JAVA_ADD_INSTALLISR(upm::A110X)
|
|
@ -1,3 +0,0 @@
|
|||||||
%module jsupm_a110x
|
|
||||||
|
|
||||||
%include "common.i"
|
|
@ -1,4 +0,0 @@
|
|||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_a110x
|
|
||||||
|
|
||||||
%include "common.i"
|
|
14
src/abp/abp.i
Normal file
14
src/abp/abp.i
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_abp)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "abp.hpp"
|
||||||
|
%}
|
||||||
|
%include "abp.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,11 +0,0 @@
|
|||||||
%module javaupm_abp
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "stdint.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "abp.hpp"
|
|
||||||
%}
|
|
||||||
%include "abp.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_abp)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_abp
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "abp.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "abp.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_abp
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "abp.hpp"
|
|
||||||
%{
|
|
||||||
#include "abp.hpp"
|
|
||||||
%}
|
|
@ -1,10 +0,0 @@
|
|||||||
%module javaupm_ad8232
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "ad8232.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "ad8232.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_ad8232)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_ad8232
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "ad8232.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "ad8232.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_ad8232
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "ad8232.hpp"
|
|
||||||
%{
|
|
||||||
#include "ad8232.hpp"
|
|
||||||
%}
|
|
@ -1,10 +0,0 @@
|
|||||||
%module javaupm_adafruitms1438
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adafruitms1438.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adafruitms1438.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_adafruitms1438)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_adafruitms1438
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adafruitms1438.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adafruitms1438.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_adafruitms1438
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "adafruitms1438.hpp"
|
|
||||||
%{
|
|
||||||
#include "adafruitms1438.hpp"
|
|
||||||
%}
|
|
@ -1,9 +0,0 @@
|
|||||||
%module javaupm_adafruitss
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "adafruitss.hpp"
|
|
||||||
%{
|
|
||||||
#include "adafruitss.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_adafruitss)
|
|
@ -1,7 +0,0 @@
|
|||||||
%module jsupm_adafruitss
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "adafruitss.hpp"
|
|
||||||
%{
|
|
||||||
#include "adafruitss.hpp"
|
|
||||||
%}
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_adafruitss
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "adafruitss.hpp"
|
|
||||||
%{
|
|
||||||
#include "adafruitss.hpp"
|
|
||||||
%}
|
|
20
src/adc121c021/adc121c021.i
Normal file
20
src/adc121c021/adc121c021.i
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_adc121c021)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%include "../carrays_uint16_t.i"
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "adc121c021.hpp"
|
||||||
|
%}
|
||||||
|
%include "adc121c021.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,11 +0,0 @@
|
|||||||
%module javaupm_adc121c021
|
|
||||||
%include "../upm.i"
|
|
||||||
/*%include "../carrays_uint16_t.i"
|
|
||||||
*/
|
|
||||||
%{
|
|
||||||
#include "adc121c021.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adc121c021.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_adc121c021)
|
|
@ -1,9 +0,0 @@
|
|||||||
%module jsupm_adc121c021
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "../carrays_uint16_t.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adc121c021.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adc121c021.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_adc121c021
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "adc121c021.hpp"
|
|
||||||
%{
|
|
||||||
#include "adc121c021.hpp"
|
|
||||||
%}
|
|
@ -1,10 +0,0 @@
|
|||||||
%module javaupm_adis16448
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adis16448.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adis16448.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_adis16448)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_adis16448
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adis16448.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adis16448.hpp"
|
|
@ -1,10 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_adis16448
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adis16448.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adis16448.hpp"
|
|
35
src/ads1x15/ads1x15.i
Normal file
35
src/ads1x15/ads1x15.i
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%import "../interfaces/javaupm_iADC.i"
|
||||||
|
%typemap(javaimports) SWIGTYPE %{import upm_interfaces.*;%}
|
||||||
|
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_ads1x15)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%include "iModuleStatus.hpp"
|
||||||
|
%include "iADC.hpp"
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%include "iModuleStatus.hpp"
|
||||||
|
%include "iADC.hpp"
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "ads1x15.hpp"
|
||||||
|
#include "ads1015.hpp"
|
||||||
|
#include "ads1115.hpp"
|
||||||
|
%}
|
||||||
|
%include "ads1x15.hpp"
|
||||||
|
%include "ads1115.hpp"
|
||||||
|
%include "ads1015.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,21 +0,0 @@
|
|||||||
%module javaupm_ads1x15
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
|
|
||||||
%import "../interfaces/javaupm_iADC.i"
|
|
||||||
|
|
||||||
%typemap(javaimports) SWIGTYPE %{
|
|
||||||
import upm_interfaces.*;
|
|
||||||
%}
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "ads1x15.hpp"
|
|
||||||
#include "ads1015.hpp"
|
|
||||||
#include "ads1115.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "ads1x15.hpp"
|
|
||||||
%include "ads1015.hpp"
|
|
||||||
%include "ads1115.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_ads1x15)
|
|
@ -1,20 +0,0 @@
|
|||||||
%module jsupm_ads1x15
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "iModuleStatus.hpp"
|
|
||||||
%include "iADC.hpp"
|
|
||||||
|
|
||||||
%include "ads1x15.hpp"
|
|
||||||
%{
|
|
||||||
#include "ads1x15.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "ads1015.hpp"
|
|
||||||
%{
|
|
||||||
#include "ads1015.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "ads1115.hpp"
|
|
||||||
%{
|
|
||||||
#include "ads1115.hpp"
|
|
||||||
%}
|
|
@ -1,22 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_ads1x15
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "iModuleStatus.hpp"
|
|
||||||
%include "iADC.hpp"
|
|
||||||
|
|
||||||
%include "ads1x15.hpp"
|
|
||||||
%{
|
|
||||||
#include "ads1x15.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "ads1015.hpp"
|
|
||||||
%{
|
|
||||||
#include "ads1015.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "ads1115.hpp"
|
|
||||||
%{
|
|
||||||
#include "ads1115.hpp"
|
|
||||||
%}
|
|
@ -1,15 +1,10 @@
|
|||||||
%module javaupm_adxl335
|
%include "../common_top.i"
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
%apply int *OUTPUT { int *xVal, int *yVal, int *zVal };
|
%apply int *OUTPUT { int *xVal, int *yVal, int *zVal };
|
||||||
%apply float *OUTPUT { float *xAccel, float *yAccel, float *zAccel };
|
%apply float *OUTPUT { float *xAccel, float *yAccel, float *zAccel };
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adxl335.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%typemap(jni) float* "jfloatArray"
|
%typemap(jni) float* "jfloatArray"
|
||||||
%typemap(jstype) float* "float[]"
|
%typemap(jstype) float* "float[]"
|
||||||
%typemap(jtype) float* "float[]"
|
%typemap(jtype) float* "float[]"
|
||||||
@ -40,6 +35,27 @@
|
|||||||
%ignore values(int *, int *, int *);
|
%ignore values(int *, int *, int *);
|
||||||
%ignore acceleration(float *, float *, float *);
|
%ignore acceleration(float *, float *, float *);
|
||||||
|
|
||||||
%include "adxl335.hpp"
|
JAVA_JNI_LOADLIBRARY(javaupm_adxl335)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_adxl335)
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "adxl335.hpp"
|
||||||
|
%}
|
||||||
|
%include "adxl335.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,12 +0,0 @@
|
|||||||
%module jsupm_adxl335
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
|
|
||||||
%pointer_functions(int, intPointer);
|
|
||||||
%pointer_functions(float, floatPointer);
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adxl335.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adxl335.hpp"
|
|
@ -1,13 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_adxl335
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
|
|
||||||
%pointer_functions(int, intPointer);
|
|
||||||
%pointer_functions(float, floatPointer);
|
|
||||||
|
|
||||||
%include "adxl335.hpp"
|
|
||||||
%{
|
|
||||||
#include "adxl335.hpp"
|
|
||||||
%}
|
|
73
src/adxl345/adxl345.i
Normal file
73
src/adxl345/adxl345.i
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%typemap(jni) float* "jfloatArray"
|
||||||
|
%typemap(jstype) float* "float[]"
|
||||||
|
%typemap(jtype) float* "float[]"
|
||||||
|
|
||||||
|
%typemap(javaout) float* {
|
||||||
|
return $jnicall;
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(out) float * {
|
||||||
|
$result = JCALL1(NewFloatArray, jenv, 3);
|
||||||
|
JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(jni) int16_t* "jshortArray"
|
||||||
|
%typemap(jstype) int16_t* "short[]"
|
||||||
|
%typemap(jtype) int16_t* "short[]"
|
||||||
|
|
||||||
|
%typemap(javaout) int16_t* {
|
||||||
|
return $jnicall;
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(out) int16_t *getRawValues {
|
||||||
|
$result = JCALL1(NewShortArray, jenv, 3);
|
||||||
|
JCALL4(SetShortArrayRegion, jenv, $result, 0, 3, (jshort*)$1);
|
||||||
|
delete [] $1;
|
||||||
|
}
|
||||||
|
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_adxl345)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%include "../carrays_int16_t.i"
|
||||||
|
%include "../carrays_float.i"
|
||||||
|
|
||||||
|
%typemap(out) int16_t * {
|
||||||
|
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int16Array, 0 | 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(out) float * {
|
||||||
|
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_floatArray, 0 | 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
%include <carrays.i>
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%include "../carrays_int16_t.i"
|
||||||
|
%include "../carrays_float.i"
|
||||||
|
|
||||||
|
%typemap(out) int16_t * {
|
||||||
|
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int16Array, 0 | 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(out) float * {
|
||||||
|
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_floatArray, 0 | 0 );
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "adxl345.hpp"
|
||||||
|
%}
|
||||||
|
%include "adxl345.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,38 +0,0 @@
|
|||||||
%module javaupm_adxl345
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adxl345.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%typemap(jni) float* "jfloatArray"
|
|
||||||
%typemap(jstype) float* "float[]"
|
|
||||||
%typemap(jtype) float* "float[]"
|
|
||||||
|
|
||||||
%typemap(javaout) float* {
|
|
||||||
return $jnicall;
|
|
||||||
}
|
|
||||||
|
|
||||||
%typemap(out) float * {
|
|
||||||
$result = JCALL1(NewFloatArray, jenv, 3);
|
|
||||||
JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
%typemap(jni) int16_t* "jshortArray"
|
|
||||||
%typemap(jstype) int16_t* "short[]"
|
|
||||||
%typemap(jtype) int16_t* "short[]"
|
|
||||||
|
|
||||||
%typemap(javaout) int16_t* {
|
|
||||||
return $jnicall;
|
|
||||||
}
|
|
||||||
|
|
||||||
%typemap(out) int16_t *getRawValues {
|
|
||||||
$result = JCALL1(NewShortArray, jenv, 3);
|
|
||||||
JCALL4(SetShortArrayRegion, jenv, $result, 0, 3, (jshort*)$1);
|
|
||||||
delete [] $1;
|
|
||||||
}
|
|
||||||
|
|
||||||
%include "adxl345.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_adxl345)
|
|
@ -1,20 +0,0 @@
|
|||||||
%module jsupm_adxl345
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "../carrays_int16_t.i"
|
|
||||||
%include "../carrays_float.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adxl345.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%typemap(out) int16_t * {
|
|
||||||
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int16Array, 0 | 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
%typemap(out) float * {
|
|
||||||
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_floatArray, 0 | 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
%include "adxl345.hpp"
|
|
||||||
|
|
||||||
%include <carrays.i>
|
|
@ -1,19 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_adxl345
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "../carrays_int16_t.i"
|
|
||||||
%include "../carrays_float.i"
|
|
||||||
|
|
||||||
%typemap(out) int16_t * {
|
|
||||||
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_int16Array, 0 | 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
%typemap(out) float * {
|
|
||||||
$result = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_floatArray, 0 | 0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
%include "adxl345.hpp"
|
|
||||||
%{
|
|
||||||
#include "adxl345.hpp"
|
|
||||||
%}
|
|
@ -1,10 +0,0 @@
|
|||||||
%module javaupm_adxrs610
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adxrs610.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adxrs610.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_adxrs610)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_adxrs610
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "adxrs610.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "adxrs610.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_adxrs610
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "adxrs610.hpp"
|
|
||||||
%{
|
|
||||||
#include "adxrs610.hpp"
|
|
||||||
%}
|
|
@ -1,10 +0,0 @@
|
|||||||
%module javaupm_am2315
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "am2315.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "am2315.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_am2315)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_am2315
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "am2315.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "am2315.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_am2315
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "am2315.hpp"
|
|
||||||
%{
|
|
||||||
#include "am2315.hpp"
|
|
||||||
%}
|
|
52
src/apa102/apa102.i
Normal file
52
src/apa102/apa102.i
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%typemap(jtype) (uint8_t *colors) "byte[]"
|
||||||
|
%typemap(jstype) (uint8_t *colors) "byte[]"
|
||||||
|
%typemap(jni) (uint8_t *colors) "jbyteArray"
|
||||||
|
%typemap(javain) (uint8_t *colors) "$javainput"
|
||||||
|
|
||||||
|
%typemap(in) (uint8_t *colors) {
|
||||||
|
$1 = (uint8_t*)JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_apa102)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%inline %{
|
||||||
|
#include <node_buffer.h>
|
||||||
|
%}
|
||||||
|
|
||||||
|
%typemap(in) (uint8_t *colors) {
|
||||||
|
if (!node::Buffer::HasInstance($input)) {
|
||||||
|
SWIG_exception_fail(SWIG_ERROR, "Expected a node Buffer");
|
||||||
|
}
|
||||||
|
$1 = (uint8_t*) node::Buffer::Data($input);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
// setLeds
|
||||||
|
%typemap(in) (uint8_t *colors) {
|
||||||
|
if (PyByteArray_Check($input)) {
|
||||||
|
$1 = (uint8_t*) PyByteArray_AsString($input);
|
||||||
|
} else {
|
||||||
|
PyErr_SetString(PyExc_ValueError, "bytearray expected");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "apa102.hpp"
|
||||||
|
%}
|
||||||
|
%include "apa102.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,21 +0,0 @@
|
|||||||
%module javaupm_apa102
|
|
||||||
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
|
|
||||||
%typemap(jtype) (uint8_t *colors) "byte[]"
|
|
||||||
%typemap(jstype) (uint8_t *colors) "byte[]"
|
|
||||||
%typemap(jni) (uint8_t *colors) "jbyteArray"
|
|
||||||
%typemap(javain) (uint8_t *colors) "$javainput"
|
|
||||||
|
|
||||||
%typemap(in) (uint8_t *colors) {
|
|
||||||
$1 = (uint8_t*)JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "apa102.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "apa102.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_apa102)
|
|
@ -1,19 +0,0 @@
|
|||||||
%module jsupm_apa102
|
|
||||||
|
|
||||||
%include "../upm.i"
|
|
||||||
%inline %{
|
|
||||||
#include <node_buffer.h>
|
|
||||||
%}
|
|
||||||
|
|
||||||
%typemap(in) (uint8_t *colors) {
|
|
||||||
if (!node::Buffer::HasInstance($input)) {
|
|
||||||
SWIG_exception_fail(SWIG_ERROR, "Expected a node Buffer");
|
|
||||||
}
|
|
||||||
$1 = (uint8_t*) node::Buffer::Data($input);
|
|
||||||
}
|
|
||||||
|
|
||||||
%include "apa102.hpp"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "apa102.hpp"
|
|
||||||
%}
|
|
@ -1,23 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
|
|
||||||
%module pyupm_apa102
|
|
||||||
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
// setLeds
|
|
||||||
%typemap(in) (uint8_t *colors) {
|
|
||||||
if (PyByteArray_Check($input)) {
|
|
||||||
$1 = (uint8_t*) PyByteArray_AsString($input);
|
|
||||||
} else {
|
|
||||||
PyErr_SetString(PyExc_ValueError, "bytearray expected");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
%include "apa102.hpp"
|
|
||||||
|
|
||||||
%{
|
|
||||||
|
|
||||||
#include "apa102.hpp"
|
|
||||||
%}
|
|
@ -1,10 +0,0 @@
|
|||||||
%module javaupm_apds9002
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "apds9002.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "apds9002.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_apds9002)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_apds9002
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "apds9002.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "apds9002.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_apds9002
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "apds9002.hpp"
|
|
||||||
%{
|
|
||||||
#include "apds9002.hpp"
|
|
||||||
%}
|
|
@ -1,9 +0,0 @@
|
|||||||
%module javaupm_apds9930
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "apds9930.hpp"
|
|
||||||
%}
|
|
||||||
%include "apds9930.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_apds9930)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_apds9930
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "apds9930.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "apds9930.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
%module pyupm_apds9930
|
|
||||||
%include "../upm.i"
|
|
||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
|
|
||||||
%include "apds9930.hpp"
|
|
||||||
%{
|
|
||||||
#include "apds9930.hpp"
|
|
||||||
%}
|
|
@ -1,10 +0,0 @@
|
|||||||
%module javaupm_at42qt1070
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "at42qt1070.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "at42qt1070.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_at42qt1070)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_at42qt1070
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "at42qt1070.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "at42qt1070.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_at42qt1070
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "at42qt1070.hpp"
|
|
||||||
%{
|
|
||||||
#include "at42qt1070.hpp"
|
|
||||||
%}
|
|
16
src/bacnetmstp/bacnetmstp.i
Normal file
16
src/bacnetmstp/bacnetmstp.i
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%include "../carrays_uint32_t.i"
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_bacnetmstp)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
%{
|
||||||
|
#include "bacnetmstp.hpp"
|
||||||
|
%}
|
||||||
|
%include "bacnetmstp.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,14 +0,0 @@
|
|||||||
%module javaupm_bacnetmstp
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
%include "../carrays_uint32_t.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "bacnetmstp.hpp"
|
|
||||||
#include "bacnetutil.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "bacnetmstp.hpp"
|
|
||||||
%include "bacnetutil.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_bacnetmstp)
|
|
@ -1,11 +0,0 @@
|
|||||||
%module jsupm_bacnetmstp
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "stdint.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bacnetmstp.hpp"
|
|
||||||
%{
|
|
||||||
#include "bacnetmstp.hpp"
|
|
||||||
%}
|
|
@ -1,13 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_bacnetmstp
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "stdint.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bacnetmstp.hpp"
|
|
||||||
%{
|
|
||||||
#include "bacnetmstp.hpp"
|
|
||||||
%}
|
|
16
src/bh1750/bh1750.i
Normal file
16
src/bh1750/bh1750.i
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_bh1750)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "bh1750_defs.h"
|
||||||
|
#include "bh1750.hpp"
|
||||||
|
%}
|
||||||
|
%include "bh1750_defs.h"
|
||||||
|
%include "bh1750.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,13 +0,0 @@
|
|||||||
%module javaupm_bh1750
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "std_string.i"
|
|
||||||
|
|
||||||
|
|
||||||
%include "bh1750_defs.h"
|
|
||||||
%include "bh1750.hpp"
|
|
||||||
%{
|
|
||||||
#include "bh1750.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_bh1750)
|
|
@ -1,10 +0,0 @@
|
|||||||
%module jsupm_bh1750
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "std_string.i"
|
|
||||||
|
|
||||||
%include "bh1750_defs.h"
|
|
||||||
%include "bh1750.hpp"
|
|
||||||
%{
|
|
||||||
#include "bh1750.hpp"
|
|
||||||
%}
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_bh1750
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "std_string.i"
|
|
||||||
|
|
||||||
%include "bh1750_defs.h"
|
|
||||||
%include "bh1750.hpp"
|
|
||||||
%{
|
|
||||||
#include "bh1750.hpp"
|
|
||||||
%}
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
|||||||
%module javaupm_biss0001
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "biss0001.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "biss0001.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_biss0001)
|
|
@ -1,8 +0,0 @@
|
|||||||
%module jsupm_biss0001
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "biss0001.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "biss0001.hpp"
|
|
@ -1,9 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_biss0001
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "biss0001.hpp"
|
|
||||||
%{
|
|
||||||
#include "biss0001.hpp"
|
|
||||||
%}
|
|
@ -1,7 +1,7 @@
|
|||||||
%module javaupm_bma220
|
%include "../common_top.i"
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
%include "typemaps.i"
|
#ifdef SWIGJAVA
|
||||||
%include "arrays_java.i";
|
%include "arrays_java.i";
|
||||||
%include "../java_buffer.i"
|
%include "../java_buffer.i"
|
||||||
|
|
||||||
@ -23,17 +23,30 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
%ignore getAccelerometer(float *, float *, float *);
|
%ignore getAccelerometer(float *, float *, float *);
|
||||||
|
%ignore installISR(int, mraa::Edge, void *, void *);
|
||||||
%{
|
|
||||||
#include "bma220.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "bma220.hpp"
|
|
||||||
|
|
||||||
%define GETTER get_gpioIntr();
|
%define GETTER get_gpioIntr();
|
||||||
%enddef
|
%enddef
|
||||||
|
|
||||||
JAVA_ADD_INSTALLISR_GPIO(upm::BMA220)
|
JAVA_ADD_INSTALLISR_GPIO(upm::BMA220)
|
||||||
|
|
||||||
%ignore installISR(int, mraa::Edge, void *, void *);
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_bma220)
|
JAVA_JNI_LOADLIBRARY(javaupm_bma220)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "bma220.hpp"
|
||||||
|
%}
|
||||||
|
%include "bma220.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,11 +0,0 @@
|
|||||||
%module jsupm_bma220
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bma220.hpp"
|
|
||||||
%{
|
|
||||||
#include "bma220.hpp"
|
|
||||||
%}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_bma220
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
|
|
||||||
%include "stdint.i"
|
|
||||||
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bma220.hpp"
|
|
||||||
%{
|
|
||||||
#include "bma220.hpp"
|
|
||||||
%}
|
|
||||||
|
|
56
src/bma250e/bma250e.i
Normal file
56
src/bma250e/bma250e.i
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%include "../upm_javastdvector.i"
|
||||||
|
|
||||||
|
%ignore getAccelerometer(float *, float *, float *);
|
||||||
|
%ignore installISR (BMA250E_INTERRUPT_PINS_T, int, mraa::Edge , void *, void *);
|
||||||
|
|
||||||
|
%typemap(javaimports) SWIGTYPE %{
|
||||||
|
import java.util.AbstractList;
|
||||||
|
import java.lang.Float;
|
||||||
|
%}
|
||||||
|
|
||||||
|
%typemap(javaout) upm::BMA250E {
|
||||||
|
return new $&javaclassname($jnicall, true);
|
||||||
|
}
|
||||||
|
%typemap(javaout) std::vector<float> {
|
||||||
|
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
||||||
|
}
|
||||||
|
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
||||||
|
|
||||||
|
%template(floatVector) std::vector<float>;
|
||||||
|
|
||||||
|
%define INTERRUPT BMA250E_INTERRUPT_PINS_T
|
||||||
|
%enddef
|
||||||
|
|
||||||
|
JAVA_ADD_INSTALLISR_INTERRUPT(upm::BMA250E)
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_bma250e)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%include "../upm_vectortypes.i"
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%include "../upm_vectortypes.i"
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "bma250e_defs.h"
|
||||||
|
#include "bma250e.hpp"
|
||||||
|
%}
|
||||||
|
%include "bma250e_defs.h"
|
||||||
|
%include "bma250e.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,38 +0,0 @@
|
|||||||
%module javaupm_bma250e
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
%include "../upm_javastdvector.i"
|
|
||||||
|
|
||||||
%ignore getAccelerometer(float *, float *, float *);
|
|
||||||
|
|
||||||
%typemap(javaimports) SWIGTYPE %{
|
|
||||||
import java.util.AbstractList;
|
|
||||||
import java.lang.Float;
|
|
||||||
%}
|
|
||||||
|
|
||||||
%typemap(javaout) upm::BMA250E {
|
|
||||||
return new $&javaclassname($jnicall, true);
|
|
||||||
}
|
|
||||||
%typemap(javaout) std::vector<float> {
|
|
||||||
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
|
||||||
}
|
|
||||||
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
|
||||||
|
|
||||||
%template(floatVector) std::vector<float>;
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "bma250e.hpp"
|
|
||||||
#include "bma250e_defs.h"
|
|
||||||
%}
|
|
||||||
%include "bma250e_defs.h"
|
|
||||||
%include "bma250e.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
%ignore installISR (BMA250E_INTERRUPT_PINS_T, int, mraa::Edge , void *, void *);
|
|
||||||
|
|
||||||
%define INTERRUPT BMA250E_INTERRUPT_PINS_T
|
|
||||||
%enddef
|
|
||||||
JAVA_ADD_INSTALLISR_INTERRUPT(upm::BMA250E)
|
|
||||||
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_bma250e)
|
|
@ -1,14 +0,0 @@
|
|||||||
%module jsupm_bma250e
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "../upm_vectortypes.i"
|
|
||||||
|
|
||||||
/* Send "int *" and "float *" to JavaScript as intp and floatp */
|
|
||||||
%pointer_functions(int, intp);
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bma250e_defs.h"
|
|
||||||
%include "bma250e.hpp"
|
|
||||||
%{
|
|
||||||
#include "bma250e.hpp"
|
|
||||||
%}
|
|
@ -1,16 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_bma250e
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "../upm_vectortypes.i"
|
|
||||||
|
|
||||||
/* Send "int *" and "float *" to python as intp and floatp */
|
|
||||||
%pointer_functions(int, intp);
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bma250e_defs.h"
|
|
||||||
%include "bma250e.hpp"
|
|
||||||
%{
|
|
||||||
#include "bma250e.hpp"
|
|
||||||
%}
|
|
56
src/bmg160/bmg160.i
Normal file
56
src/bmg160/bmg160.i
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%include "../upm_javastdvector.i"
|
||||||
|
|
||||||
|
%ignore installISR (BMG160_INTERRUPT_PINS_T , int mraa::Edge , void *, void *);
|
||||||
|
%ignore getGyroscope(float *, float *, float *);
|
||||||
|
|
||||||
|
%typemap(javaimports) SWIGTYPE %{
|
||||||
|
import java.util.AbstractList;
|
||||||
|
import java.lang.Float;
|
||||||
|
%}
|
||||||
|
|
||||||
|
%typemap(javaout) SWIGTYPE {
|
||||||
|
return new $&javaclassname($jnicall, true);
|
||||||
|
}
|
||||||
|
%typemap(javaout) std::vector<float> {
|
||||||
|
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
||||||
|
}
|
||||||
|
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
||||||
|
|
||||||
|
%template(floatVector) std::vector<float>;
|
||||||
|
|
||||||
|
%define INTERRUPT BMG160_INTERRUPT_PINS_T
|
||||||
|
%enddef
|
||||||
|
|
||||||
|
JAVA_ADD_INSTALLISR_INTERRUPT(upm::BMG160)
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_bmg160)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%include "../upm_vectortypes.i"
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%include "../upm_vectortypes.i"
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "bmg160_defs.h"
|
||||||
|
#include "bmg160.hpp"
|
||||||
|
%}
|
||||||
|
%include "bmg160_defs.h"
|
||||||
|
%include "bmg160.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,37 +0,0 @@
|
|||||||
%module javaupm_bmg160
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
%include "../upm_javastdvector.i"
|
|
||||||
|
|
||||||
%ignore getGyroscope(float *, float *, float *);
|
|
||||||
|
|
||||||
%typemap(javaimports) SWIGTYPE %{
|
|
||||||
import java.util.AbstractList;
|
|
||||||
import java.lang.Float;
|
|
||||||
%}
|
|
||||||
|
|
||||||
%typemap(javaout) SWIGTYPE {
|
|
||||||
return new $&javaclassname($jnicall, true);
|
|
||||||
}
|
|
||||||
%typemap(javaout) std::vector<float> {
|
|
||||||
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
|
||||||
}
|
|
||||||
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
|
||||||
|
|
||||||
%template(floatVector) std::vector<float>;
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "bmg160.hpp"
|
|
||||||
#include "bmg160_defs.h"
|
|
||||||
%}
|
|
||||||
%include "bmg160_defs.h"
|
|
||||||
%include "bmg160.hpp"
|
|
||||||
|
|
||||||
|
|
||||||
%ignore installISR (BMG160_INTERRUPT_PINS_T , int mraa::Edge , void *, void *);
|
|
||||||
|
|
||||||
%define INTERRUPT BMG160_INTERRUPT_PINS_T
|
|
||||||
%enddef
|
|
||||||
JAVA_ADD_INSTALLISR_INTERRUPT(upm::BMG160)
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_bmg160)
|
|
@ -1,14 +0,0 @@
|
|||||||
%module jsupm_bmg160
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "../upm_vectortypes.i"
|
|
||||||
|
|
||||||
/* Send "int *" and "float *" to JavaScript as intp and floatp */
|
|
||||||
%pointer_functions(int, intp);
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bmg160_defs.h"
|
|
||||||
%include "bmg160.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmg160.hpp"
|
|
||||||
%}
|
|
@ -1,16 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_bmg160
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "../upm_vectortypes.i"
|
|
||||||
|
|
||||||
/* Send "int *" and "float *" to python as intp and floatp */
|
|
||||||
%pointer_functions(int, intp);
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bmg160_defs.h"
|
|
||||||
%include "bmg160.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmg160.hpp"
|
|
||||||
%}
|
|
48
src/bmi160/bmi160.i
Normal file
48
src/bmi160/bmi160.i
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%include "arrays_java.i"
|
||||||
|
%include "../java_buffer.i"
|
||||||
|
|
||||||
|
%typemap(jni) float * "jfloatArray"
|
||||||
|
%typemap(jstype) float * "float[]"
|
||||||
|
%typemap(jtype) float * "float[]"
|
||||||
|
|
||||||
|
%typemap(javaout) float * {
|
||||||
|
return $jnicall;
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(out) float * {
|
||||||
|
$result = JCALL1(NewFloatArray, jenv, 3);
|
||||||
|
JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
|
||||||
|
}
|
||||||
|
|
||||||
|
%ignore getAccelerometer(float *, float *, float *);
|
||||||
|
%ignore getGyroscope(float *, float *, float *);
|
||||||
|
%ignore getMagnetometer(float *, float *, float *);
|
||||||
|
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_bmi160)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "bmi160_defs.h"
|
||||||
|
#include "bmi160.hpp"
|
||||||
|
%}
|
||||||
|
%include "bmi160_defs.h"
|
||||||
|
%include "bmi160.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,33 +0,0 @@
|
|||||||
%module javaupm_bmi160
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
%include "arrays_java.i"
|
|
||||||
%include "../java_buffer.i"
|
|
||||||
%include "std_string.i"
|
|
||||||
|
|
||||||
%include "bmi160_defs.h"
|
|
||||||
%{
|
|
||||||
#include "bmi160.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
|
|
||||||
%typemap(jni) float * "jfloatArray"
|
|
||||||
%typemap(jstype) float * "float[]"
|
|
||||||
%typemap(jtype) float * "float[]"
|
|
||||||
|
|
||||||
%typemap(javaout) float * {
|
|
||||||
return $jnicall;
|
|
||||||
}
|
|
||||||
|
|
||||||
%typemap(out) float * {
|
|
||||||
$result = JCALL1(NewFloatArray, jenv, 3);
|
|
||||||
JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
|
|
||||||
}
|
|
||||||
|
|
||||||
%ignore getAccelerometer(float *, float *, float *);
|
|
||||||
%ignore getGyroscope(float *, float *, float *);
|
|
||||||
%ignore getMagnetometer(float *, float *, float *);
|
|
||||||
|
|
||||||
%include "bmi160.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_bmi160)
|
|
@ -1,12 +0,0 @@
|
|||||||
%module jsupm_bmi160
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "std_string.i"
|
|
||||||
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bmi160_defs.h"
|
|
||||||
%include "bmi160.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmi160.hpp"
|
|
||||||
%}
|
|
@ -1,16 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_bmi160
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "std_string.i"
|
|
||||||
|
|
||||||
%include "stdint.i"
|
|
||||||
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bmi160_defs.h"
|
|
||||||
%include "bmi160.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmi160.hpp"
|
|
||||||
%}
|
|
57
src/bmm150/bmm150.i
Normal file
57
src/bmm150/bmm150.i
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%include "../upm_javastdvector.i"
|
||||||
|
|
||||||
|
%ignore getMagnetometer(float *, float *, float *);
|
||||||
|
|
||||||
|
%typemap(javaimports) SWIGTYPE %{
|
||||||
|
import java.util.AbstractList;
|
||||||
|
import java.lang.Float;
|
||||||
|
%}
|
||||||
|
|
||||||
|
%typemap(javaout) SWIGTYPE {
|
||||||
|
return new $&javaclassname($jnicall, true);
|
||||||
|
}
|
||||||
|
%typemap(javaout) std::vector<float> {
|
||||||
|
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
||||||
|
}
|
||||||
|
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
||||||
|
|
||||||
|
%template(floatVector) std::vector<float>;
|
||||||
|
|
||||||
|
%ignore installISR (BMM150_INTERRUPT_PINS_T , int , mraa::Edge , void *, void *);
|
||||||
|
|
||||||
|
%define INTERRUPT BMM150_INTERRUPT_PINS_T
|
||||||
|
%enddef
|
||||||
|
JAVA_ADD_INSTALLISR_INTERRUPT(upm::BMM150)
|
||||||
|
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_bmm150)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%include "../upm_vectortypes.i"
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%include "../upm_vectortypes.i"
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "bmm150_defs.h"
|
||||||
|
#include "bmm150.hpp"
|
||||||
|
%}
|
||||||
|
%include "bmm150_defs.h"
|
||||||
|
%include "bmm150.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,36 +0,0 @@
|
|||||||
%module javaupm_bmm150
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
%include "../upm_javastdvector.i"
|
|
||||||
|
|
||||||
%ignore getMagnetometer(float *, float *, float *);
|
|
||||||
|
|
||||||
%typemap(javaimports) SWIGTYPE %{
|
|
||||||
import java.util.AbstractList;
|
|
||||||
import java.lang.Float;
|
|
||||||
%}
|
|
||||||
|
|
||||||
%typemap(javaout) SWIGTYPE {
|
|
||||||
return new $&javaclassname($jnicall, true);
|
|
||||||
}
|
|
||||||
%typemap(javaout) std::vector<float> {
|
|
||||||
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
|
||||||
}
|
|
||||||
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
|
||||||
|
|
||||||
%template(floatVector) std::vector<float>;
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "bmm150.hpp"
|
|
||||||
#include "bmm150_defs.h"
|
|
||||||
%}
|
|
||||||
%include "bmm150_defs.h"
|
|
||||||
%include "bmm150.hpp"
|
|
||||||
|
|
||||||
%ignore installISR (BMM150_INTERRUPT_PINS_T , int , mraa::Edge , void *, void *);
|
|
||||||
|
|
||||||
%define INTERRUPT BMM150_INTERRUPT_PINS_T
|
|
||||||
%enddef
|
|
||||||
JAVA_ADD_INSTALLISR_INTERRUPT(upm::BMM150)
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_bmm150)
|
|
@ -1,14 +0,0 @@
|
|||||||
%module jsupm_bmm150
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "../upm_vectortypes.i"
|
|
||||||
|
|
||||||
/* Send "int *" and "float *" to JavaScript as intp and floatp */
|
|
||||||
%pointer_functions(int, intp);
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bmm150_defs.h"
|
|
||||||
%include "bmm150.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmm150.hpp"
|
|
||||||
%}
|
|
@ -1,16 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_bmm150
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "../upm_vectortypes.i"
|
|
||||||
|
|
||||||
/* Send "int *" and "float *" to python as intp and floatp */
|
|
||||||
%pointer_functions(int, intp);
|
|
||||||
%pointer_functions(float, floatp);
|
|
||||||
|
|
||||||
%include "bmm150_defs.h"
|
|
||||||
%include "bmm150.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmm150.hpp"
|
|
||||||
%}
|
|
47
src/bmp280/bmp280.i
Normal file
47
src/bmp280/bmp280.i
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%import "../interfaces/javaupm_iTemperatureSensor.i"
|
||||||
|
%import "../interfaces/javaupm_iHumiditySensor.i"
|
||||||
|
%import "../interfaces/javaupm_iPressureSensor.i"
|
||||||
|
|
||||||
|
%include "arrays_java.i";
|
||||||
|
%include "../java_buffer.i"
|
||||||
|
|
||||||
|
%typemap(javaimports) SWIGTYPE %{
|
||||||
|
import upm_interfaces.*;
|
||||||
|
%}
|
||||||
|
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_bmp280)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%include "iModuleStatus.hpp"
|
||||||
|
%include "iTemperatureSensor.hpp"
|
||||||
|
%include "iPressureSensor.hpp"
|
||||||
|
%include "iHumiditySensor.hpp"
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%include "iModuleStatus.hpp"
|
||||||
|
%include "iTemperatureSensor.hpp"
|
||||||
|
%include "iPressureSensor.hpp"
|
||||||
|
%include "iHumiditySensor.hpp"
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "bmp280_regs.h"
|
||||||
|
#include "bmp280.hpp"
|
||||||
|
#include "bme280.hpp"
|
||||||
|
%}
|
||||||
|
%include "bmp280_regs.h"
|
||||||
|
%include "bmp280.hpp"
|
||||||
|
%include "bme280.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,29 +0,0 @@
|
|||||||
%module javaupm_bmp280
|
|
||||||
|
|
||||||
%import "../interfaces/javaupm_iTemperatureSensor.i"
|
|
||||||
%import "../interfaces/javaupm_iHumiditySensor.i"
|
|
||||||
%import "../interfaces/javaupm_iPressureSensor.i"
|
|
||||||
|
|
||||||
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
%include "typemaps.i"
|
|
||||||
%include "arrays_java.i";
|
|
||||||
%include "../java_buffer.i"
|
|
||||||
|
|
||||||
%typemap(javaimports) SWIGTYPE %{
|
|
||||||
import upm_interfaces.*;
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "bmp280_regs.h"
|
|
||||||
%include "bmp280.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmp280.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "bme280.hpp"
|
|
||||||
%{
|
|
||||||
#include "bme280.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_bmp280)
|
|
@ -1,19 +0,0 @@
|
|||||||
%module jsupm_bmp280
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
|
|
||||||
%include "iModuleStatus.hpp"
|
|
||||||
%include "iHumiditySensor.hpp"
|
|
||||||
%include "iPressureSensor.hpp"
|
|
||||||
%include "iTemperatureSensor.hpp"
|
|
||||||
|
|
||||||
%include "bmp280_regs.h"
|
|
||||||
%include "bmp280.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmp280.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "bme280.hpp"
|
|
||||||
%{
|
|
||||||
#include "bme280.hpp"
|
|
||||||
%}
|
|
@ -1,23 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_bmp280
|
|
||||||
%include "../upm.i"
|
|
||||||
%include "cpointer.i"
|
|
||||||
|
|
||||||
%include "stdint.i"
|
|
||||||
|
|
||||||
%include "iModuleStatus.hpp"
|
|
||||||
%include "iHumiditySensor.hpp"
|
|
||||||
%include "iPressureSensor.hpp"
|
|
||||||
%include "iTemperatureSensor.hpp"
|
|
||||||
|
|
||||||
%include "bmp280_regs.h"
|
|
||||||
%include "bmp280.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmp280.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "bme280.hpp"
|
|
||||||
%{
|
|
||||||
#include "bme280.hpp"
|
|
||||||
%}
|
|
28
src/bmpx8x/bmpx8x.i
Normal file
28
src/bmpx8x/bmpx8x.i
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%import "../interfaces/javaupm_iPressureSensor.i"
|
||||||
|
%typemap(javaimports) SWIGTYPE %{import upm_interfaces.*;%}
|
||||||
|
%import "../interfaces/javaupm_iTemperatureSensor.i"
|
||||||
|
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_bmpx8x)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%include "iModuleStatus.hpp"
|
||||||
|
%include "iTemperatureSensor.hpp"
|
||||||
|
%include "iPressureSensor.hpp"
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "bmpx8x_defs.h"
|
||||||
|
#include "bmpx8x.hpp"
|
||||||
|
%}
|
||||||
|
%include "bmpx8x_defs.h"
|
||||||
|
%include "bmpx8x.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
@ -1,18 +0,0 @@
|
|||||||
%module javaupm_bmpx8x
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%import "../interfaces/javaupm_iTemperatureSensor.i"
|
|
||||||
%import "../interfaces/javaupm_iPressureSensor.i"
|
|
||||||
|
|
||||||
%typemap(javaimports) SWIGTYPE %{
|
|
||||||
import upm_interfaces.*;
|
|
||||||
%}
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "bmpx8x.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "bmpx8x_defs.h"
|
|
||||||
%include "bmpx8x.hpp"
|
|
||||||
|
|
||||||
JAVA_JNI_LOADLIBRARY(javaupm_bmpx8x)
|
|
@ -1,9 +0,0 @@
|
|||||||
%module jsupm_bmpx8x
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%{
|
|
||||||
#include "bmpx8x.hpp"
|
|
||||||
%}
|
|
||||||
|
|
||||||
%include "bmpx8x_defs.h"
|
|
||||||
%include "bmpx8x.hpp"
|
|
@ -1,13 +0,0 @@
|
|||||||
// Include doxygen-generated documentation
|
|
||||||
%include "pyupm_doxy2swig.i"
|
|
||||||
%module pyupm_bmpx8x
|
|
||||||
%include "../upm.i"
|
|
||||||
|
|
||||||
%include "stdint.i"
|
|
||||||
|
|
||||||
%include "bmpx8x_defs.h"
|
|
||||||
%include "bmpx8x.hpp"
|
|
||||||
%{
|
|
||||||
#include "bmpx8x.hpp"
|
|
||||||
%}
|
|
||||||
|
|
65
src/bmx055/bmx055.i
Normal file
65
src/bmx055/bmx055.i
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
%include "../common_top.i"
|
||||||
|
|
||||||
|
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVA
|
||||||
|
%include "../upm_javastdvector.i"
|
||||||
|
|
||||||
|
%apply int {mraa::Edge};
|
||||||
|
|
||||||
|
%ignore getAccelerometer(float *, float *, float *);
|
||||||
|
%ignore getMagnetometer(float *, float *, float *);
|
||||||
|
%ignore getGyroscope(float *, float *, float *);
|
||||||
|
|
||||||
|
%typemap(javaimports) SWIGTYPE %{
|
||||||
|
import java.util.AbstractList;
|
||||||
|
import java.lang.Float;
|
||||||
|
%}
|
||||||
|
|
||||||
|
%typemap(javaout) SWIGTYPE {
|
||||||
|
return new $&javaclassname($jnicall, true);
|
||||||
|
}
|
||||||
|
%typemap(javaout) std::vector<float> {
|
||||||
|
return (AbstractList<Float>)(new $&javaclassname($jnicall, true));
|
||||||
|
}
|
||||||
|
%typemap(jstype) std::vector<float> "AbstractList<Float>"
|
||||||
|
|
||||||
|
%template(floatVector) std::vector<float>;
|
||||||
|
|
||||||
|
JAVA_JNI_LOADLIBRARY(javaupm_bmx055)
|
||||||
|
#endif
|
||||||
|
/* END Java syntax */
|
||||||
|
|
||||||
|
/* BEGIN Javascript syntax ------------------------------------------------- */
|
||||||
|
#ifdef SWIGJAVASCRIPT
|
||||||
|
%include "../upm_vectortypes.i"
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Javascript syntax */
|
||||||
|
|
||||||
|
/* BEGIN Python syntax ----------------------------------------------------- */
|
||||||
|
#ifdef SWIGPYTHON
|
||||||
|
%include "../upm_vectortypes.i"
|
||||||
|
%pointer_functions(int, intp);
|
||||||
|
%pointer_functions(float, floatp);
|
||||||
|
#endif
|
||||||
|
/* END Python syntax */
|
||||||
|
|
||||||
|
/* BEGIN Common SWIG syntax ------------------------------------------------- */
|
||||||
|
%{
|
||||||
|
#include "bmm150_defs.h"
|
||||||
|
#include "bmg160_defs.h"
|
||||||
|
#include "bma250e_defs.h"
|
||||||
|
#include "bmm150.hpp"
|
||||||
|
#include "bmc150.hpp"
|
||||||
|
#include "bmx055.hpp"
|
||||||
|
#include "bmi055.hpp"
|
||||||
|
%}
|
||||||
|
%include "bmm150_defs.h"
|
||||||
|
%include "bmg160_defs.h"
|
||||||
|
%include "bma250e_defs.h"
|
||||||
|
%include "bmm150.hpp"
|
||||||
|
%include "bmx055.hpp"
|
||||||
|
%include "bmi055.hpp"
|
||||||
|
%include "bmc150.hpp"
|
||||||
|
/* END Common SWIG syntax */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user