summaryrefslogtreecommitdiff
path: root/peripheral/libupm/src/pn532/javaupm_pn532.i
blob: ad97bf3ea9d2a3ac14572f5ada563171128d05f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
%module javaupm_pn532
%include "../upm.i"
%include "typemaps.i"
%include "arrays_java.i"

%apply signed char[] {uint8_t *};
%apply unsigned char *INOUT {uint8_t *responseLength};
%apply unsigned char *OUTPUT {uint8_t *uidLength};

%ignore i2cContext;

%{
    #include "pn532.h"
%}

%include "pn532.h"

%pragma(java) jniclasscode=%{
    static {
        try {
            System.loadLibrary("javaupm_pn532");
        } catch (UnsatisfiedLinkError e) {
            System.err.println("Native code library failed to load. \n" + e);
            System.exit(1);
        }
    }
%}