proxmark3/armsrc/iso14443b.h

61 lines
1.7 KiB
C
Raw Normal View History

2015-07-14 05:06:49 +08:00
//-----------------------------------------------------------------------------
// Merlok - June 2011
// Gerhard de Koning Gans - May 2008
// Hagen Fritsch - June 2010
//
// This code is licensed to you under the terms of the GNU GPL, version 2 or,
// at your option, any later version. See the LICENSE.txt file for the text of
// the license.
//-----------------------------------------------------------------------------
// Routines to support ISO 14443 type B.
2015-07-14 05:06:49 +08:00
//-----------------------------------------------------------------------------
#ifndef __ISO14443B_H
#define __ISO14443B_H
#ifdef __cplusplus
extern "C" {
#endif
#include "proxmark3.h"
2019-03-10 03:34:41 +08:00
#include "common.h" // access to global variable: MF_DBGLEVEL
#include "apps.h"
#include "util.h"
#include "string.h"
#include "crc16.h"
#include "mifare.h"
#include "protocols.h"
2015-07-14 05:06:49 +08:00
#ifndef AddCrc14A
2019-03-10 03:34:41 +08:00
# define AddCrc14A(data, len) compute_crc(CRC_14443_A, (data), (len), (data)+(len), (data)+(len)+1)
#endif
#ifndef AddCrc14B
2019-03-10 03:34:41 +08:00
# define AddCrc14B(data, len) compute_crc(CRC_14443_B, (data), (len), (data)+(len), (data)+(len)+1)
#endif
2019-04-18 18:43:35 +08:00
void SendRawCommand14443B_Ex(PacketCommandNG *c);
2019-04-06 07:00:54 +08:00
void iso14443b_setup();
uint8_t iso14443b_apdu(uint8_t const *message, size_t message_length, uint8_t *response);
uint8_t iso14443b_select_card(iso14b_card_select_t *card);
uint8_t iso14443b_select_card_srx(iso14b_card_select_t *card);
// testfunctions
2019-04-06 07:00:54 +08:00
void WaitForFpgaDelayQueueIsEmpty(uint16_t delay);
void ClearFpgaShiftingRegisters(void);
// States for 14B SIM command
2019-03-10 03:34:41 +08:00
#define SIM_NOFIELD 0
#define SIM_IDLE 1
#define SIM_HALTED 2
#define SIM_SELECTING 3
#define SIM_HALTING 4
#define SIM_ACKNOWLEDGE 5
2019-03-10 03:34:41 +08:00
#define SIM_WORK 6
2015-07-14 05:06:49 +08:00
2017-01-21 18:34:33 +08:00
#ifdef __cplusplus
}
#endif
2015-07-14 05:06:49 +08:00
#endif /* __ISO14443B_H */