mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
java: convert (uint8_t *buffer, int len) to byte[] for nunchuck
Signed-off-by: Petre Eftime <petre.p.eftime@intel.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
1f82757c64
commit
cfe63bf7b6
@ -1,11 +1,23 @@
|
|||||||
%module javaupm_nunchuck
|
%module javaupm_nunchuck
|
||||||
%include "../upm.i"
|
%include "../upm.i"
|
||||||
%include "arrays_java.i";
|
|
||||||
|
|
||||||
%apply unsigned char[] {uint8_t *};
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include "nunchuck.h"
|
#include "nunchuck.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
%typemap(jni) (uint8_t *buffer, int len) "jbyteArray";
|
||||||
|
%typemap(jtype) (uint8_t *buffer, int len) "byte[]";
|
||||||
|
%typemap(jstype) (uint8_t *buffer, int len) "byte[]";
|
||||||
|
|
||||||
|
%typemap(javain) (uint8_t *buffer, int len) "$javainput";
|
||||||
|
|
||||||
|
%typemap(in) (uint8_t *buffer, int len) {
|
||||||
|
$1 = (uint8_t *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
||||||
|
$2 = JCALL1(GetArrayLength, jenv, $input);
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(freearg) (uint8_t *buffer, int len) {
|
||||||
|
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
%include "nunchuck.h"
|
%include "nunchuck.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user