Merge 1895004cf5112366b2effa9f71e58c3f9cf025cc into 74b5ec00dc18d534dcc3442b1c23ee0ada2738ec

This commit is contained in:
Stefan Andritoiu 2018-01-23 20:17:06 +00:00 committed by GitHub
commit f757debb38
252 changed files with 606 additions and 2618 deletions

View File

@ -437,16 +437,10 @@ function(upm_swig_java)
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")
# NOTE, ${module_src} is ONLY needed when swig'ing to JAVA. This is
# because *some* upm libraries have ifdef's for JAVA and SWIG in their
# source (cxx) which builds in different functionality. Because of this,
# the source must be added when building the JAVA wrapper.
# See issue #518
# TODO: Fix this somehow
if (CMAKE_VERSION VERSION_LESS "3.8")
swig_add_module (javaupm_${libname} java javaupm_${libname}.i ${module_src})
swig_add_module (javaupm_${libname} java javaupm_${libname}.i)
else ()
swig_add_library (javaupm_${libname} LANGUAGE java SOURCES javaupm_${libname}.i ${module_src})
swig_add_library (javaupm_${libname} LANGUAGE java SOURCES javaupm_${libname}.i)
endif ()
# If the C++ target depends on C++ interfaces, make the JAVA target

77
src/_upm.i Normal file
View File

@ -0,0 +1,77 @@
/* Macro for adding JAVA run
usage: JAVA_ADD_INSTALLISR(javaupm_a110x)
*/
%define JAVA_ADD_INSTALLISR(UPM_Classname)
%extend UPM_Classname {
void installISR(jobject runnable)
{
$self->installISR(mraa_java_isr_callback, runnable);
}
}
%enddef
/* Define GETTER in the appropiate .i file with the getter function name
*/
%define JAVA_ADD_INSTALLISR_GPIO(UPM_Classname)
%extend UPM_Classname {
void installISR(int gpio, mraa::Edge level, jobject runnable)
{
// delete any existing ISR and GPIO context
$self->uninstallISR();
// create gpio context
mraa::Gpio* swg_gpioIntr = $self->GETTER;
swg_gpioIntr->dir(mraa::DIR_IN);
swg_gpioIntr->isr(level, runnable);
}
}
%enddef
/* Define INTERRUPT in the appropiate .i file with the interrupt type
*/
%define JAVA_ADD_INSTALLISR_INTERRUPT(UPM_Classname)
%extend UPM_Classname {
void installISR(INTERRUPT intr, int gpio,
mraa::Edge level, jobject runnable)
{
$self->installISR(intr, gpio, level, mraa_java_isr_callback, runnable);
}
}
%enddef
%define JAVA_ADD_INSTALLISR_EDGE(UPM_Classname)
%extend UPM_Classname {
void installISR(mraa::Edge level, jobject runnable)
{
$self->installISR(level, mraa_java_isr_callback, runnable);
}
}
%enddef
%define JAVA_ADD_INSTALLISR_PIN(UPM_Classname)
%extend UPM_Classname {
void installISR(int pin, jobject runnable)
{
$self->installISR(pin, mraa_java_isr_callback, runnable);
}
}
%enddef
/* Macro for adding JNI loadLibrary dependency
usage: JAVA_JNI_LOADLIBRARY(javaupm_rhusb)
*/
%define JAVA_JNI_LOADLIBRARY(MyModuleName)
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("MyModuleName");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library (MyModuleName) failed to load. \n" + e);
System.exit(1);
}
}
%}
%enddef

View File

