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_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#