summaryrefslogtreecommitdiff
path: root/nfcommander.h
blob: 79901987e5da115f685d6d3a61f7fd6ce7c7f010 (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
28
29
30
31
32
33
34
35
36
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>

#ifndef NFCOMMANDER_VERSION
        #define NFCOMMANDER_VERSION "v0.1-dev"
#endif

typedef enum {
	tag_unset,
	tag_mifare1,
	tag_ntag,
	tag_desfire,
	tag_ultralight,
	tag_ultralightc
} nfc_tag_t;

typedef struct {
	//core identifying properties
	nfc_tag_t type;
	uint8_t uid_length;
	uint8_t uid[10];
} nfc_tag_info_t;

typedef int (*reader_plugin_init)(void);
typedef int (*reader_plugin_handle)(int fd);

typedef enum {
	system_control,
	system_reader,
	system_command
} notification_target_t;

int core_manage_fd(int fd, int manage, notification_target_t system);
int core_tag_present(nfc_tag_info_t tag);
int core_tag_removed(nfc_tag_info_t tag);