feat(iso15): hf.iso15.raw() — send an arbitrary ISO15693 request frame
The 15693 catalog builds request frames (flags | command | [mfg] | [UID] | params) but there was no transport to send them — rawcli's hf15 raw path fetched a nonexistent hf.iso15.raw and got None, so nothing executed. Add it: raw() takes the frame without a CRC (appended host-side via _iso15_payload), sends CMD_HF_ISO15693_COMMAND, and returns the firmware-relayed tag response. long_wait selects the write-length tag-ack timeout for WRITE/LOCK-class commands. This is the foundation for the ICODE SLIX/SLIX2/NTAG5 catalogs. Hardware-verified against an ICODE SLIX: GET_SYSTEM_INFO (32 blocks, IC ref 0x96, no READ_SIGNATURE → SLIX-family), READ_BLOCK, GET_RANDOM_NUMBER, and the NXP custom 02 B2 04 form all round-trip. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -204,6 +204,21 @@ class HF15Commands:
|
||||
success = resp.status == 0 and len(resp.data) > 0 and resp.data[0] == 0
|
||||
return {"success": success, "block": block}
|
||||
|
||||
async def raw(self, iso_cmd: bytes | str, long_wait: bool = False,
|
||||
timeout: float = 5.0) -> dict:
|
||||
"""Send a raw ISO15693 request frame and return the tag's response.
|
||||
|
||||
``iso_cmd`` is the request **without** the CRC (flags | command | [mfg] | [UID] | params);
|
||||
the ISO15693 CRC is appended host-side. ``long_wait`` uses the write-length tag-ack timeout
|
||||
(needed for WRITE/LOCK-class commands). The returned ``raw`` is the firmware-relayed tag
|
||||
response (response-flags + data + its CRC)."""
|
||||
if isinstance(iso_cmd, str):
|
||||
iso_cmd = bytes.fromhex(iso_cmd.replace(" ", ""))
|
||||
payload = _iso15_payload(iso_cmd, flags=_WRITE_FLAGS if long_wait else _READ_FLAGS)
|
||||
resp = await self._t.send_ng(Cmd.HF_ISO15693_COMMAND, payload, timeout=timeout)
|
||||
data = bytes(resp.data)
|
||||
return {"status": resp.status, "raw": data, "data": data.hex()}
|
||||
|
||||
async def sniff(self, timeout: float = 60.0) -> dict:
|
||||
"""Start ISO15693 sniff. Blocks until button press or timeout.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user