@ -57,13 +57,6 @@ bool A110X::magnetDetected()
return (!mraa_gpio_read(m_gpio) ? true : false);
}
#ifdef JAVACALLBACK
void A110X::installISR(jobject runnable)
{
installISR(mraa_java_isr_callback, runnable);
}
#endif
void A110X::installISR(void (*isr)(void *), void *arg)
{
if (m_isrInstalled)

View File

@ -85,11 +85,8 @@ namespace upm {
* @param arg Pointer to an object to be supplied as an
* argument to the ISR.
*/
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(jobject runnable);
#else
void installISR(void (*isr)(void *), void *arg);
#endif
/**
* Uninstalls the previously installed ISR
*
@ -97,9 +94,6 @@ namespace upm {
void uninstallISR();
private:
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(void (*isr)(void *), void *arg);
#endif
bool m_isrInstalled;
mraa_gpio_context m_gpio;

6
src/a110x/common.i Normal file
View File

@ -0,0 +1,6 @@
%include "../upm.i"
%{
#include "a110x.hpp"
%}
%include "a110x.hpp"

View File

@ -1,20 +1,11 @@
%module javaupm_a110x
%include "../upm.i"
%include "stdint.i"
%include "typemaps.i"
%{
#include "a110x.hpp"
%}
%include "a110x.hpp"
%include "common.i"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_a110x");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
/* 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)

View File

@ -1,8 +1,3 @@
%module jsupm_a110x
%include "../upm.i"
%{
#include "a110x.hpp"
%}
%include "a110x.hpp"
%include "common.i"

View File

@ -1,9 +1,4 @@
// Include doxygen-generated documentation
%include "pyupm_doxy2swig.i"
%module pyupm_a110x
%include "../upm.i"
%include "a110x.hpp"
%{
#include "a110x.hpp"
%}
%include "common.i"

View File

@ -8,13 +8,4 @@
%}
%include "abp.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_abp");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_abp)

View File

@ -7,13 +7,4 @@
%include "ad8232.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ad8232");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_ad8232)

View File

@ -7,13 +7,4 @@
%include "adafruitms1438.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_adafruitms1438");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_adafruitms1438)

View File

@ -6,13 +6,4 @@
#include "adafruitss.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_adafruitss");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_adafruitss)

View File

@ -8,13 +8,4 @@
%include "adc121c021.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_adc121c021");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_adc121c021)

View File

@ -7,13 +7,4 @@
%include "adis16448.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_adis16448");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_adis16448)

View File

@ -18,13 +18,4 @@ import upm_interfaces.*;
%include "ads1015.hpp"
%include "ads1115.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ads1x15");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_ads1x15)

View File

@ -42,13 +42,4 @@
%include "adxl335.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_adxl335");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_adxl335)

View File

@ -35,13 +35,4 @@
%include "adxl345.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_adxl345");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_adxl345)

View File

@ -7,13 +7,4 @@
%include "adxrs610.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_adxrs610");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_adxrs610)

View File

@ -7,13 +7,4 @@
%include "am2315.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_am2315");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_am2315)

View File

@ -18,13 +18,4 @@
%include "apa102.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_apa102");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_apa102)

View File

@ -7,13 +7,4 @@
%include "apds9002.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_apds9002");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_apds9002)

View File

@ -6,13 +6,4 @@
%}
%include "apds9930.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_apds9930");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_apds9930)

View File

@ -7,13 +7,4 @@
%include "at42qt1070.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_at42qt1070");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_at42qt1070)

View File

@ -11,13 +11,4 @@
%include "bacnetmstp.hpp"
%include "bacnetutil.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bacnetmstp");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_bacnetmstp)

View File

@ -10,13 +10,4 @@
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bh1750");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_bh1750)

View File

@ -7,13 +7,4 @@
%include "biss0001.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_biss0001");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_biss0001)

View File

@ -489,21 +489,7 @@ bool BMA220::resetInterrupts()
return writeReg(REG_ENABLE_CONFIG2, reg);
}
#if defined(SWIGJAVA) || (JAVACALLBACK)
void BMA220::installISR(int gpio, mraa::Edge level,
jobject runnable)
{
// delete any existing ISR and GPIO context
uninstallISR();
// create gpio context
m_gpioIntr = new mraa::Gpio(gpio);
m_gpioIntr->dir(mraa::DIR_IN);
m_gpioIntr->isr(level, runnable);
}
#else
void BMA220::installISR(int gpio, mraa::Edge level,
void (*isr)(void *), void *arg)
{
@ -516,7 +502,6 @@ void BMA220::installISR(int gpio, mraa::Edge level,
m_gpioIntr->dir(mraa::DIR_IN);
m_gpioIntr->isr(level, isr, arg);
}
#endif
void BMA220::uninstallISR()
{
@ -529,3 +514,7 @@ void BMA220::uninstallISR()
}
}
mraa::Gpio* BMA220::get_gpioIntr()
{
return m_gpioIntr;
}

View File

@ -776,9 +776,7 @@ namespace upm {
*/
bool resetInterrupts();
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(int gpio, mraa::Edge level, jobject runnable);
#else
/**
* install an interrupt handler.
*
@ -791,7 +789,6 @@ namespace upm {
*/
void installISR(int gpio, mraa::Edge level,
void (*isr)(void *), void *arg);
#endif
/**
* uninstall a previously installed interrupt handler
@ -799,6 +796,8 @@ namespace upm {
*/
void uninstallISR();
mraa::Gpio* get_gpioIntr();
protected:
mraa::I2c m_i2c;
mraa::Gpio *m_gpioIntr;
@ -821,13 +820,6 @@ namespace upm {
* update the accelerometer values
*/
void updateAccelerometer();
// Adding a private function definition for java bindings
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(int gpio, mraa::Edge level,
void (*isr)(void *), void *arg);
#endif
};
}

View File

@ -30,13 +30,10 @@
%include "bma220.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bma220");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
%define GETTER get_gpioIntr();
%enddef
JAVA_ADD_INSTALLISR_GPIO(upm::BMA220)
%ignore installISR(int, mraa::Edge, void *, void *);
JAVA_JNI_LOADLIBRARY(javaupm_bma220)

