31 #include "pprzlink/dl_protocol.h"
56 extern bool datalink_enabled;
61 #define DatalinkFillDlBuffer(_buf, _len) { \
63 for (_i = 0; _i < _len; _i++) { \
64 dl_buffer[_i] = _buf[_i]; \
66 dl_msg_available = true; \
78 static inline void DlCheckAndParse(
struct link_device *
dev,
struct transport_tx *trans,
uint8_t *buf,
bool *msg_available,
bool update_dl)
82 if (!datalink_enabled) {
93 *msg_available =
false;
uint8_t dl_buffer[MSG_SIZE]
uint16_t datalink_time
time in seconds since last datalink message was received
uint16_t datalink_nb_msgs
number of datalink/uplink messages received
bool dl_msg_available
Flag provided to control calls to dl_parse_msg.
void dl_parse_msg(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
Should be called when chars are available in dl_buffer.
void datalink_periodic(void)
periodic function, should be called at 1Hz
static void DlCheckAndParse(struct link_device *dev, struct transport_tx *trans, uint8_t *buf, bool *msg_available, bool update_dl)
Check for new message and parse.
void datalink_init(void)
init function
void datalink_parse_PING(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
static const struct usb_device_descriptor dev
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.