Protocol#
- group drv_protocol
Definitions and implementations of the DotBot protocol.
- Author
Alexandre Abadie alexandre.abadie@inria.fr
- Copyright
Inria, 2022
Defines
-
DB_FIRMWARE_VERSION#
Version of the firmware.
-
DB_SWARM_ID#
Default swarm ID.
-
DB_BROADCAST_ADDRESS#
Broadcast address.
-
DB_GATEWAY_ADDRESS#
Gateway address.
-
DB_MAX_WAYPOINTS#
Max number of waypoints.
Enums
-
enum command_type_t#
Command type.
Values:
-
enumerator DB_PROTOCOL_CMD_MOVE_RAW#
Move raw command type.
-
enumerator DB_PROTOCOL_CMD_RGB_LED#
RGB LED command type.
-
enumerator DB_PROTOCOL_LH2_RAW_DATA#
Lighthouse 2 raw data.
-
enumerator DB_PROTOCOL_LH2_LOCATION#
Lighthouse processed locations.
-
enumerator DB_PROTOCOL_ADVERTISEMENT#
DotBot advertisements.
-
enumerator DB_PROTOCOL_GPS_LOCATION#
GPS data from SailBot.
-
enumerator DB_PROTOCOL_DOTBOT_DATA#
DotBot specific data (for now location and direction)
-
enumerator DB_PROTOCOL_CONTROL_MODE#
Robot remote control mode (automatic or manual)
-
enumerator DB_PROTOCOL_LH2_WAYPOINTS#
List of LH2 waypoints to follow.
-
enumerator DB_PROTOCOL_GPS_WAYPOINTS#
List of GPS waypoints to follow.
-
enumerator DB_PROTOCOL_SAILBOT_DATA#
SailBot specific data (for now GPS and direction)
-
enumerator DB_PROTOCOL_CMD_XGO_ACTION#
XGO action command.
-
enumerator DB_PROTOCOL_LH2_PROCESSED_DATA#
Lighthouse 2 data processed at the DotBot.
-
enumerator DB_PROTOCOL_TDMA_UPDATE_TABLE#
Receive new timings for the TDMA table.
-
enumerator DB_PROTOCOL_TDMA_SYNC_FRAME#
Sent by the gateway at the beginning of a TDMA frame.
-
enumerator DB_PROTOCOL_TDMA_KEEP_ALIVE#
Sent by the client if there is nothing else to send.
-
enumerator DB_PROTOCOL_CMD_MOVE_RAW#
Functions
-
void db_protocol_init(void)#
Initializes the RNG used as a source for random message IDs.
-
void db_protocol_header_to_buffer(uint8_t *buffer, uint64_t dst, application_type_t application, command_type_t command_type)#
Write the protocol header in a buffer.
- Parameters:
buffer – [out] Bytes array to write to
dst – [in] Destination address written in the header
application – [in] Application type that relates to this header
command_type – [in] Command type that follows this header
-
void db_protocol_cmd_move_raw_to_buffer(uint8_t *buffer, uint64_t dst, application_type_t application, protocol_move_raw_command_t *command)#
Write a move raw command in a buffer.
- Parameters:
buffer – [out] Bytes array to write to
dst – [in] Destination address written in the header
application – [in] Application type that relates to this command
command – [in] Pointer to the move raw command
-
void db_protocol_cmd_rgbled_to_buffer(uint8_t *buffer, uint64_t dst, application_type_t application, protocol_rgbled_command_t *command)#
Write an rgbled command in a buffer.
- Parameters:
buffer – [out] Bytes array to write to
dst – [in] Destination address written in the header
application – [in] Application type that relates to this command
command – [in] Pointer to the rgbled command
-
struct protocol_header_t#
DotBot protocol header.
Public Members
-
uint64_t dst#
Destination address of this packet.
-
uint64_t src#
Source address of this packet.
-
uint16_t swarm_id#
Swarm ID.
-
application_type_t application#
Application type.
-
uint8_t version#
Version of the firmware.
-
uint32_t msg_id#
Message ID.
-
command_type_t type#
Type of command following this header.
-
uint64_t dst#
-
struct protocol_move_raw_command_t#
DotBot protocol move raw command.
-
struct protocol_rgbled_command_t#
DotBot protocol RGB LED command.
-
struct protocol_lh2_location_t#
DotBot protocol LH2 computed location.
-
struct protocol_lh2_waypoints_t#
DotBot protocol LH2 waypoints.
Public Members
-
uint8_t length#
Number of waypoints.
-
protocol_lh2_location_t points[DB_MAX_WAYPOINTS]#
Array containing a list of lh2 point coordinates.
-
uint8_t length#
-
struct protocol_gps_coordinate_t#
DotBot protocol GPS coordinates.
-
struct protocol_gps_waypoints_t#
DotBot protocol GPS waypoints.
Public Members
-
uint8_t length#
Number of waypoints.
-
protocol_gps_coordinate_t coordinates[DB_MAX_WAYPOINTS]#
Array containing a list of GPS coordinates.
-
uint8_t length#
-
struct protocol_lh2_processed_packet_t#
LH2 process data compressed for sending over radio.
Public Members
-
uint8_t selected_polynomial#
selected poly is the polyomial # (between 0 and 31) that the demodulation code thinks the demodulated bits are a part of, initialize to error state
-
uint32_t lfsr_location#
LFSR location is the position in a given polynomial’s LFSR that the decoded data is, initialize to error state.
-
uint32_t timestamp_us#
How many microseconds passed since the sample was taken.
-
uint8_t selected_polynomial#
-
struct protocol_tdma_table_t#
Public Members
-
uint32_t frame_period#
duration of a full TDMA frame
-
uint32_t rx_start#
start to listen for packets
-
uint16_t rx_duration#
duration of the RX period
-
uint32_t tx_start#
start of slot for transmission
-
uint16_t tx_duration#
duration of the TX period
-
uint32_t next_period_start#
time until the start of the next TDMA frame
-
uint32_t frame_period#