View File

@ -518,14 +518,7 @@ namespace upm {
void setLowPowerMode2();
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(BMA250E_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level, jobject runnable)
{
installISR(intr, gpio, level, mraa_java_isr_callback, runnable);
}
#else
/**
/**
* install an interrupt handler.
*
* @param intr One of the BMA250E_INTERRUPT_PINS_T values
@ -541,7 +534,6 @@ namespace upm {
void installISR(BMA250E_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level,
void (*isr)(void *), void *arg);
#endif
/**
* uninstall a previously installed interrupt handler
@ -586,11 +578,5 @@ namespace upm {
BMA250E(const BMA250E&) = delete;
BMA250E &operator=(const BMA250E&) = delete;
// Adding a private function definition for java bindings
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(BMA250E_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level,
void (*isr)(void *), void *arg);
#endif
};
}

View File

@ -20,19 +20,19 @@ import java.lang.Float;
%template(floatVector) std::vector<float>;
%include "bma250e_defs.h"
%include "bma250e.hpp"
%{
#include "bma250e.hpp"
#include "bma250e_defs.h"
%}
%include "bma250e_defs.h"
%include "bma250e.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bma250e");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
%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)

View File

@ -415,13 +415,6 @@ namespace upm {
*/
void enableOutputFiltering(bool filter);
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(BMG160_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level, jobject runnable)
{
installISR(intr, gpio, level, mraa_java_isr_callback, runnable);
}
#else
/**
* install an interrupt handler.
*
@ -439,7 +432,6 @@ namespace upm {
void installISR(BMG160_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level,
void (*isr)(void *), void *arg);
#endif
/**
* uninstall a previously installed interrupt handler
@ -484,11 +476,5 @@ namespace upm {
BMG160(const BMG160&) = delete;
BMG160 &operator=(const BMG160&) = delete;
// needs to be private for SWIG Java builds
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(BMG160_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level,
void (*isr)(void *), void *arg);
#endif
};
}

View File

@ -20,19 +20,18 @@ import java.lang.Float;
%template(floatVector) std::vector<float>;
%include "bmg160_defs.h"
%include "bmg160.hpp"
%{
#include "bmg160.hpp"
#include "bmg160_defs.h"
%}
%include "bmg160_defs.h"
%include "bmg160.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bmg160");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
%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)

View File

@ -30,13 +30,4 @@
%include "bmi160.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bmi160");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_bmi160)

View File

@ -281,14 +281,6 @@ namespace upm {
*/
void setRepetitionsZ(uint8_t reps);
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(BMM150_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level,
jobject runnable)
{
installISR(intr, gpio, level, mraa_java_isr_callback, runnable);
}
#else
/**
* Install an interrupt handler.
*
@ -305,7 +297,6 @@ namespace upm {
void installISR(BMM150_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level,
void (*isr)(void *), void *arg);
#endif
/**
* Uninstall a previously installed interrupt handler.
@ -350,11 +341,5 @@ namespace upm {
BMM150(const BMM150&) = delete;
BMM150 &operator=(const BMM150&) = delete;
// Adding a private function definition for java bindings
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(BMM150_INTERRUPT_PINS_T intr, int gpio,
mraa::Edge level,
void (*isr)(void *), void *arg);
#endif
};
}

View File

@ -20,19 +20,17 @@ import java.lang.Float;
%template(floatVector) std::vector<float>;
%include "bmm150_defs.h"
%include "bmm150.hpp"
%{
#include "bmm150.hpp"
#include "bmm150_defs.h"
%}
%include "bmm150_defs.h"
%include "bmm150.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bmm150");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
%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)

View File

@ -26,13 +26,4 @@
#include "bme280.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bmp280");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_bmp280)

View File

@ -15,13 +15,4 @@ import upm_interfaces.*;
%include "bmpx8x_defs.h"
%include "bmpx8x.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bmpx8x");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_bmpx8x)

View File

@ -44,13 +44,4 @@ import java.lang.Float;
#include "bmi055.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bmx055");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_bmx055)

View File

@ -622,12 +622,6 @@ namespace upm {
BNO055_SYS_ERR_T getSystemError();
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(int gpio, mraa_gpio_edge_t level, jobject runnable)
{
installISR(gpio, level, mraa_java_isr_callback, runnable);
}
#else
/**
* install an interrupt handler.
*
@ -641,7 +635,6 @@ namespace upm {
*/
void installISR(int gpio, mraa_gpio_edge_t level,
void (*isr)(void *), void *arg);
#endif
/**
* uninstall a previously installed interrupt handler
@ -707,10 +700,5 @@ namespace upm {
BNO055(const BNO055&) = delete;
BNO055 &operator=(const BNO055&) = delete;
// Adding a private function definition for java bindings
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(int gpio, mraa_gpio_edge_t level,
void (*isr)(void *), void *arg);
#endif
};
}

View File

@ -18,19 +18,20 @@
%template(byteVector) std::vector<uint8_t>;
%template(intVector) std::vector<int>;
%include "bno055_regs.h"
%include "bno055.hpp"
%{
#include "bno055.hpp"
#include "bno055_regs.h"
%}
%include "bno055_regs.h"
%include "bno055.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_bno055");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
%ignore installISR(int , mraa::Edge , void *, void *);
%extend upm::BNO055 {
void installISR(int gpio, mraa_gpio_edge_t level, jobject runnable)
{
$self->installISR(gpio, level, mraa_java_isr_callback, runnable);
}
%}
}
JAVA_JNI_LOADLIBRARY(javaupm_bno055)

View File

@ -59,12 +59,12 @@ int Button::value()
return mraa_gpio_read(m_gpio);
}
#ifdef JAVACALLBACK
/*#ifdef JAVACALLBACK
void Button::installISR(mraa::Edge level, jobject runnable)
{
installISR(level, mraa_java_isr_callback, runnable);
}
#endif
#endif*/
void Button::installISR(mraa::Edge level, void (*isr)(void *), void *arg)
{

View File

@ -87,11 +87,11 @@ class Button{
* @param arg Pointer to an object to be supplied as an
* argument to the ISR.
*/
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
/*#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(mraa::Edge level, jobject runnable);
#else
#else*/
void installISR(mraa::Edge level, void (*isr)(void *), void *arg);
#endif
//#endif
/**
* Uninstalls the previously installed ISR
*
@ -99,9 +99,6 @@ class Button{
void uninstallISR();
private:
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(mraa::Edge level, void (*isr)(void *), void *arg);
#endif
bool m_isrInstalled;
std::string m_name;
mraa_gpio_context m_gpio;

View File

@ -9,13 +9,8 @@
%include "button.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_button");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
#%ignore
JAVA_ADD_INSTALLISR_EDGE(upm::Button)
JAVA_JNI_LOADLIBRARY(javaupm_button)

View File

@ -8,13 +8,4 @@
#include "buzzer.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_buzzer");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_buzzer)

View File

@ -7,13 +7,4 @@
%include "cjq4435.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_cjq4435");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_cjq4435)

View File

@ -7,13 +7,4 @@
%include "collision.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_collision");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_collision)

View File

@ -30,13 +30,4 @@
%include "curieimu.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_curieimu");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_curieimu)

View File

@ -7,13 +7,4 @@
#include "cwlsxxa.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_cwlsxxa");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_cwlsxxa)

View File

@ -9,13 +9,4 @@
#include "dfrec.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_dfrec");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_dfrec)

View File

@ -9,13 +9,4 @@
#include "dfrorp.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_dfrorp");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_dfrorp)

View File

@ -7,13 +7,4 @@
%include "dfrph.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_dfrph");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_dfrph)

View File

@ -9,13 +9,4 @@
%include "ds1307.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ds1307");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_ds1307)

View File

@ -18,13 +18,4 @@ import upm_interfaces.*;
%include "ds1808lc.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ds1808lc");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_ds1808lc)

View File

@ -11,13 +11,4 @@
%array_class(char, charArray);
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ds18b20");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_ds18b20)

View File

@ -10,13 +10,4 @@
%include "ds2413.hpp"
%array_class(char, charArray);
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ds2413");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_ds2413)

View File

@ -22,13 +22,4 @@
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_e50hx");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_e50hx)

View File

@ -10,13 +10,4 @@
#include "ecezo.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ecezo");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_ecezo)

View File

@ -7,13 +7,4 @@
%include "ecs1030.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ecs1030");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_ecs1030)

View File

@ -9,13 +9,4 @@
%include "ehr.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ehr");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_ehr)

View File

@ -7,13 +7,4 @@
%include "eldriver.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_eldriver");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_eldriver)

View File

@ -7,13 +7,4 @@
%include "electromagnet.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_electromagnet");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_electromagnet)

View File

@ -7,13 +7,4 @@
%include "emg.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_emg");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_emg)

View File

@ -7,13 +7,4 @@
%include "enc03r.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_enc03r");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_enc03r)

View File

@ -7,13 +7,4 @@
%include "flex.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_flex");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_flex)

View File

@ -56,13 +56,4 @@
%include "mq9.hpp"
%include "tp401.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_gas");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_gas)

View File

@ -7,13 +7,4 @@
%include "gp2y0a.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_gp2y0a");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_gp2y0a)

View File

@ -10,13 +10,4 @@
%include "gprs.hpp"
%array_class(char, charArray);
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_gprs");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_gprs)

View File

@ -58,12 +58,12 @@ int GroveButton::value()
return mraa_gpio_read(m_gpio);
}
#ifdef JAVACALLBACK
/*#ifdef JAVACALLBACK
void GroveButton::installISR(mraa::Edge level, jobject runnable)
{
installISR(level, mraa_java_isr_callback, runnable);
}
#endif
#endif*/
void GroveButton::installISR(mraa::Edge level, void (*isr)(void *), void *arg)
{

View File

@ -84,11 +84,11 @@ class GroveButton: public Grove {
* @param arg Pointer to an object to be supplied as an
* argument to the ISR.
*/
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(mraa::Edge level, jobject runnable);
#else
//#if defined(SWIGJAVA) || defined(JAVACALLBACK)
// void installISR(mraa::Edge level, jobject runnable);
//#else
void installISR(mraa::Edge level, void (*isr)(void *), void *arg);
#endif
//#endif
/**
* Uninstalls the previously installed ISR
*
@ -96,9 +96,6 @@ class GroveButton: public Grove {
void uninstallISR();
private:
#if defined(SWIGJAVA) || defined(JAVACALLBACK)
void installISR(mraa::Edge level, void (*isr)(void *), void *arg);
#endif
bool m_isrInstalled;
std::string m_name;
mraa_gpio_context m_gpio;

View File

@ -49,13 +49,8 @@
#include "grovetemp.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grove");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_ADD_INSTALLISR_EDGE(upm::GroveButton)
JAVA_JNI_LOADLIBRARY(javaupm_grove)

View File

@ -7,13 +7,4 @@
%include "grovecollision.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovecollision");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovecollision)

View File

@ -9,13 +9,4 @@
%include "groveehr.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_groveehr");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_groveehr)

View File

@ -7,13 +7,4 @@
%include "groveeldriver.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_groveeldriver");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_groveeldriver)

View File

@ -7,13 +7,4 @@
%include "groveelectromagnet.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_groveelectromagnet");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_groveelectromagnet)

View File

@ -7,13 +7,4 @@
%include "groveemg.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_groveemg");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_groveemg)

View File

@ -10,13 +10,4 @@
%include "grovegprs.hpp"
%array_class(char, charArray);
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovegprs");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovegprs)

View File

@ -7,13 +7,4 @@
%include "grovegsr.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovegsr");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovegsr)

View File

@ -7,13 +7,4 @@
%include "grovelinefinder.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovelinefinder");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovelinefinder)

View File

@ -7,13 +7,4 @@
%include "grovemd.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovemd");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovemd)

View File

@ -7,13 +7,4 @@
%include "grovemoisture.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovemoisture");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovemoisture)

View File

@ -7,13 +7,4 @@
%include "groveo2.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_groveo2");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_groveo2)

View File

@ -8,13 +8,4 @@
%include "grovescam.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovescam");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovescam)

View File

@ -7,13 +7,4 @@
%include "grovespeaker.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovespeaker");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovespeaker)

View File

@ -9,13 +9,4 @@
%include "groveultrasonic.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_groveultrasonic");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_groveultrasonic)

View File

@ -7,13 +7,4 @@
%include "grovevdiv.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovevdiv");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovevdiv)

View File

@ -7,13 +7,4 @@
%include "grovewater.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovewater");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovewater)

View File

@ -9,13 +9,4 @@
%include "grovewfs.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovewfs");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_grovewfs)

View File

@ -7,13 +7,4 @@
%include "gsr.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_gsr");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_gsr)

View File

@ -7,13 +7,4 @@
%include "guvas12d.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_guvas12d");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_guvas12d)

View File

@ -50,13 +50,4 @@
%include "h3lis331dl.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_h3lis331dl");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_h3lis331dl)

View File

@ -8,13 +8,4 @@
%include "h803x.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_h803x");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_h803x)

View File

@ -8,14 +8,5 @@
%include "hcsr04.h"
%include "hcsr04.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_hcsr04");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_hcsr04)

View File

@ -7,13 +7,4 @@
%include "hdc1000.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_hdc1000");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_hdc1000)

View File

@ -9,13 +9,4 @@
%include "hdxxvxta.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_hdxxvxta");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_hdxxvxta)

View File

@ -9,13 +9,4 @@
#include "hka5.hpp"
%}
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_hka5");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_hka5)

View File

@ -18,13 +18,4 @@ import upm_interfaces.*;
%include "hlg150h.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_hlg150h");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_hlg150h)

View File

@ -12,13 +12,4 @@
speed_t int_B9600 = B9600;
%array_class(char, charArray);
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_hm11");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_hm11)

View File

@ -20,13 +20,4 @@
%include "hmc5883l.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_hmc5883l");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_hmc5883l)

View File

@ -25,13 +25,4 @@ READDATA_EXCEPTION(getModSignalStrength())
%include "hmtrp.hpp"
speed_t int_B9600 = B9600;
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_hmtrp");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}
JAVA_JNI_LOADLIBRARY(javaupm_hmtrp)

Some files were not shown because too many files have changed in this diff Show More