2019-08-08 22:57:33 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
2022-01-06 09:19:46 +08:00
|
|
|
// Copyright (C) Jonathan Westhues, Nov 2006
|
|
|
|
// Copyright (C) Greg Jones, Jan 2009
|
|
|
|
// Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
|
2019-08-08 22:57:33 +08:00
|
|
|
//
|
2022-01-06 09:19:46 +08:00
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// See LICENSE.txt for the text of the license.
|
2019-08-08 22:57:33 +08:00
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Definitions internal to the app source.
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
#ifndef __ISO15693_H
|
|
|
|
#define __ISO15693_H
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
#include "pm3_cmd.h" // struct
|
2021-05-05 15:55:58 +08:00
|
|
|
#include "iso15.h"
|
2020-08-13 18:25:04 +08:00
|
|
|
|
2020-07-02 18:37:07 +08:00
|
|
|
|
|
|
|
// Delays in SSP_CLK ticks.
|
|
|
|
// SSP_CLK runs at 13,56MHz / 32 = 423.75kHz when simulating a tag
|
|
|
|
#define DELAY_ISO15693_VCD_TO_VICC_SIM 132 // 132/423.75kHz = 311.5us from end of command EOF to start of tag response
|
|
|
|
|
|
|
|
//SSP_CLK runs at 13.56MHz / 4 = 3,39MHz when acting as reader. All values should be multiples of 16
|
|
|
|
#define DELAY_ISO15693_VCD_TO_VICC_READER 1056 // 1056/3,39MHz = 311.5us from end of command EOF to start of tag response
|
|
|
|
#define DELAY_ISO15693_VICC_TO_VCD_READER 1024 // 1024/3.39MHz = 302.1us between end of tag response and next reader command
|
|
|
|
|
2020-07-04 03:33:17 +08:00
|
|
|
void Iso15693InitReader(void);
|
|
|
|
void Iso15693InitTag(void);
|
2022-01-06 22:40:11 +08:00
|
|
|
void CodeIso15693AsReader(const uint8_t *cmd, int n);
|
|
|
|
void CodeIso15693AsTag(const uint8_t *cmd, size_t len);
|
2020-08-13 18:25:04 +08:00
|
|
|
|
2020-07-04 03:33:17 +08:00
|
|
|
void TransmitTo15693Reader(const uint8_t *cmd, size_t len, uint32_t *start_time, uint32_t slot_time, bool slow);
|
|
|
|
int GetIso15693CommandFromReader(uint8_t *received, size_t max_len, uint32_t *eof_time);
|
|
|
|
void TransmitTo15693Tag(const uint8_t *cmd, int len, uint32_t *start_time);
|
2022-03-24 00:37:40 +08:00
|
|
|
int GetIso15693AnswerFromTag(uint8_t *response, uint16_t max_len, uint16_t timeout, uint32_t *eof_time, bool fsk, bool recv_speed, uint16_t *resp_len);
|
2019-08-08 22:57:33 +08:00
|
|
|
|
2020-07-08 15:45:49 +08:00
|
|
|
//void RecordRawAdcSamplesIso15693(void);
|
2019-08-08 22:57:33 +08:00
|
|
|
void AcquireRawAdcSamplesIso15693(void);
|
2022-03-24 01:22:03 +08:00
|
|
|
void ReaderIso15693(iso15_card_select_t *p_card); // ISO15693 reader
|
2022-03-24 00:37:40 +08:00
|
|
|
void SimTagIso15693(uint8_t *uid); // simulate an ISO15693 tag
|
2022-03-24 01:22:03 +08:00
|
|
|
void BruteforceIso15693Afi(uint32_t speed); // find an AFI of a tag
|
|
|
|
void DirectTag15693Command(uint32_t datalen, uint32_t speed, uint32_t recv, uint8_t *data); // send arbitrary commands from CLI
|
2019-08-08 22:57:33 +08:00
|
|
|
|
2022-03-16 18:26:07 +08:00
|
|
|
void SniffIso15693(uint8_t jam_search_len, uint8_t *jam_search_string, bool iclass);
|
2020-07-02 18:37:07 +08:00
|
|
|
|
2020-08-13 18:25:04 +08:00
|
|
|
int SendDataTag(uint8_t *send, int sendlen, bool init, bool speed_fast, uint8_t *recv,
|
2022-03-24 00:37:40 +08:00
|
|
|
uint16_t max_recv_len, uint32_t start_time, uint16_t timeout, uint32_t *eof_time, uint16_t *resp_len);
|
2020-08-13 18:25:04 +08:00
|
|
|
|
2022-03-24 00:37:40 +08:00
|
|
|
int SendDataTagEOF(uint8_t *recv, uint16_t max_recv_len, uint32_t start_time, uint16_t timeout, uint32_t *eof_time, bool fsk, bool recv_speed, uint16_t *resp_len);
|
2020-07-02 18:37:07 +08:00
|
|
|
|
2022-01-06 22:40:11 +08:00
|
|
|
void SetTag15693Uid(const uint8_t *uid);
|
2021-05-04 15:40:30 +08:00
|
|
|
|
|
|
|
void DisablePrivacySlixLIso15693(uint8_t *password);
|
2022-02-19 01:23:53 +08:00
|
|
|
void DisableEAS_AFISlixLIso15693(uint8_t *password);
|
2019-08-08 22:57:33 +08:00
|
|
|
#endif
|