From e24578c2ea4f36649a9df95fd086feac45b9bd2e Mon Sep 17 00:00:00 2001 From: douniwan5788 Date: Sat, 15 Mar 2025 03:43:48 +0800 Subject: [PATCH] Rename Hitag2 functions --- armsrc/hitag2.c | 18 +++++++++--------- client/src/cmdlfhitag.c | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/armsrc/hitag2.c b/armsrc/hitag2.c index a8f04e8a2..39e4647e0 100644 --- a/armsrc/hitag2.c +++ b/armsrc/hitag2.c @@ -320,7 +320,7 @@ static void hitag2_handle_reader_command(uint8_t *rx, const size_t rxlen, uint8_ // reader/writer // returns how long it took -static uint32_t hitag_reader_send_bit(int bit) { +static uint32_t hitag2_reader_send_bit(int bit) { // Binary pulse length modulation (BPLM) is used to encode the data stream // This means that a transmission of a one takes longer than that of a zero @@ -349,13 +349,13 @@ static uint32_t hitag_reader_send_bit(int bit) { // reader / writer commands // frame_len is in number of bits? -static uint32_t hitag_reader_send_frame(const uint8_t *frame, size_t frame_len) { +static uint32_t hitag2_reader_send_frame(const uint8_t *frame, size_t frame_len) { WDT_HIT(); uint32_t wait = 0; // Send the content of the frame for (size_t i = 0; i < frame_len; i++) { - wait += hitag_reader_send_bit((frame[i / 8] >> (7 - (i % 8))) & 1); + wait += hitag2_reader_send_bit((frame[i / 8] >> (7 - (i % 8))) & 1); } // Send EOF @@ -378,14 +378,14 @@ static uint32_t hitag_reader_send_frame(const uint8_t *frame, size_t frame_len) // reader / writer commands // frame_len is in number of bits? -static uint32_t hitag_reader_send_framebits(const uint8_t *frame, size_t frame_len) { +static uint32_t hitag2_reader_send_framebits(const uint8_t *frame, size_t frame_len) { WDT_HIT(); uint32_t wait = 0; // Send the content of the frame for (size_t i = 0; i < frame_len; i++) { - wait += hitag_reader_send_bit(frame[i]); + wait += hitag2_reader_send_bit(frame[i]); } // Send EOF @@ -1863,7 +1863,7 @@ void ReaderHitag(const lf_hitag_data_t *payload, bool ledcontrol) { } // Transmit the reader frame - command_duration = hitag_reader_send_frame(tx, txlen); + command_duration = hitag2_reader_send_frame(tx, txlen); response_start = command_start + command_duration; // Let the antenna and ADC values settle @@ -2214,7 +2214,7 @@ void WriterHitag(const lf_hitag_data_t *payload, bool ledcontrol) { } // Transmit the reader frame - command_duration = hitag_reader_send_frame(tx, txlen); + command_duration = hitag2_reader_send_frame(tx, txlen); // global write state variable used // tearoff occurred @@ -2434,9 +2434,9 @@ static void ht2_send(bool turn_on, uint32_t *cmd_start // Transmit the reader frame if (send_bits) { - *cmd_duration = hitag_reader_send_framebits(tx, txlen); + *cmd_duration = hitag2_reader_send_framebits(tx, txlen); } else { - *cmd_duration = hitag_reader_send_frame(tx, txlen); + *cmd_duration = hitag2_reader_send_frame(tx, txlen); } *resp_start = (*cmd_start + *cmd_duration); diff --git a/client/src/cmdlfhitag.c b/client/src/cmdlfhitag.c index 6230cbf35..ec9e7361a 100644 --- a/client/src/cmdlfhitag.c +++ b/client/src/cmdlfhitag.c @@ -832,7 +832,7 @@ static bool ht2_get_uid(uint32_t *uid) { } if (resp.status != PM3_SUCCESS) { - PrintAndLogEx(DEBUG, "DEBUG: Error - failed getting UID"); + PrintAndLogEx(DEBUG, "DEBUG: Error - failed getting Hitag 2 UID"); return false; }