1 %module javaupm_gas 2 %include "../upm.i" 3 %include "typemaps.i" 4 5 %{ 6 #include "gas.h" 7 #include "mq2.h" 8 #include "mq3.h" 9 #include "mq4.h" 10 #include "mq5.h" 11 #include "mq6.h" 12 #include "mq7.h" 13 #include "mq8.h" 14 #include "mq9.h" 15 #include "tp401.h" 16 %} 17 18 %typemap(jni) (uint16_t *buffer, int len) "jshortArray"; 19 %typemap(jtype) (uint16_t *buffer, int len) "short[]"; 20 %typemap(jstype) (uint16_t *buffer, int len) "short[]"; 21 22 %typemap(javain) (uint16_t *buffer, int len) "$javainput"; 23 24 %typemap(in) (uint16_t *buffer, int len) { 25 $1 = (uint16_t *) JCALL2(GetShortArrayElements, jenv, $input, NULL); 26 $2 = JCALL1(GetArrayLength, jenv, $input); 27 } 28 29 %typemap(freearg) (uint16_t *buffer, int len) { 30 JCALL3(ReleaseShortArrayElements, jenv, $input, (jshort *)$1, 0); 31 } 32 33 %typemap(jni) (int numberOfSamples, uint16_t *buffer) "jshortArray"; 34 %typemap(jtype) (int numberOfSamples, uint16_t *buffer) "short[]"; 35 %typemap(jstype) (int numberOfSamples, uint16_t *buffer) "short[]"; 36 37 %typemap(javain) (int numberOfSamples, uint16_t *buffer) "$javainput"; 38 39 %typemap(in) (int numberOfSamples, uint16_t *buffer) { 40 $2 = (uint16_t *) JCALL2(GetShortArrayElements, jenv, $input, NULL); 41 $1 = JCALL1(GetArrayLength, jenv, $input); 42 } 43 44 %typemap(freearg) (int numberOfSamples, uint16_t *buffer) { 45 JCALL3(ReleaseShortArrayElements, jenv, $input, (jshort *)$2, 0); 46 } 47 48 %include "gas.h" 49 %include "mq2.h" 50 %include "mq3.h" 51 %include "mq4.h" 52 %include "mq5.h" 53 %include "mq6.h" 54 %include "mq7.h" 55 %include "mq8.h" 56 %include "mq9.h" 57 %include "tp401.h" 58