From 687c92a7f7eacbdc9b4abea1f3da1c92993cc518 Mon Sep 17 00:00:00 2001 From: michael Date: Sat, 4 Jul 2026 22:13:50 -0700 Subject: [PATCH] fix(iso15): request 1-slot inventory in scan() so UID parses correctly scan() sent flags=0x06 (16-slot inventory). Since 16-slot became the firmware default, the device replies with an iso15_slot_result_t struct, which this parser misread as a zeroed UID (response_flags 16, uid 0000...). Set SLOT1 (0x26) to get the simple single-tag [flags][dsfid][uid] response. Use hf 15 reader --all for multi-tag anti-collision. Co-Authored-By: Claude Opus 4.8 (1M context) --- pm3py/core/hf_iso15.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pm3py/core/hf_iso15.py b/pm3py/core/hf_iso15.py index 1e5084a..40e3c2d 100644 --- a/pm3py/core/hf_iso15.py +++ b/pm3py/core/hf_iso15.py @@ -27,8 +27,12 @@ class HF15Commands: async def scan(self) -> dict: """Scan for ISO15693 tags using inventory command.""" - # ISO15693 inventory: flags=0x06 (high data rate + inventory), cmd=0x01 - iso_cmd = bytes([0x06, 0x01, 0x00]) # flags, inventory cmd, mask_len=0 + # ISO15693 inventory: flags=0x26 (high data rate + inventory + 1-slot), cmd=0x01. + # SLOT1 (0x20) is required: without it the firmware runs a 16-slot anti-collision + # round and replies with an iso15_slot_result_t struct, not [flags][dsfid][uid], + # so this parser would read the struct header as a zeroed UID. 1-slot gives the + # simple single-tag response this method expects. Use hf 15 reader --all for many. + iso_cmd = bytes([0x26, 0x01, 0x00]) # flags, inventory cmd, mask_len=0 flags = ISO15_CONNECT | ISO15_READ_RESPONSE | ISO15_APPEND_CRC payload = struct.pack("