mirror of
https://github.com/eclipse/upm.git
synced 2025-03-24 01:10:22 +03:00
java: fix Java types for MPR121
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
07f6ffb0a4
commit
a5a66e9e17
@ -2,10 +2,23 @@
|
|||||||
%include "../upm.i"
|
%include "../upm.i"
|
||||||
%include "arrays_java.i";
|
%include "arrays_java.i";
|
||||||
|
|
||||||
%apply signed char[] {uint8_t *};
|
|
||||||
|
|
||||||
%{
|
%{
|
||||||
#include "mpr121.h"
|
#include "mpr121.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
%typemap(jni) (uint8_t *buffer, unsigned int len) "jbyteArray";
|
||||||
|
%typemap(jtype) (uint8_t *buffer, unsigned int len) "byte[]";
|
||||||
|
%typemap(jstype) (uint8_t *buffer, unsigned int len) "byte[]";
|
||||||
|
|
||||||
|
%typemap(javain) (uint8_t *buffer, unsigned int len) "$javainput";
|
||||||
|
|
||||||
|
%typemap(in) (uint8_t *buffer, unsigned int len) {
|
||||||
|
$1 = (uint8_t *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
||||||
|
$2 = JCALL1(GetArrayLength, jenv, $input);
|
||||||
|
}
|
||||||
|
|
||||||
|
%typemap(freearg) (uint8_t *buffer, unsigned int len) {
|
||||||
|
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
|
||||||
|
}
|
||||||
|
|
||||||
%include "mpr121.h"
|
%include "mpr121.h"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user