-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.py
More file actions
32 lines (22 loc) · 1 KB
/
functions.py
File metadata and controls
32 lines (22 loc) · 1 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
import ctypes
import ctypes.util
from nfc_types import *
lib = ctypes.CDLL(ctypes.util.find_library('nfc'))
nfc_init = lib.nfc_init
nfc_version = lib.nfc_version
nfc_version.restype = ctypes.c_char_p
nfc_open = lib.nfc_open
nfc_open.argtypes = (ctypes.POINTER(Context), ctypes.c_char_p)
nfc_open.restype = ctypes.POINTER(Device)
nfc_initiator_init = lib.nfc_initiator_init
nfc_initiator_init.argtypes = (ctypes.POINTER(Device),)
nfc_initiator_init.restype = ctypes.c_int
nfc_device_get_name = lib.nfc_device_get_name
nfc_device_get_name.argtypes = (ctypes.POINTER(Device),)
nfc_device_get_name.restype = ctypes.c_char_p
nfc_initiator_poll_target = lib.nfc_initiator_poll_target
#nfc_initiator_poll_target.argtypes = (ctypes.POINTER(Device), ctypes.POINTER(Modulation), ctypes.c_size_t, ctypes.c_uint8, ctypes.c_uint8, ctypes.POINTER(Target))
nfc_initiator_poll_target.restype = ctypes.c_int
nfc_initiator_select_passive_target = lib.nfc_initiator_select_passive_target
nfc_close = lib.nfc_close
nfc_exit = lib.nfc_exit