Home | History | Annotate | Download | only in m24lr64e
      1 %module javaupm_m24lr64e
      2 %include "../upm.i"
      3 %include "stdint.i"
      4 %include "arrays_java.i";
      5 %include "../java_buffer.i"
      6 
      7 %typemap(jni) uint8_t * "jbyteArray"
      8 %typemap(jtype) uint8_t * "byte[]"
      9 %typemap(jstype) uint8_t * "byte[]"
     10 
     11 %typemap(javaout) uint8_t * {
     12     return $jnicall;
     13 }
     14 
     15 %typemap(out) uint8_t *{
     16     int length = upm::M24LR64E::UID_LENGTH;
     17     $result = JCALL1(NewByteArray, jenv, length);
     18     JCALL4(SetByteArrayRegion, jenv, $result, 0, length, reinterpret_cast<signed char *>($1));
     19     delete [] $1;
     20 }
     21 
     22 %{
     23     #include "m24lr64e.h"
     24 %}
     25 
     26 %include "m24lr64e.h"
     27