• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 %module javaupm_h3lis331dl
2 %include "../upm.i"
3 %include "cpointer.i"
4 %include "typemaps.i"
5 
6 %apply int *OUTPUT { int *x, int *y, int*z };
7 %apply float *OUTPUT { float *aX, float *aY, float *aZ  };
8 
9 %ignore i2cContext;
10 
11 %{
12     #include "h3lis331dl.h"
13 %}
14 
15 %typemap(jni) float* "jfloatArray"
16 %typemap(jstype) float* "float[]"
17 %typemap(jtype) float* "float[]"
18 
19 %typemap(javaout) float* {
20     return $jnicall;
21 }
22 
23 %typemap(out) float *getAcceleration {
24     $result = JCALL1(NewFloatArray, jenv, 3);
25     JCALL4(SetFloatArrayRegion, jenv, $result, 0, 3, $1);
26     delete [] $1;
27 }
28 
29 %typemap(jni) int* "jintArray"
30 %typemap(jstype) int* "int[]"
31 %typemap(jtype) int* "int[]"
32 
33 %typemap(javaout) int* {
34     return $jnicall;
35 }
36 
37 %typemap(out) int *getRawXYZ {
38     $result = JCALL1(NewIntArray, jenv, 3);
39     JCALL4(SetIntArrayRegion, jenv, $result, 0, 3, (const int*)$1);
40 }
41 
42 %typemap(out) int *getXYZ {
43     $result = JCALL1(NewIntArray, jenv, 3);
44     JCALL4(SetIntArrayRegion, jenv, $result, 0, 3, (const int*)$1);
45 }
46 
47 %ignore getRawXYZ(int *, int *, int *);
48 %ignore getXYZ(int *, int *, int *);
49 %ignore getAcceleration(float *, float *, float *);
50 
51 %include "h3lis331dl.h"
52