1
0
Fork 0

RFID: Change the checkTag fail return

Previously, checkTag() returned 0 when it failed or when there was no changes.
This is fine if we are only expecting already programmed tags, but as tags
arrive new with blocks zeroed out, which conflicts with the 0 return value.

Introduce a new constant to RFID for the return error, -1, and use it
instead of 0 everywhere.
Update comments and README to highlight this new reserved ID.
This commit is contained in:
Teo-CD 2024-03-07 23:05:14 +00:00
parent 2fd1939746
commit 3ee09f284a
4 changed files with 11 additions and 7 deletions

View file

@ -203,7 +203,8 @@ Il contient l'ID de la figurine sur les bits 0-5 de l'octet, si la figurine
est un personnage (1) ou une année (0) sur le bit 6 et si la figurine a été posée
(0) ou retirée (1) sur le bit 7.
Ainsi, si on interprète l'octet comme un nombre signé, si le nombre est négatif
on sait que la figurine a été retirée.
on sait que la figurine a été retirée.
**_Dû à un détail d'implémentation, l'identifiant 127 est invalide et réservé._**
#### Schéma
```