Release v4.15864 - Radium
[RRG-proxmark3.git] / armsrc / iso14443b.h
blob2579e6f1c15983c96124fc5597eee612b4993ae4
1 //-----------------------------------------------------------------------------
2 // Copyright (C) Jonathan Westhues, Nov 2006
3 // Copyright (C) Gerhard de Koning Gans - May 2008
4 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // See LICENSE.txt for the text of the license.
17 //-----------------------------------------------------------------------------
18 // Routines to support ISO 14443 type B.
19 //-----------------------------------------------------------------------------
21 #ifndef __ISO14443B_H
22 #define __ISO14443B_H
24 #include "common.h"
26 #include "iso14b.h"
27 #include "pm3_cmd.h"
29 #ifndef AddCrc14A
30 # define AddCrc14A(data, len) compute_crc(CRC_14443_A, (data), (len), (data)+(len), (data)+(len)+1)
31 #endif
33 #ifndef AddCrc14B
34 # define AddCrc14B(data, len) compute_crc(CRC_14443_B, (data), (len), (data)+(len), (data)+(len)+1)
35 #endif
37 void iso14443b_setup(void);
38 int iso14443b_apdu(uint8_t const *msg, size_t msg_len, bool send_chaining, void *rxdata, uint16_t rxmaxlen, uint8_t *res);
40 int iso14443b_select_card(iso14b_card_select_t *card);
41 int iso14443b_select_card_srx(iso14b_card_select_t *card);
42 int iso14443b_select_xrx_card(iso14b_card_select_t *card);
44 void SimulateIso14443bTag(uint8_t *pupi);
45 void AcquireRawAdcSamplesIso14443b(uint32_t parameter);
46 void ReadSTBlock(uint8_t blocknr);
47 void SniffIso14443b(void);
48 void SendRawCommand14443B(uint32_t, uint32_t, uint8_t, uint8_t[]);
49 void SendRawCommand14443B_Ex(iso14b_raw_cmd_t *p);
51 // States for 14B SIM command
52 #define SIM_NOFIELD 0
53 #define SIM_IDLE 1
54 #define SIM_HALTED 2
55 #define SIM_SELECTING 3
56 #define SIM_HALTING 4
57 #define SIM_ACKNOWLEDGE 5
58 #define SIM_WORK 6
60 #endif /* __ISO14443B_H */