Skip to content
Ryan Summers edited this page Mar 1, 2016 · 3 revisions

Packetizer Design

This page contains information about the higher level design of the packetizer. Information here includes how a packet is created and how the background function processes information. Please select the relevant topic from the information below.

Design


Packet Format

The packetizer utilizes wrapper functionality to wrap information into packets for transmission. The benefit of packetized transmission can be seen if devices are sending complex pieces of information that must be in order. For example, transmission of x, y, and z accelerations. If a packetized scheme is not used, it can be possible to differentiate which piece of data correlates to x, y, and z respectively.

To construct a packet of information, the packetizer uses a user input control byte and a size byte. The size byte parameter is the size of the data that the packetizer is wrapping around. In the earlier example, if our x, y, and z parameters each contain two bytes of data, the total size byte would be equal to 6. The packetizer then utilizes this data to construct the following packet:

Packet Specification

top


Background Process

The packetizer background process is a process that will receive data packets from the respective communication scheme receive line. The background process removes packets from the buffer and calls a callback function. This callback function should accept two parameters. The first parameter the callback function should accept is a uint8* data type to the data. The second data type should be a uint8 size parameter. Please view the example below:

void callback_packetizer(uint8* data_pointer, uint8 size) {

//... Process information

}

top

Clone this wiki locally