![]() The Sphero API packet structure is shown below. For forwarded commands, the data size may also be limited by intermediate nodes’ buffer sizes, depending on the implementation.įinally, all packets contain a single byte checksum, which is computed over all other bytes in the packet (excluding SOP and EOP) before payload encoding. In principle, this payload may be any size, though in practice the payload is limited by the receiver’s buffers. Responses contain a special “error code” field in the header that expresses the result of the corresponding command (see: Error Codes).īoth commands and responses may contain a data payload. Responses echo the DID, CID, and SEQ to help the sender fully identify the corresponding command packet. When sending a command, the sender uses the “sequence number” (SEQ) as a handle to link a particular command packet to its response. These bytes specify the command to execute. The TID and SID are each composed of two parts, a “port ID” and a “node ID” (See: Sending Information via Channels).Īll packets have a two-byte ID code, separated into the “device ID” (DID) and “command ID” (CID). Packets can be directed to particular nodes using the “target ID” (TID) and “source ID” (SID). Commands may optionally request a response from the receiver using a bit flag. Commands may be sent at any time by any node. Packets are classified as either commands or responses, distinguished by a bit flag. These control byte values are not allowed unencoded anywhere else in the packet (see: Packet Encoding). Packets start/end with the special SOP/EOP control bytes. All Sphero API packets share a single structure defined below. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |