mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
Added bindings for iMoisture sensors.
Signed-off-by: Serban Waltter <serban.waltter@rinftech.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
2405f933de
commit
079e444fce
28
examples/java/iMoisture_Example.java
Normal file
28
examples/java/iMoisture_Example.java
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* Author: Serban Waltter <serban.waltter@rinftech.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
import upm_new_interfaces.*;
|
||||||
|
|
||||||
|
import upm_moisture.*;
|
||||||
|
import upm_ims.*;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* iMoisture_Example
|
||||||
|
*/
|
||||||
|
public class iMoisture_Example {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
ArrayList<iMoisture> sensors = new ArrayList<iMoisture>();
|
||||||
|
sensors.add(new IMS(0));
|
||||||
|
sensors.add(new Moisture(2));
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
for (int i = 0; i < sensors.size(); i++) {
|
||||||
|
System.out.println("Moisture from sensor " + i + " is " + sensors.get(i).getMoisture());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -427,7 +427,7 @@ function(upm_swig_node)
|
|||||||
|
|
||||||
# Include interface directory
|
# Include interface directory
|
||||||
if (module_iface)
|
if (module_iface)
|
||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Decide between ${libname}.i or a language-specific .i
|
# Decide between ${libname}.i or a language-specific .i
|
||||||
@ -516,6 +516,9 @@ function(upm_swig_java)
|
|||||||
${CMAKE_CURRENT_SOURCE_DIR}
|
${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/..
|
${CMAKE_CURRENT_BINARY_DIR}/..
|
||||||
${DEPEND_DIRS})
|
${DEPEND_DIRS})
|
||||||
|
if (module_iface)
|
||||||
|
include_directories(${PROJECT_SOURCE_DIR}/include)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Decide between ${libname}.i or a language-specific .i
|
# Decide between ${libname}.i or a language-specific .i
|
||||||
_get_current_dot_i_file(javaupm SWIG_CURRENT_DOT_I_FILE)
|
_get_current_dot_i_file(javaupm SWIG_CURRENT_DOT_I_FILE)
|
||||||
@ -550,7 +553,6 @@ function(upm_swig_java)
|
|||||||
endif ()
|
endif ()
|
||||||
if(module_iface)
|
if(module_iface)
|
||||||
add_dependencies(javaupm_${libname} javaupm_new_interfaces)
|
add_dependencies(javaupm_${libname} javaupm_new_interfaces)
|
||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
||||||
set (NEW_INTERFACES_JAR_FILE ${CMAKE_BINARY_DIR}/interfaces/upm_new_interfaces.jar)
|
set (NEW_INTERFACES_JAR_FILE ${CMAKE_BINARY_DIR}/interfaces/upm_new_interfaces.jar)
|
||||||
endif()
|
endif()
|
||||||
# For linker to report unresolved symbols. Note, there is currently no test
|
# For linker to report unresolved symbols. Note, there is currently no test
|
||||||
|
@ -2,4 +2,5 @@ set (libname "grovemoisture")
|
|||||||
set (libdescription "Moisture Sensor")
|
set (libdescription "Moisture Sensor")
|
||||||
set (module_src ${libname}.cxx)
|
set (module_src ${libname}.cxx)
|
||||||
set (module_hpp ${libname}.hpp)
|
set (module_hpp ${libname}.hpp)
|
||||||
|
set (module_iface iMoisture.hpp)
|
||||||
upm_module_init(mraa)
|
upm_module_init(mraa)
|
||||||
|
@ -4,7 +4,7 @@ upm_mixed_module_init (NAME ims
|
|||||||
C_SRC ims.c
|
C_SRC ims.c
|
||||||
CPP_HDR ims.hpp
|
CPP_HDR ims.hpp
|
||||||
CPP_SRC ims.cxx
|
CPP_SRC ims.cxx
|
||||||
IFACE_HDR iLight.hpp iTemperature.hpp
|
IFACE_HDR iMoisture.hpp iTemperature.hpp
|
||||||
FTI_SRC ims_fti.c
|
FTI_SRC ims_fti.c
|
||||||
CPP_WRAPS_C
|
CPP_WRAPS_C
|
||||||
REQUIRES mraa utilities-c)
|
REQUIRES mraa utilities-c)
|
||||||
|
@ -4,6 +4,7 @@ upm_mixed_module_init (NAME moisture
|
|||||||
C_SRC moisture.c
|
C_SRC moisture.c
|
||||||
CPP_HDR moisture.hpp
|
CPP_HDR moisture.hpp
|
||||||
CPP_SRC moisture.cxx
|
CPP_SRC moisture.cxx
|
||||||
|
IFACE_HDR iMoisture.hpp
|
||||||
FTI_SRC moisture_fti.c
|
FTI_SRC moisture_fti.c
|
||||||
CPP_WRAPS_C
|
CPP_WRAPS_C
|
||||||
REQUIRES mraa)
|
REQUIRES mraa)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user