<CR> 1,441,2,C,1, 344,304,5690665,5063065,15926,625,25,25,153 <CR>
Figure 6.8 A stream containing a centroid packet is shown. The ’<CR>’ denotes the carriage return framing character. This character is found at the beginning of a packet and again at the end.
of markers observed by the camera modules.
The protocol has been implemented using a text data format. This means that only al- phanumeric characters are used for the packet data. This satisfies the desire for human readability (there are not any non-printable characters) but has some disadvantages com-
pared with a binary protocol. In this implementation integers and floating point numbers are encoded as strings of base 10 decimal numbers. The type of packet is encoded as a string also. Each field is separated by a comma and the packet framing begins with a car- riage return character and ends with a carriage return. Carriage return characters cannot occur elsewhere in a packet and therefore they are unique to the packet framing. This is ad- vantageous as it means a packet decoder cannot mistakenly believe a packet is beginning or ending when in fact the character occurs in the packet data.
typical stream containing a centroid packet is shown in Figure 6.8. The packet framing occurs at the beginning and end using a carriage return character (shown by ‘<CR>’). The next four fields define the packet header. This packet is being sent to the Soft Hub as the destination bus ID is ‘1’. The time stamp is ‘441’. The sender ID is ‘2’ which indicates that a camera module with ID ‘2’ sent the packet. The packet ID is given by the ‘C’ and this denotes that the packet is a centroid packet. Details of all of the packets are given in
Using a text protocol makes it easier for humans to read but it is not as efficient as a binary protocol could be. The consequences of this is that for a given bandwidth fewer packets can be sent using a text protocol when compared with a more efficient binary protocol. The throughput using the text protocol can be estimated approximately. The system’s primary purpose is to transfer centroid packets and these constitute the majority of the traffic. The throughput can be calculated based on the length of these packets. Using the bandwidth limit of 90 K bytes/s and a typical centroid packet, the number of centroid packets that can be transferred per second can be approximated. Using a packet length of L = 55 (see Figure 6.8), this is 90 × 210/55 = 1676 packets/s. Using a frame rate of F = 60 frames/s this is