8 Commits
Author SHA1 Message Date
towelbyte 2f6a767edf Fix/improve 'lf cotag demod'
Fix/improve 'lf cotag demod' auto threshold estimation
and demodulation of COTAG traces with high value spikes and
COTAG traces with very low amplitude values.
2026-07-09 01:04:35 +02:00
towelbyte 78b621264c Fix (limit) 'lf cotag demod' custom clock argument 2026-06-26 20:23:13 +02:00
towelbyte 2e9a92e967 Fix 'lf search' COTAG false positive
The bug was due to a bool/int ret-val mixup
and accidentally always returning PM3_SUCCESS.
2026-06-15 16:37:10 +02:00
towelbyte 2e35b95a7c Fix: Replace VLAs with heap alloc in lfdemod signal helpers
Using "data load" on very large trace files (e.g. dumps with 700k samples,
such as COTAG dumps) was causing crashes on some platforms due to stack overflow
since VLA temporary buffers were used.

Replace VLAs in computeSignalProperties() and removeSignalOffset() with
heap-allocated buffers instead.
2026-06-13 00:33:24 +02:00
towelbyte e3d2797411 CHANGELOG.md: Add COTAG improvement changelog entry 2026-06-12 22:53:08 +02:00
towelbyte 85c029b8fd pm3_tests.sh: Adapt COTAG tests for the new implementation
"lf cotag demod" now works directly on g_GraphBuffer:
Thus, adapt the existing test. Additionally, add 3 more cotag tests.
2026-06-12 22:49:07 +02:00
towelbyte 0ef1d35891 Added a few COTAG trace dumps. 2026-06-12 22:49:06 +02:00
towelbyte c1cefd6e38 Complete and working reimplementation of COTAG support
- "lf cotag reader": now behaves mostly the same as "lf read",
   except it is dedicated for COTAG.
	- It makes sure to send COTAG start sequence and to use
          real time sampling mode to get enough samples.

- "lf cotag demod": Working client-side COTAG demodulation implementation
   (high-low raw demod + Manchester demodulation from high/low demod).
	- Now uses samples directly from g_GraphBuffer
	- Supports 3 types of COTAG preamble (1 active, 2 passive), which
          can start anywhere in the samples.
	- Prints full 128-bits of COTAG tag data in 3 formats: raw,
          groupped by nibbles, and in hex, and identifies and
          prints out the card number.

Signed-off-by: andrej@towelbyte.net
2026-06-12 22:49:06 +02:00