2015-08-05 19:43:31 +03:00
|
|
|
%module javaupm_mma7455
|
|
|
|
%include "../upm.i"
|
2015-08-17 18:25:09 +03:00
|
|
|
%include "typemaps.i"
|
|
|
|
%include "arrays_java.i";
|
|
|
|
|
|
|
|
%apply short *OUTPUT { short * ptrX, short * ptrY, short * ptrZ };
|
2015-08-05 19:43:31 +03:00
|
|
|
|
|
|
|
%{
|
|
|
|
#include "mma7455.h"
|
|
|
|
%}
|
|
|
|
|
2015-08-26 18:44:34 +03:00
|
|
|
%typemap(jni) short* "jshortArray"
|
|
|
|
%typemap(jstype) short* "short[]"
|
|
|
|
%typemap(jtype) short* "short[]"
|
|
|
|
|
|
|
|
%typemap(javaout) short* {
|
|
|
|
return $jnicall;
|
|
|
|
}
|
|
|
|
|
|
|
|
%typemap(out) short *readData {
|
|
|
|
$result = JCALL1(NewShortArray, jenv, 3);
|
|
|
|
JCALL4(SetShortArrayRegion, jenv, $result, 0, 3, (const signed short*)$1);
|
|
|
|
delete [] $1;
|
|
|
|
}
|
|
|
|
|
|
|
|
%ignore readData(short *, short *, short *);
|
|
|
|
|
2015-09-01 18:55:28 +03:00
|
|
|
%typemap(jni) (unsigned char *buf, unsigned char size) "jbyteArray";
|
|
|
|
%typemap(jtype) (unsigned char *buf, unsigned char size) "byte[]";
|
|
|
|
%typemap(jstype) (unsigned char *buf, unsigned char size) "byte[]";
|
|
|
|
|
|
|
|
%typemap(javain) (unsigned char *buf, unsigned char size) "$javainput";
|
|
|
|
|
|
|
|
%typemap(in) (unsigned char *buf, unsigned char size) {
|
|
|
|
$1 = (unsigned char *) JCALL2(GetByteArrayElements, jenv, $input, NULL);
|
|
|
|
$2 = JCALL1(GetArrayLength, jenv, $input);
|
|
|
|
}
|
|
|
|
|
|
|
|
%typemap(freearg) (unsigned char *buf, unsigned char size) {
|
|
|
|
JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
|
|
|
|
}
|
|
|
|
|
2015-08-05 19:43:31 +03:00
|
|
|
%include "mma7455.h"
|