java: Added "automatic load library" code for new sensors

Signed-off-by: Stefan Andritoiu <stefan.andritoiu@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Stefan Andritoiu 2015-12-04 14:47:59 +02:00 committed by Mihai Tudor Panu
parent 01119436a9
commit 1667569560
3 changed files with 33 additions and 0 deletions

View File

@ -8,3 +8,14 @@
%} %}
%include "groveultrasonic.h" %include "groveultrasonic.h"
%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);
}
}
%}

View File

@ -10,3 +10,14 @@
%} %}
%include "ozw.h" %include "ozw.h"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_ozw");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}

View File

@ -13,3 +13,14 @@
%ignore getRxBuffer(); %ignore getRxBuffer();
%include "sx1276.h" %include "sx1276.h"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_sx1276");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);
}
}
%}