Paparazzi UAS  v7.0_unstable
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 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

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...
 
void datalink_init (void)
 init function More...
 
void datalink_periodic (void)
 periodic function, should be called at 1Hz More...
 
void datalink_parse_PING (struct link_device *dev, struct transport_tx *trans, uint8_t *buf)
 
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

bool dl_msg_available
 Flag provided to control calls to dl_parse_msg. More...
 
uint16_t datalink_time
 time in seconds since last datalink message was received More...
 
uint16_t datalink_nb_msgs
 number of datalink/uplink messages received More...
 
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 38 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 61 of file datalink.h.

◆ MSG_SIZE

#define MSG_SIZE   256

Definition at line 49 of file datalink.h.

◆ PPRZ

#define PPRZ   1

Datalink kinds.

Definition at line 34 of file datalink.h.

◆ SUPERBITRF

#define SUPERBITRF   3

Definition at line 36 of file datalink.h.

◆ W5100

#define W5100   4

Definition at line 37 of file datalink.h.

◆ XBEE

#define XBEE   2

Definition at line 35 of file datalink.h.

Function Documentation

◆ datalink_init()

void datalink_init ( void  )

init function

Definition at line 47 of file datalink.c.

References datalink_nb_msgs, datalink_time, and dl_msg_available.

Referenced by main_init().

+ Here is the caller graph for this function:

◆ datalink_parse_PING()

void datalink_parse_PING ( struct link_device *  dev,
struct transport_tx *  trans,
uint8_t buf 
)

Definition at line 59 of file datalink.c.

References dev, and msg.

◆ datalink_periodic()

void datalink_periodic ( void  )

periodic function, should be called at 1Hz

Definition at line 54 of file datalink.c.

References datalink_time.

Referenced by main_periodic_task().

+ Here is the caller graph for this function:

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

Definition at line 118 of file setup_actuators.c.

References DefaultChannel, DefaultDevice, dev, IdOfMsg, LED_TOGGLE, and val.

Referenced by DlCheckAndParse(), and intermcu_event().

+ 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 78 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(), sensors_hitl_event(), superbitrf_dl_event(), and xbee_dl_event().

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

Variable Documentation

◆ datalink_nb_msgs

uint16_t datalink_nb_msgs
extern

number of datalink/uplink messages received

Definition at line 40 of file datalink.c.

Referenced by datalink_init(), DlCheckAndParse(), intermcu_event(), and send_downlink().

◆ datalink_time

uint16_t datalink_time
extern

time in seconds since last datalink message was received

Definition at line 39 of file datalink.c.

Referenced by autopilot_failsafe_checks(), datalink_init(), datalink_periodic(), DlCheckAndParse(), intermcu_event(), send_downlink(), and xtend_rssi_periodic().

◆ dl_buffer

◆ dl_msg_available

bool dl_msg_available
extern

Flag provided to control calls to dl_parse_msg.

NOT used in this module

Definition at line 60 of file main_demo5.c.

Referenced by bluegiga_dl_event(), datalink_init(), gec_dl_event(), main_event_task(), pprz_dl_event(), superbitrf_dl_event(), superbitrf_receive_packet_cb(), and xbee_dl_event().