]>
Commit | Line | Data |
---|---|---|
4e12287d RS |
1 | //----------------------------------------------------------------------------- |
2 | // This code is licensed to you under the terms of the GNU GPL, version 2 or, | |
3 | // at your option, any later version. See the LICENSE.txt file for the text of | |
4 | // the license. | |
5 | //----------------------------------------------------------------------------- | |
6 | // HitagS emulation (preliminary test version) | |
7 | // | |
8 | // (c) 2016 Oguzhan Cicek, Hendrik Schwartke, Ralf Spenneberg | |
9 | // <info@os-s.de> | |
10 | //----------------------------------------------------------------------------- | |
11 | ||
12 | ||
4e12287d RS |
13 | #ifndef _HITAGS_H_ |
14 | #define _HITAGS_H_ | |
15 | ||
b8e461ff | 16 | #include "hitag2.h" |
17 | ||
4e12287d RS |
18 | typedef enum PROTO_STATE {READY=0,INIT,AUTHENTICATE,SELECTED,QUIET,TTF,FAIL} PSTATE; //protocol-state |
19 | typedef enum TAG_STATE {NO_OP=0,READING_PAGE,WRITING_PAGE_ACK,WRITING_PAGE_DATA,WRITING_BLOCK_DATA} TSATE; //tag-state | |
20 | typedef enum SOF_TYPE {STANDARD=0,ADVANCED,FAST_ADVANCED,ONE,NO_BITS} stype; //number of start-of-frame bits | |
21 | ||
22 | struct hitagS_tag { | |
23 | PSTATE pstate; //protocol-state | |
24 | TSATE tstate; //tag-state | |
25 | uint32_t uid; | |
26 | uint32_t pages[16][4]; | |
27 | uint64_t key; | |
28 | byte_t pwdl0,pwdl1,pwdh0; | |
29 | //con0 | |
30 | int max_page; | |
31 | stype mode; | |
32 | //con1 | |
33 | bool auth; //0=Plain 1=Auth | |
34 | bool TTFC; //Transponder Talks first coding. 0=Manchester 1=Biphase | |
35 | int TTFDR; //data rate in TTF Mode | |
36 | int TTFM; //the number of pages that are sent to the RWD | |
37 | bool LCON; //0=con1/2 read write 1=con1 read only and con2 OTP | |
38 | bool LKP; //0=page2/3 read write 1=page2/3 read only in Plain mode and no access in authenticate mode | |
39 | //con2 | |
40 | //0=read write 1=read only | |
41 | bool LCK7; //page4/5 | |
42 | bool LCK6; //page6/7 | |
43 | bool LCK5; //page8-11 | |
44 | bool LCK4; //page12-15 | |
45 | bool LCK3; //page16-23 | |
46 | bool LCK2; //page24-31 | |
47 | bool LCK1; //page32-47 | |
48 | bool LCK0; //page48-63 | |
49 | } ; | |
50 | ||
51 | #endif |