diff --git a/CHANGELOG.md b/CHANGELOG.md index ba79312c4..b655b3876 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Fixed `trace list -t topaz` - now parses topaz reader frames up to 16 bytes (@iceman1001) - Fixed `hw bwm` - doc and comment references still named the flat `hw bwmsetcap`/`bwmcharge`/`bwmautooff` commands from before the subgroup move (@xilni) - Added TA1=96 support via pwm to sim module `sim024.bin` - v4.66 (@antiklesys) - Added `hf mfu ndefformat` - NDEF format Ultralight/NTAG tags, restores the NXP factory Capability Container for the detected type (@0x6r1an0y) diff --git a/client/src/cmdtrace.c b/client/src/cmdtrace.c index 872c81606..e835cc478 100644 --- a/client/src/cmdtrace.c +++ b/client/src/cmdtrace.c @@ -56,11 +56,13 @@ static bool next_record_is_response(uint16_t tracepos, uint8_t *trace) { return (hdr->isResponse); } +// Topaz reader commands are at most 16 bytes long (RSEG/READ8/WRITE-*8: +// cmd + adds + 8 data bytes + 4 UID bytes + 2 CRC bytes) +#define MAX_TOPAZ_READER_CMD_LEN 16 + static bool merge_topaz_reader_frames(uint32_t timestamp, uint32_t *duration, uint16_t *tracepos, uint16_t traceLen, uint8_t *trace, const uint8_t *frame, uint8_t *topaz_reader_command, uint16_t *data_len) { -#define MAX_TOPAZ_READER_CMD_LEN 16 - uint32_t last_timestamp = timestamp + *duration; if ((*data_len != 1) || (frame[0] == TOPAZ_WUPA) || (frame[0] == TOPAZ_REQA)) return false; @@ -515,7 +517,7 @@ static uint16_t printTraceLine(uint16_t tracepos, uint16_t traceLen, uint8_t *tr } uint32_t end_of_transmission_timestamp = 0; - uint8_t topaz_reader_command[9]; + uint8_t topaz_reader_command[MAX_TOPAZ_READER_CMD_LEN]; char explanation[60] = {0}; tracelog_hdr_t *first_hdr = (tracelog_hdr_t *)(trace); tracelog_hdr_t *hdr = (tracelog_hdr_t *)(trace + tracepos);