28 #define MODULES_DATALINK_C
33 #include "generated/modules.h"
34 #include "generated/settings.h"
36 #include "pprzlink/messages.h"
44 bool datalink_enabled =
true;
62 struct pprzlink_msg
msg;
65 msg.sender_id = AC_ID;
66 msg.receiver_id = pprzlink_get_msg_sender_id(buf);
68 pprzlink_msg_send_PONG(&
msg);
73 uint8_t msg_id = pprzlink_get_msg_id(buf);
74 uint8_t class_id = pprzlink_get_msg_class_id(buf);
76 modules_parse_datalink(msg_id, class_id,
dev, trans, buf);
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 datalink_periodic(void)
periodic function, should be called at 1Hz
void datalink_init(void)
init function
void datalink_parse_PING(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
void WEAK dl_parse_msg(struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
Should be called when chars are available in dl_buffer.
Handling of messages coming from ground and other A/Cs.
Common code for AP and FBW telemetry.
uint8_t msg[10]
Buffer used for general comunication over SPI (out buffer)
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.