annotation 15 only when we got bytes

This commit is contained in:
iceman1001 2020-08-15 11:02:06 +02:00
parent 762381237d
commit 2c29f95077

View file

@ -385,141 +385,143 @@ void annotateIclass(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
void annotateIso15693(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
switch (cmd[1]) {
case ISO15693_INVENTORY:
snprintf(exp, size, "INVENTORY");
return;
case ISO15693_STAYQUIET:
snprintf(exp, size, "STAY_QUIET");
return;
case ISO15693_READBLOCK: {
uint8_t block = 0;
if (cmdsize == 13)
block = cmd[10];
snprintf(exp, size, "READBLOCK(%d)", block);
return;
if (cmdsize >= 2) {
switch (cmd[1]) {
case ISO15693_INVENTORY:
snprintf(exp, size, "INVENTORY");
return;
case ISO15693_STAYQUIET:
snprintf(exp, size, "STAY_QUIET");
return;
case ISO15693_READBLOCK: {
uint8_t block = 0;
if (cmdsize == 13)
block = cmd[10];
snprintf(exp, size, "READBLOCK(%d)", block);
return;
}
case ISO15693_WRITEBLOCK:
snprintf(exp, size, "WRITEBLOCK");
return;
case ISO15693_LOCKBLOCK:
snprintf(exp, size, "LOCKBLOCK");
return;
case ISO15693_READ_MULTI_BLOCK:
snprintf(exp, size, "READ_MULTI_BLOCK");
return;
case ISO15693_WRITE_MULTI_BLOCK:
snprintf(exp, size, "WRITE_MULTI_BLOCK");
return;
case ISO15693_SELECT:
snprintf(exp, size, "SELECT");
return;
case ISO15693_RESET_TO_READY:
snprintf(exp, size, "RESET_TO_READY");
return;
case ISO15693_WRITE_AFI:
snprintf(exp, size, "WRITE_AFI");
return;
case ISO15693_LOCK_AFI:
snprintf(exp, size, "LOCK_AFI");
return;
case ISO15693_WRITE_DSFID:
snprintf(exp, size, "WRITE_DSFID");
return;
case ISO15693_LOCK_DSFID:
snprintf(exp, size, "LOCK_DSFID");
return;
case ISO15693_GET_SYSTEM_INFO:
snprintf(exp, size, "GET_SYSTEM_INFO");
return;
case ISO15693_READ_MULTI_SECSTATUS:
snprintf(exp, size, "READ_MULTI_SECSTATUS");
return;
case ISO15693_INVENTORY_READ:
snprintf(exp, size, "INVENTORY_READ");
return;
case ISO15693_FAST_INVENTORY_READ:
snprintf(exp, size, "FAST_INVENTORY_READ");
return;
case ISO15693_SET_EAS:
snprintf(exp, size, "SET_EAS");
return;
case ISO15693_RESET_EAS:
snprintf(exp, size, "RESET_EAS");
return;
case ISO15693_LOCK_EAS:
snprintf(exp, size, "LOCK_EAS");
return;
case ISO15693_EAS_ALARM:
snprintf(exp, size, "EAS_ALARM");
return;
case ISO15693_PASSWORD_PROTECT_EAS:
snprintf(exp, size, "PASSWORD_PROTECT_EAS");
return;
case ISO15693_WRITE_EAS_ID:
snprintf(exp, size, "WRITE_EAS_ID");
return;
case ISO15693_READ_EPC:
snprintf(exp, size, "READ_EPC");
return;
case ISO15693_GET_NXP_SYSTEM_INFO:
snprintf(exp, size, "GET_NXP_SYSTEM_INFO");
return;
case ISO15693_INVENTORY_PAGE_READ:
snprintf(exp, size, "INVENTORY_PAGE_READ");
return;
case ISO15693_FAST_INVENTORY_PAGE_READ:
snprintf(exp, size, "FAST_INVENTORY_PAGE_READ");
return;
case ISO15693_GET_RANDOM_NUMBER:
snprintf(exp, size, "GET_RANDOM_NUMBER");
return;
case ISO15693_SET_PASSWORD:
snprintf(exp, size, "SET_PASSWORD");
return;
case ISO15693_WRITE_PASSWORD:
snprintf(exp, size, "WRITE_PASSWORD");
return;
case ISO15693_LOCK_PASSWORD:
snprintf(exp, size, "LOCK_PASSWORD");
return;
case ISO15693_PROTECT_PAGE:
snprintf(exp, size, "PROTECT_PAGE");
return;
case ISO15693_LOCK_PAGE_PROTECTION:
snprintf(exp, size, "LOCK_PAGE_PROTECTION");
return;
case ISO15693_GET_MULTI_BLOCK_PROTECTION:
snprintf(exp, size, "GET_MULTI_BLOCK_PROTECTION");
return;
case ISO15693_DESTROY:
snprintf(exp, size, "DESTROY");
return;
case ISO15693_ENABLE_PRIVACY:
snprintf(exp, size, "ENABLE_PRIVACY");
return;
case ISO15693_64BIT_PASSWORD_PROTECTION:
snprintf(exp, size, "64BIT_PASSWORD_PROTECTION");
return;
case ISO15693_STAYQUIET_PERSISTENT:
snprintf(exp, size, "STAYQUIET_PERSISTENT");
return;
case ISO15693_READ_SIGNATURE:
snprintf(exp, size, "READ_SIGNATURE");
return;
default:
break;
}
case ISO15693_WRITEBLOCK:
snprintf(exp, size, "WRITEBLOCK");
return;
case ISO15693_LOCKBLOCK:
snprintf(exp, size, "LOCKBLOCK");
return;
case ISO15693_READ_MULTI_BLOCK:
snprintf(exp, size, "READ_MULTI_BLOCK");
return;
case ISO15693_WRITE_MULTI_BLOCK:
snprintf(exp, size, "WRITE_MULTI_BLOCK");
return;
case ISO15693_SELECT:
snprintf(exp, size, "SELECT");
return;
case ISO15693_RESET_TO_READY:
snprintf(exp, size, "RESET_TO_READY");
return;
case ISO15693_WRITE_AFI:
snprintf(exp, size, "WRITE_AFI");
return;
case ISO15693_LOCK_AFI:
snprintf(exp, size, "LOCK_AFI");
return;
case ISO15693_WRITE_DSFID:
snprintf(exp, size, "WRITE_DSFID");
return;
case ISO15693_LOCK_DSFID:
snprintf(exp, size, "LOCK_DSFID");
return;
case ISO15693_GET_SYSTEM_INFO:
snprintf(exp, size, "GET_SYSTEM_INFO");
return;
case ISO15693_READ_MULTI_SECSTATUS:
snprintf(exp, size, "READ_MULTI_SECSTATUS");
return;
case ISO15693_INVENTORY_READ:
snprintf(exp, size, "INVENTORY_READ");
return;
case ISO15693_FAST_INVENTORY_READ:
snprintf(exp, size, "FAST_INVENTORY_READ");
return;
case ISO15693_SET_EAS:
snprintf(exp, size, "SET_EAS");
return;
case ISO15693_RESET_EAS:
snprintf(exp, size, "RESET_EAS");
return;
case ISO15693_LOCK_EAS:
snprintf(exp, size, "LOCK_EAS");
return;
case ISO15693_EAS_ALARM:
snprintf(exp, size, "EAS_ALARM");
return;
case ISO15693_PASSWORD_PROTECT_EAS:
snprintf(exp, size, "PASSWORD_PROTECT_EAS");
return;
case ISO15693_WRITE_EAS_ID:
snprintf(exp, size, "WRITE_EAS_ID");
return;
case ISO15693_READ_EPC:
snprintf(exp, size, "READ_EPC");
return;
case ISO15693_GET_NXP_SYSTEM_INFO:
snprintf(exp, size, "GET_NXP_SYSTEM_INFO");
return;
case ISO15693_INVENTORY_PAGE_READ:
snprintf(exp, size, "INVENTORY_PAGE_READ");
return;
case ISO15693_FAST_INVENTORY_PAGE_READ:
snprintf(exp, size, "FAST_INVENTORY_PAGE_READ");
return;
case ISO15693_GET_RANDOM_NUMBER:
snprintf(exp, size, "GET_RANDOM_NUMBER");
return;
case ISO15693_SET_PASSWORD:
snprintf(exp, size, "SET_PASSWORD");
return;
case ISO15693_WRITE_PASSWORD:
snprintf(exp, size, "WRITE_PASSWORD");
return;
case ISO15693_LOCK_PASSWORD:
snprintf(exp, size, "LOCK_PASSWORD");
return;
case ISO15693_PROTECT_PAGE:
snprintf(exp, size, "PROTECT_PAGE");
return;
case ISO15693_LOCK_PAGE_PROTECTION:
snprintf(exp, size, "LOCK_PAGE_PROTECTION");
return;
case ISO15693_GET_MULTI_BLOCK_PROTECTION:
snprintf(exp, size, "GET_MULTI_BLOCK_PROTECTION");
return;
case ISO15693_DESTROY:
snprintf(exp, size, "DESTROY");
return;
case ISO15693_ENABLE_PRIVACY:
snprintf(exp, size, "ENABLE_PRIVACY");
return;
case ISO15693_64BIT_PASSWORD_PROTECTION:
snprintf(exp, size, "64BIT_PASSWORD_PROTECTION");
return;
case ISO15693_STAYQUIET_PERSISTENT:
snprintf(exp, size, "STAYQUIET_PERSISTENT");
return;
case ISO15693_READ_SIGNATURE:
snprintf(exp, size, "READ_SIGNATURE");
return;
default:
break;
}
if (cmd[1] > ISO15693_STAYQUIET && cmd[1] < ISO15693_READBLOCK) snprintf(exp, size, "Mandatory RFU");
else if (cmd[1] > ISO15693_READ_MULTI_SECSTATUS && cmd[1] <= 0x9F) snprintf(exp, size, "Optional RFU");
// else if (cmd[1] >= 0xA0 && cmd[1] <= 0xDF) snprintf(exp, size, "Cust IC MFG dependent");
else if (cmd[1] > ISO15693_READ_SIGNATURE && cmd[1] <= 0xDF) snprintf(exp, size, "Cust IC MFG dependent");
else if (cmd[1] >= 0xE0) snprintf(exp, size, "Proprietary IC MFG dependent");
else
snprintf(exp, size, "?");
if (cmd[1] > ISO15693_STAYQUIET && cmd[1] < ISO15693_READBLOCK) snprintf(exp, size, "Mandatory RFU");
else if (cmd[1] > ISO15693_READ_MULTI_SECSTATUS && cmd[1] <= 0x9F) snprintf(exp, size, "Optional RFU");
// else if (cmd[1] >= 0xA0 && cmd[1] <= 0xDF) snprintf(exp, size, "Cust IC MFG dependent");
else if (cmd[1] > ISO15693_READ_SIGNATURE && cmd[1] <= 0xDF) snprintf(exp, size, "Cust IC MFG dependent");
else if (cmd[1] >= 0xE0) snprintf(exp, size, "Proprietary IC MFG dependent");
else
snprintf(exp, size, "?");
}
}
void annotateTopaz(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {