text
[RRG-proxmark3.git] / armsrc / iso14443b.h
blob4ad840bfeda990567ce634d9ac2e5164ebf29e94
1 //-----------------------------------------------------------------------------
2 // Merlok - June 2011
3 // Gerhard de Koning Gans - May 2008
4 // Hagen Fritsch - June 2010
5 //
6 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
7 // at your option, any later version. See the LICENSE.txt file for the text of
8 // the license.
9 //-----------------------------------------------------------------------------
10 // Routines to support ISO 14443 type B.
11 //-----------------------------------------------------------------------------
13 #ifndef __ISO14443B_H
14 #define __ISO14443B_H
16 #include "common.h"
18 #include "iso14b.h"
19 #include "pm3_cmd.h"
21 #ifndef AddCrc14A
22 # define AddCrc14A(data, len) compute_crc(CRC_14443_A, (data), (len), (data)+(len), (data)+(len)+1)
23 #endif
25 #ifndef AddCrc14B
26 # define AddCrc14B(data, len) compute_crc(CRC_14443_B, (data), (len), (data)+(len), (data)+(len)+1)
27 #endif
29 void iso14443b_setup(void);
30 int iso14443b_apdu(uint8_t const *msg, size_t msg_len, bool send_chaining, void *rxdata, uint16_t rxmaxlen, uint8_t *res);
32 int iso14443b_select_card(iso14b_card_select_t *card);
33 int iso14443b_select_card_srx(iso14b_card_select_t *card);
35 void SimulateIso14443bTag(uint8_t *pupi);
36 void AcquireRawAdcSamplesIso14443b(uint32_t parameter);
37 void ReadSTBlock(uint8_t blocknr);
38 void SniffIso14443b(void);
39 void SendRawCommand14443B(uint32_t, uint32_t, uint8_t, uint8_t[]);
40 void SendRawCommand14443B_Ex(iso14b_raw_cmd_t *p);
42 // States for 14B SIM command
43 #define SIM_NOFIELD 0
44 #define SIM_IDLE 1
45 #define SIM_HALTED 2
46 #define SIM_SELECTING 3
47 #define SIM_HALTING 4
48 #define SIM_ACKNOWLEDGE 5
49 #define SIM_WORK 6
51 #endif /* __ISO14443B_H */