]> cvs.zerfleddert.de Git - proxmark3-svn/blame_incremental - armsrc/iso14443a.h
fix WaitForResponse (without timeout)
[proxmark3-svn] / armsrc / iso14443a.h
... / ...
CommitLineData
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 A.
11//-----------------------------------------------------------------------------
12
13#ifndef __ISO14443A_H
14#define __ISO14443A_H
15
16#include <stddef.h>
17#include <stdint.h>
18#include <stdbool.h>
19#include "usb_cmd.h"
20#include "mifare.h"
21
22typedef struct {
23 uint8_t* response;
24 uint8_t* modulation;
25 uint16_t response_n;
26 uint16_t modulation_n;
27 uint32_t ProxToAirDuration;
28 uint8_t par; // enough for precalculated parity of 8 Byte responses
29} tag_response_info_t;
30
31extern void GetParity(const uint8_t *pbtCmd, uint16_t len, uint8_t *par);
32extern void AppendCrc14443a(uint8_t *data, int len);
33
34extern void RAMFUNC SnoopIso14443a(uint8_t param);
35extern void SimulateIso14443aTag(int tagType, int uid_1st, int uid_2nd, uint8_t *data);
36extern void ReaderIso14443a(UsbCommand *c);
37extern void ReaderTransmit(uint8_t *frame, uint16_t len, uint32_t *timing);
38extern void ReaderTransmitBitsPar(uint8_t *frame, uint16_t bits, uint8_t *par, uint32_t *timing);
39extern void ReaderTransmitPar(uint8_t *frame, uint16_t len, uint8_t *par, uint32_t *timing);
40extern int ReaderReceive(uint8_t *receivedAnswer, uint8_t *par);
41extern void ReaderMifare(bool first_try);
42
43extern int EmGetCmd(uint8_t *received, uint16_t *len, uint8_t *parity);
44extern int EmSendCmd(uint8_t *resp, uint16_t respLen);
45extern int EmSend4bit(uint8_t resp);
46extern int EmSendCmdPar(uint8_t *resp, uint16_t respLen, uint8_t *par);
47extern int EmSendPrecompiledCmd(tag_response_info_t *response_info);
48
49extern bool prepare_allocated_tag_modulation(tag_response_info_t *response_info, uint8_t **buffer, size_t *buffer_size);
50
51extern void iso14443a_setup(uint8_t fpga_minor_mode);
52extern int iso14_apdu(uint8_t *cmd, uint16_t cmd_len, bool send_chaining, void *data, uint8_t *res);
53extern int iso14443a_select_card(uint8_t *uid_ptr, iso14a_card_select_t *resp_data, uint32_t *cuid_ptr, bool anticollision, uint8_t num_cascades, bool no_rats);
54extern void iso14a_set_trigger(bool enable);
55extern void iso14a_set_timeout(uint32_t timeout);
56extern uint32_t iso14a_get_timeout(void);
57#endif /* __ISO14443A_H */
Impressum, Datenschutz