mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 13:00:42 -07:00
adapt hitag2 write
This commit is contained in:
parent
8ee30b785e
commit
c8aee45aca
1 changed files with 18 additions and 5 deletions
|
@ -1747,7 +1747,8 @@ void WriterHitag(hitag_function htf, hitag_data *htd, int page) {
|
||||||
|
|
||||||
// init as reader
|
// init as reader
|
||||||
lf_init(true, false);
|
lf_init(true, false);
|
||||||
|
FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);
|
||||||
|
|
||||||
// Tag specific configuration settings (sof, timings, etc.)
|
// Tag specific configuration settings (sof, timings, etc.)
|
||||||
// TODO HTS
|
// TODO HTS
|
||||||
/* if (htf <= HTS_LAST_CMD) {
|
/* if (htf <= HTS_LAST_CMD) {
|
||||||
|
@ -1780,9 +1781,10 @@ void WriterHitag(hitag_function htf, hitag_data *htd, int page) {
|
||||||
size_t max_nrzs = (8 * HITAG_FRAME_LEN + 5) * 2; // up to 2 nrzs per bit
|
size_t max_nrzs = (8 * HITAG_FRAME_LEN + 5) * 2; // up to 2 nrzs per bit
|
||||||
uint8_t nrz_samples[max_nrzs];
|
uint8_t nrz_samples[max_nrzs];
|
||||||
size_t nrzs = 0;
|
size_t nrzs = 0;
|
||||||
|
|
||||||
int16_t checked = 0;
|
int16_t checked = 0;
|
||||||
uint32_t signal_size = 10000;
|
uint32_t signal_size = 10000;
|
||||||
|
bool turn_on = true;
|
||||||
|
|
||||||
while (bStop == false && BUTTON_PRESS() == false) {
|
while (bStop == false && BUTTON_PRESS() == false) {
|
||||||
|
|
||||||
// use malloc
|
// use malloc
|
||||||
|
@ -1818,9 +1820,20 @@ void WriterHitag(hitag_function htf, hitag_data *htd, int page) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for t_wait_2 carrier periods after the last tag bit before transmitting,
|
if (bStop) break;
|
||||||
lf_wait_periods(t_wait_2);
|
if (turn_on) {
|
||||||
command_start += t_wait_2;
|
// Wait 50ms with field off to be sure the transponder gets reset
|
||||||
|
SpinDelay(50);
|
||||||
|
FpgaWriteConfWord(FPGA_MAJOR_MODE_LF_ADC | FPGA_LF_ADC_READER_FIELD);
|
||||||
|
turn_on = false;
|
||||||
|
// Wait with field on to be in "Wait for START_AUTH" timeframe
|
||||||
|
lf_wait_periods(HITAG_T_WAIT_POWERUP + HITAG_T_WAIT_START_AUTH_MAX / 4);
|
||||||
|
command_start += HITAG_T_WAIT_POWERUP + HITAG_T_WAIT_START_AUTH_MAX / 4;
|
||||||
|
} else {
|
||||||
|
// Wait for t_wait_2 carrier periods after the last tag bit before transmitting,
|
||||||
|
lf_wait_periods(t_wait_2);
|
||||||
|
command_start += t_wait_2;
|
||||||
|
}
|
||||||
|
|
||||||
// Transmit the reader frame
|
// Transmit the reader frame
|
||||||
command_duration = hitag_reader_send_frame(tx, txlen);
|
command_duration = hitag_reader_send_frame(tx, txlen);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue