Host-to-Reader Communication Framework
| Header | Data Length | Command Code | Data | CRC-16 |
|---|---|---|---|---|
| 1 byte, must be 0XFF | 1 byte, the number of bytes of the Data field | 1 byte | Data block, with high byte in front | 2-byte cyclic redundancy code, with the high byte in front |
Reader-to-Host Communication Framework
| Header | Data Length | Command Code | Status Code | Data | CRC-16 |
|---|---|---|---|---|---|
| 1 byte, must be 0xFF | 1 byte, the number of bytes of the Data field | 1 byte | 2 bytes, status code, 0 means the operation is successful, non-zero value means operation failure. | Data block, with high byte in front | 2-byte cyclic redundancy code, with the high byte in front |
#define MSG_CRC_INIT 0xFFFF
#define MSG_CCITT_CRC_POLY 0x1021
void CRC_calcCrc8(uint16 *crcReg, uint16 poly, uint16 u8Data)
{
uint16 i;
uint16 xorFlag;
uint16 bit;
uint16 dcdBitMask = 0x80;
for(i=0; i<8; i++)
{
xorFlag = *crcReg & 0x8000;
*crcReg <<= 1;
bit = ((u8Data & dcdBitMask) == dcdBitMask);
*crcReg |= bit;
if(xorFlag)
{
*crcReg = *crcReg ^ poly;
}
dcdBitMask >>= 1;
}
}
uint16 CalcCRC(uint8 *msgbuf,uint8 msglen)
{
uint16 calcCrc = MSG_CRC_INIT;
uint8 i;
for (i = 1; i < msglen; ++i)
CRC_calcCrc8(&calcCrc, MSG_CCITT_CRC_POLY, msgbuf[i]);
return calcCrc;
}
Command Classification and Workflow
| Command Set Name | Description |
|---|---|
| Bootloader Commands | Any command that can be executed while the reader is in the bootloader phase is called Bootloader Commands. |
| Tag Inventory Commands | Commands related to inventory operation |
| Tag Access Commands | Commands related to Tag Access operations |
| Setting Commands | Used to set configurable values in the firmware |
| Getting Commands | Used to get parameters, options and working state from the reader |
Special Note