User's Manual

PROTOCOL SPECIFICATION - CAEN UHF RFID Readers Communication Protocol 6
2 PROTOCOL SPECIFICATION
Introduction
CAEN UHF RFID Reader protocol uses two logical communication channels: one for synchronous commands and one
for asynchronous notifications. Command channel is mandatory and, at now, it is implemented on top of a TCP/IP
socket (port 1000) and on RS232 while notification channels are implemented only with sockets.
All the messages (commands, responses and notifications) are composed by a header and a body. In all cases the body
of the message is a list of attribute-value pairs. Responses always echo the Command AVP sent by the host.
All the packets for the control and notification channel share a common header format:
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-------------------------------+------------------------------+
| FIXED | Message ID |
+-------------------------------+------------------------------+
| Vendor ID |
+-------------------------------+------------------------------+
| Length |
+-------------------------------+
FIXED: Must be 0x8001 for commands and 0x0001 for responses.
Message ID: Id of the message. It is a sequence number used to map requests to its responses: a request and its
corresponding response have the same message ID (the id is local to the channel).
Vendor ID: Must be 21336: the IANA “SMI Network Management Private Enterprise Code” assigned to CAEN SpA.
Length: Encodes the length of the message (in bytes) including the header.
The header is followed by a list of AVPs the number of which depends on the command. Each AVP have the following
format:
1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-------------------------------+------------------------------+
| RESERVED | Length |
+-------------------------------+------------------------------+
| Attribute Type | Attribute Value ……… |
+-------------------------------+------------------------------+
| ………[ until length is reached ]……… |
+--------------------------------------------------------------+
RESERVED: The first 16 bits are reserved for future extensions. All reserved bits must be set to 0 on outgoing messages
and ignored on incoming messages.
Length: Encodes the length of the AVP packet including the length and the reserved fields.
Attribute type: A 2 byte code identifying the attribute type.
Attribute value: The actual attribute value according to the type. It follows immediately after the Attribute Type field
and runs for the remaining bytes indicated in the Length (i.e. Length minus 6 bytes of header).