37 #include "pprzlink/dl_protocol.h"
40 #define SenderIdOfPprzMsg(x) (x[0])
41 #define IdOfPprzMsg(x) (x[1])
69 EXTERN bool datalink_enabled;
73 #define DatalinkFillDlBuffer(_buf, _len) { \
75 for (_i = 0; _i < _len; _i++) { \
76 dl_buffer[_i] = _buf[_i]; \
78 dl_msg_available = true; \
86 if (!datalink_enabled) {
99 #if defined DATALINK && DATALINK == PPRZ
101 #define DatalinkEvent() { \
102 pprz_check_and_parse(&(PPRZ_UART).device, &pprz_tp, dl_buffer, &dl_msg_available); \
106 #elif defined DATALINK && DATALINK == XBEE
108 #define DatalinkEvent() { \
109 xbee_check_and_parse(&(XBEE_UART).device, &xbee_tp, dl_buffer, &dl_msg_available); \
113 #elif defined DATALINK && DATALINK == W5100
115 #define DatalinkEvent() { \
116 W5100CheckAndParse(W5100, pprz_tp); \
120 #elif defined DATALINK && DATALINK == SUPERBITRF
122 #define DatalinkEvent() { \
123 SuperbitRFCheckAndParse(); \
127 #elif defined DATALINK && DATALINK == BLUEGIGA
129 #define DatalinkEvent() { \
130 pprz_check_and_parse(&(DOWNLINK_DEVICE).device, &pprz_tp, dl_buffer, &dl_msg_available); \
137 #define DatalinkEvent() {}
EXTERN uint8_t dl_buffer[MSG_SIZE]
EXTERN bool dl_msg_available
Flag provided to control calls to dl_parse_msg.
EXTERN uint16_t datalink_time
time in seconds since last datalink message was received
static void DlCheckAndParse(void)
Check for new message and parse.
EXTERN uint16_t datalink_nb_msgs
number of datalink/uplink messages received
EXTERN void dl_parse_msg(void)
Should be called when chars are available in dl_buffer.
EXTERN void firmware_parse_msg(void)
Firmware specfic msg handler.