mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
Added new interfaces bindings
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com>
This commit is contained in:
parent
71a7491702
commit
2ac7778d2d
@ -23,6 +23,7 @@
|
||||
*/
|
||||
|
||||
import upm_sht1x.SHT1X;
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
public class SHT1X_Example
|
||||
{
|
||||
@ -32,8 +33,10 @@ public class SHT1X_Example
|
||||
|
||||
// Instantiate a SHT1X sensor using D2 as the clock, and D3 as the
|
||||
// data pin.
|
||||
iTemperature temp = new SHT1X(2, 3);
|
||||
SHT1X sensor = new SHT1X(2, 3);
|
||||
|
||||
|
||||
// Every 2 seconds, update and print values
|
||||
while (true)
|
||||
{
|
||||
|
@ -531,6 +531,10 @@ function(upm_swig_java)
|
||||
# target .jar file in the classpath, otherwise this variable will be empty
|
||||
set (INTERFACES_JAR_FILE ${CMAKE_BINARY_DIR}/src/interfaces/upm_interfaces.jar)
|
||||
endif ()
|
||||
if(module_iface)
|
||||
add_dependencies(javaupm_${libname} javaupm_new_interfaces)
|
||||
set (NEW_INTERFACES_JAR_FILE ${CMAKE_BINARY_DIR}/interfaces/upm_new_interfaces.jar)
|
||||
endif()
|
||||
# For linker to report unresolved symbols. Note, there is currently no test
|
||||
# for linker flags (similar to compile files), so this is it for now.
|
||||
swig_link_libraries (javaupm_${libname} ${MRAAJAVA_LIBRARY} ${JAVA_LIBRARIES} ${libname} -Wl,--unresolved-symbols=report-all)
|
||||
@ -581,7 +585,7 @@ function(upm_swig_java)
|
||||
add_custom_command (TARGET javaupm_${libname}
|
||||
POST_BUILD
|
||||
COMMAND cmake -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/upm_${libname}
|
||||
COMMAND ${JAVAC} *.java -d ${CMAKE_CURRENT_BINARY_DIR} -cp ${INTERFACES_JAR_FILE}:.
|
||||
COMMAND ${JAVAC} *.java -d ${CMAKE_CURRENT_BINARY_DIR} -cp ${INTERFACES_JAR_FILE}:${NEW_INTERFACES_JAR_FILE}:.
|
||||
COMMAND ${JAR} cf upm_${libname}.jar upm_${libname}
|
||||
)
|
||||
|
||||
|
@ -1,10 +1,17 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="pyupm_new_interfaces") sht1x
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
%}
|
||||
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_sht1x)
|
||||
#endif
|
||||
/* END Java syntax */
|
||||
|
Loading…
x
Reference in New Issue
Block a user