-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathstructs.h
More file actions
59 lines (47 loc) · 867 Bytes
/
structs.h
File metadata and controls
59 lines (47 loc) · 867 Bytes
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 HAVE_STRUCTS_H
#define HAVE_STRUCTS_H
#include <stdint.h>
#include "ultralight.h"
enum {
CMD_PWD_AUTH = 0x1B,
CMD_READ = 0x30,
CMD_READ_CNT = 0x39,
CMD_FAST_READ = 0x3A,
CMD_READ_SIG = 0x3C,
CMD_GET_VERSION = 0x60,
CMD_COMP_WRITE = 0xA0,
CMD_WRITE = 0xA2,
};
#pragma pack(1)
typedef struct {
uint8_t command;
uint8_t address;
} read_request;
typedef struct {
uint8_t command;
uint8_t address;
ul_page data[UL_WRPAGS];
} write_request;
typedef struct {
uint8_t command;
} version_request;
typedef struct {
uint8_t command;
ul_page key;
} auth_request;
typedef struct {
uint8_t header;
uint8_t vendor;
uint8_t type;
uint8_t subtype;
uint8_t majorVersion;
uint8_t minorVersion;
uint8_t size;
uint8_t protocol;
} version_response;
typedef struct {
uint8_t command;
uint8_t address;
} signature_request;
#pragma pack()
#endif