-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpafe.h
More file actions
59 lines (51 loc) · 1.42 KB
/
pafe.h
File metadata and controls
59 lines (51 loc) · 1.42 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef NODE_PAFE_H
#define NODE_PAFE_H
#include <nan.h>
#if defined(HAVE_LIBPAFE)
extern "C"{
#include <libpafe.h>
}
#elif defined(HAVE_FELICALIB)
extern "C"{
#include <felicalib.h>
}
#else
#error "unknown platform"
#endif
#define FELICA_DATA_LEN 16
// Based on https://nodejs.org/api/addons.html#addons_wrapping_c_objects but using NAN
class Pasori : public Nan::ObjectWrap {
public:
static NAN_MODULE_INIT(Init);
private:
explicit Pasori();
~Pasori();
static NAN_METHOD(PasoriNew);
static NAN_METHOD(PasoriClose);
static NAN_METHOD(PasoriVersion);
static NAN_METHOD(PasoriType);
static NAN_METHOD(PasoriSetTimeout);
static NAN_METHOD(PasoriPolling);
static Nan::Persistent<v8::Function> constructor;
static pasori* GetPasori(v8::Local<v8::Object> object);
static void SetPasori(v8::Local<v8::Object> thisPasori, pasori* _pasori);
};
class Felica : public Nan::ObjectWrap {
public:
static NAN_MODULE_INIT(Init);
static v8::Local<v8::Object> FelicaNewInstance(felica *_felica);
private:
explicit Felica(felica* _felica);
~Felica();
static NAN_METHOD(FelicaNew);
static NAN_METHOD(FelicaClose);
static NAN_METHOD(FelicaGetIDm);
static NAN_METHOD(FelicaGetPMm);
static NAN_METHOD(FelicaReadMulti);
static NAN_METHOD(FelicaReadSingle);
static NAN_METHOD(FelicaWriteMulti);
static NAN_METHOD(FelicaWriteSingle);
static Nan::Persistent<v8::Function> constructor;
felica* _felica;
};
#endif