2016-03-01 20:10:17 +01:00
|
|
|
%module javaupm_apa102
|
|
|
|
|
|
|
|
%include "../upm.i"
|
|
|
|
%include "typemaps.i"
|
|
|
|
|
|
|
|
%typemap(jtype) (uint8_t *colors) "byte[]"
|
|
|
|
%typemap(jstype) (uint8_t *colors) "byte[]"
|
|
|
|
%typemap(jni) (uint8_t *colors) "jbyteArray"
|
|
|
|
%typemap(javain) (uint8_t *colors) "$javainput"
|
|
|
|
|
|
|
|
%typemap(in) (uint8_t *colors) {
|
|
|
|
$1 = (uint8_t*)JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
%{
|
2016-04-25 14:27:51 -07:00
|
|
|
#include "apa102.hpp"
|
2016-03-01 20:10:17 +01:00
|
|
|
%}
|
|
|
|
|
2016-04-25 14:27:51 -07:00
|
|
|
%include "apa102.hpp"
|
2016-03-01 20:10:17 +01:00
|
|
|
|
|
|
|
%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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
%}
|