Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 SenderIdOfPprzMsg(x)   (x[0])
 
#define IdOfPprzMsg(x)   (x[1])
 
#define PPRZ   1
 Datalink kinds. More...
 
#define XBEE   2
 
#define SUPERBITRF   3
 
#define W5100   4
 
#define BLUEGIGA   5
 
#define MSG_SIZE   128
 
#define DatalinkFillDlBuffer(_buf, _len)
 Convenience macro to fill dl_buffer. More...
 
#define DatalinkEvent()
 

Functions

EXTERN void dl_parse_msg (void)
 Should be called when chars are available in dl_buffer. More...
 
EXTERN void firmware_parse_msg (void)
 Firmware specfic msg handler. More...
 
static void DlCheckAndParse (void)
 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

#define BLUEGIGA   5

Definition at line 48 of file datalink.h.

Referenced by downlink_init().

#define DatalinkEvent ( )
Value:
{ \
pprz_check_and_parse(&(PPRZ_UART).device, &pprz_tp, dl_buffer, &dl_msg_available); \
}

Definition at line 101 of file datalink.h.

Referenced by event_task_ap(), main_event(), and main_event_task().

#define DatalinkFillDlBuffer (   _buf,
  _len 
)
Value:
{ \
uint8_t _i = 0; \
for (_i = 0; _i < _len; _i++) { \
dl_buffer[_i] = _buf[_i]; \
} \
}
unsigned char uint8_t
Definition: types.h:14

Convenience macro to fill dl_buffer.

Definition at line 73 of file datalink.h.

Referenced by superbitrf_receive_packet_cb(), and w5100_check_and_parse().

#define EXTERN   extern

Definition at line 33 of file datalink.h.

#define IdOfPprzMsg (   x)    (x[1])

Definition at line 41 of file datalink.h.

Referenced by dl_parse_msg(), firmware_parse_msg(), parse_acinfo_dl(), and parse_rssi_dl().

#define MSG_SIZE   128

Definition at line 59 of file datalink.h.

#define PPRZ   1

Datalink kinds.

Definition at line 44 of file datalink.h.

Referenced by downlink_init().

#define SenderIdOfPprzMsg (   x)    (x[0])

Definition at line 40 of file datalink.h.

Referenced by dl_parse_msg(), parse_acinfo_dl(), parse_rssi_dl(), and parseTcasRA().

#define SUPERBITRF   3

Definition at line 46 of file datalink.h.

Referenced by downlink_init().

#define W5100   4

Definition at line 47 of file datalink.h.

Referenced by downlink_init().

#define XBEE   2

Definition at line 45 of file datalink.h.

Function Documentation

EXTERN void dl_parse_msg ( void  )

Should be called when chars are available in dl_buffer.

Definition at line 107 of file setup_actuators.c.

References DefaultChannel, DefaultDevice, dl_buffer, firmware_parse_msg(), gps_inject_data(), IdOfMsg, IdOfPprzMsg, LED_TOGGLE, parse_rc_3ch_datalink(), parse_rc_4ch_datalink(), SenderIdOfPprzMsg, and val.

Referenced by DlCheckAndParse().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static void DlCheckAndParse ( void  )
inlinestatic

Check for new message and parse.

Definition at line 82 of file datalink.h.

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

Referenced by set_datalink_message().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

EXTERN uint16_t datalink_nb_msgs

number of datalink/uplink messages received

Definition at line 57 of file datalink.h.

Referenced by DlCheckAndParse().

EXTERN uint16_t datalink_time

time in seconds since last datalink message was received

Definition at line 54 of file datalink.h.

Referenced by DlCheckAndParse().

EXTERN uint8_t dl_buffer[MSG_SIZE]

Definition at line 60 of file datalink.h.

EXTERN bool dl_msg_available

Flag provided to control calls to dl_parse_msg.

NOT used in this module

Definition at line 51 of file datalink.h.

Referenced by DlCheckAndParse().