Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
datalink.h File Reference

Handling of messages coming from ground and other A/Cs. More...

#include "std.h"
#include "pprzlink/dl_protocol.h"
+ Include dependency graph for datalink.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EXTERN   extern
 
#define PPRZ   1
 Datalink kinds. More...
 
#define XBEE   2
 
#define SUPERBITRF   3
 
#define W5100   4
 
#define BLUEGIGA   5
 
#define MSG_SIZE   256
 
#define DatalinkFillDlBuffer(_buf, _len)
 Convenience macro to fill dl_buffer. More...
 

Functions

EXTERN 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. More...
 
EXTERN void firmware_parse_msg (struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
 Firmware specfic msg handler. More...
 
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. More...
 

Variables

EXTERN bool dl_msg_available
 Flag provided to control calls to dl_parse_msg. More...
 
EXTERN uint16_t datalink_time
 time in seconds since last datalink message was received More...
 
EXTERN uint16_t datalink_nb_msgs
 number of datalink/uplink messages received More...
 
EXTERN uint8_t dl_buffer [MSG_SIZE]
 

Detailed Description

Handling of messages coming from ground and other A/Cs.

Definition in file datalink.h.

Macro Definition Documentation

◆ BLUEGIGA

#define BLUEGIGA   5

Definition at line 44 of file datalink.h.

◆ DatalinkFillDlBuffer

#define DatalinkFillDlBuffer (   _buf,
  _len 
)
Value:
{ \
uint16_t _i = 0; \
for (_i = 0; _i < _len; _i++) { \
dl_buffer[_i] = _buf[_i]; \
} \
dl_msg_available = true; \
}

Convenience macro to fill dl_buffer.

Definition at line 70 of file datalink.h.

◆ EXTERN

#define EXTERN   extern

Definition at line 33 of file datalink.h.

◆ MSG_SIZE

#define MSG_SIZE   256

Definition at line 55 of file datalink.h.

◆ PPRZ

#define PPRZ   1

Datalink kinds.

Definition at line 40 of file datalink.h.

◆ SUPERBITRF

#define SUPERBITRF   3

Definition at line 42 of file datalink.h.

◆ W5100

#define W5100   4

Definition at line 43 of file datalink.h.

◆ XBEE

#define XBEE   2

Definition at line 41 of file datalink.h.

Function Documentation

◆ dl_parse_msg()

EXTERN 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.

Definition at line 114 of file setup_actuators.c.

References DefaultChannel, DefaultDevice, dev, firmware_parse_msg(), gps_inject_data(), IdOfMsg, LED_TOGGLE, msg, parse_rc_3ch_datalink(), parse_rc_4ch_datalink(), and val.

Referenced by DlCheckAndParse(), and telemetry_intermcu_on_msg().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DlCheckAndParse()

static void DlCheckAndParse ( struct link_device *  dev,
struct transport_tx *  trans,
uint8_t buf,
bool *  msg_available,
bool  update_dl 
)
inlinestatic

Check for new message and parse.

Definition at line 79 of file datalink.h.

References datalink_nb_msgs, datalink_time, dev, and dl_parse_msg().

Referenced by bluegiga_dl_event(), extra_pprz_dl_event(), gec_dl_event(), pprz_dl_event(), set_datalink_message(), superbitrf_dl_event(), w5100_event(), and xbee_dl_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ firmware_parse_msg()

Variable Documentation

◆ datalink_nb_msgs

EXTERN uint16_t datalink_nb_msgs

number of datalink/uplink messages received

Definition at line 53 of file datalink.h.

Referenced by DlCheckAndParse().

◆ datalink_time

EXTERN uint16_t datalink_time

time in seconds since last datalink message was received

Definition at line 50 of file datalink.h.

Referenced by DlCheckAndParse().

◆ dl_buffer

EXTERN uint8_t dl_buffer[MSG_SIZE]

Definition at line 56 of file datalink.h.

◆ dl_msg_available

EXTERN bool dl_msg_available

Flag provided to control calls to dl_parse_msg.

NOT used in this module

Definition at line 47 of file datalink.h.