-
Notifications
You must be signed in to change notification settings - Fork 0
Packetizer Functions
This page contains information about the functions implemented in the packetizer peripheral library within SUBLIBinal. Please refer to the list below to be redirected to the appropriate documentation.
Definitions
void initialize_packetizer(Packetizer_Config config);
Description
This function initializes the packetizer module within SUBLIBinal.
Parameters
-
Packetizer_Config config:
config
is a completely filled out Packetizer configuration structure. All parameters are required for send and receive functionality within the packetizer.
Definitions
Error send_packet(Data_Channel which_channel, uint8* data, uint8 data_size);
Description
This function will transmit a packet of information along the specified data channel utilizing the packetizer.
Parameters
- Data_Channel which_channel: This parameter specifies which channel will be used for the transmission.
- uint8 *data: This parameter is a pointer to a data buffer that contains the information that must be transmitted along in the packet.
-
uint8 data_size: This parameter specifies how many data bytes should be transmitted within the packet and will be used to copy
data_size
elements from the data pointed to bydata
.
Return
This function will return the following errors:
-
ERR_QUEUE_FULL
: This error will be returned if the Packetizer could not fully enqueue the data into the buffer to be transmitted. This means the packet has been malformed, and sync will be lost.
Definitions
Error bg_process_packetizer(Data_Channel which_channel);
Description
The packetizer background process is used for receiving of packets from an external source. The background process will remove packets from the received queue and call the callback function with the packet data and size supplied as parameters. This is the only way to receive packets utilizing the packetizer.
Parameters
- Data_Channel which_channel: This parameter specifies which channel should be used for reading from the packetizer.
Return
This function will return the following error codes based upon status:
-
ERR_QUEUE_INVALID_READ
: This will occur if the queue was unable to read information. This is returned if no data was received from the buffer.
SUBLIBinal was created by the Palouse Robosub Club.