mirror of
https://github.com/eclipse/upm.git
synced 2025-03-14 20:47:30 +03:00
Added bindings for iHeartRate 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
87fc11adbe
commit
bbcee52880
28
examples/java/iHeartRate_Example.java
Normal file
28
examples/java/iHeartRate_Example.java
Normal file
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Author: Serban Waltter <serban.waltter@rinftech.com>
|
||||
*/
|
||||
|
||||
import upm_new_interfaces.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import upm_ehr.*;
|
||||
import upm_groveehr.*;
|
||||
|
||||
/**
|
||||
* iHeartRate_Example
|
||||
*/
|
||||
public class iHeartRate_Example {
|
||||
|
||||
public static void main(String[] args) {
|
||||
ArrayList<iHeartRate> sensors = new ArrayList<iHeartRate>();
|
||||
sensors.add(new EHR(2));
|
||||
sensors.add(new GroveEHR(3));
|
||||
|
||||
while (true) {
|
||||
for (int i = 0; i < sensors.size(); i++) {
|
||||
System.out.println("HR from sensor " + i + " is " + sensors.get(i).getHeartRate());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -2,4 +2,5 @@ upm_mixed_module_init (NAME ehr
|
||||
DESCRIPTION "Ear-clip Heart Rate Sensor"
|
||||
CPP_HDR ehr.hpp
|
||||
CPP_SRC ehr.cxx
|
||||
IFACE_HDR iHeartRate.hpp
|
||||
REQUIRES mraa)
|
||||
|
@ -1,7 +1,17 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="pyupm_new_interfaces") ehr
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
%}
|
||||
|
||||
%ignore beatISR;
|
||||
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_ehr)
|
||||
|
@ -2,4 +2,5 @@ set (libname "groveehr")
|
||||
set (libdescription "Ear-clip Heart Rate Sensor")
|
||||
set (module_src ${libname}.cxx)
|
||||
set (module_hpp ${libname}.hpp)
|
||||
set (module_iface iHeartRate.hpp)
|
||||
upm_module_init(mraa)
|
||||
|
@ -1,7 +1,17 @@
|
||||
#ifdef SWIGPYTHON
|
||||
%module (package="pyupm_new_interfaces") ehr
|
||||
#endif
|
||||
|
||||
%import "interfaces/new_interfaces.i"
|
||||
|
||||
%include "../common_top.i"
|
||||
|
||||
/* BEGIN Java syntax ------------------------------------------------------- */
|
||||
#ifdef SWIGJAVA
|
||||
%typemap(javaimports) SWIGTYPE %{
|
||||
import upm_new_interfaces.*;
|
||||
%}
|
||||
|
||||
%ignore beatISR;
|
||||
|
||||
JAVA_JNI_LOADLIBRARY(javaupm_groveehr)
|
||||
|
Loading…
x
Reference in New Issue
Block a user