Skip to content

Duplicate client ID detection and CRC-protected ID assignment

Latest

Choose a tag to compare

@juano2310 juano2310 released this 26 Jul 21:12
a17cf7b

Fixed

  • CRC8 on ID assignment responses: when two clients register back-to-back, their multi-frame ID_RESPONSE frames can interleave, and a splice can pass the serial-match check while carrying the other client's assigned ID — putting two physical devices on one ID (both then act on that ID's commands). The broker now appends a CRC8 over [assignedId][flag][serialLen][serial] and clients verify it, so a spliced response is rejected and the client retries. Backward compatible in both directions.
  • Duplicate-ID detection: new onDuplicateId(callback) on the broker. Each registered ID is pinged exactly once per cycle, so a second pong within one cycle proves two devices share that ID; the callback fires once per cycle so the application can stop the ID and force re-registration.

Important: the CRC verification runs on the client side — every client device (tentacle) must be reflashed with this version to be protected from adopting a wrong ID.

See #6 for details.