Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pprz_transport.h File Reference

Building and parsing Paparazzi frames. More...

#include <inttypes.h>
#include "std.h"
#include "subsystems/datalink/datalink.h"
#include "subsystems/datalink/transport.h"
+ Include dependency graph for pprz_transport.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  pprz_transport
 

Macros

#define STX   0x99
 
#define UNINIT   0
 
#define GOT_STX   1
 
#define GOT_LENGTH   2
 
#define GOT_PAYLOAD   3
 
#define GOT_CRC1   4
 
#define PprzCheckAndParse(_dev, _trans)   pprz_check_and_parse(&(_dev).device, &(_trans))
 

Functions

void pprz_transport_init (struct pprz_transport *t)
 
static void parse_pprz (struct pprz_transport *t, uint8_t c)
 
static void pprz_parse_payload (struct pprz_transport *t)
 
static void pprz_check_and_parse (struct link_device *dev, struct pprz_transport *trans)
 

Variables

struct pprz_transport pprz_tp
 

Detailed Description

Building and parsing Paparazzi frames.

Pprz frame:

|STX|length|... payload=(length-4) bytes ...|Checksum A|Checksum B|

where checksum is computed over length and payload:

ck_A = ck_B = length
for each byte b in payload
ck_A += b;
ck_b += ck_A;

Definition in file pprz_transport.h.


Data Structure Documentation

struct pprz_transport

Definition at line 66 of file pprz_transport.h.

+ Collaboration diagram for pprz_transport:
Data Fields
uint8_t ck_a_rx
uint8_t ck_a_tx
uint8_t ck_b_rx
uint8_t ck_b_tx
uint8_t payload_idx
uint8_t status
struct transport_rx trans_rx
struct transport_tx trans_tx

Macro Definition Documentation

#define GOT_CRC1   4

Definition at line 64 of file pprz_transport.h.

Referenced by parse_pprz().

#define GOT_LENGTH   2

Definition at line 62 of file pprz_transport.h.

Referenced by parse_pprz().

#define GOT_PAYLOAD   3

Definition at line 63 of file pprz_transport.h.

Referenced by parse_pprz().

#define GOT_STX   1

Definition at line 61 of file pprz_transport.h.

Referenced by parse_pprz().

#define PprzCheckAndParse (   _dev,
  _trans 
)    pprz_check_and_parse(&(_dev).device, &(_trans))

Definition at line 143 of file pprz_transport.h.

#define STX   0x99

Definition at line 57 of file pprz_transport.h.

Referenced by parse_pprz().

#define UNINIT   0

Definition at line 60 of file pprz_transport.h.

Referenced by parse_pprz().

Function Documentation

static void pprz_check_and_parse ( struct link_device dev,
struct pprz_transport trans 
)
inlinestatic
static void pprz_parse_payload ( struct pprz_transport t)
inlinestatic

Variable Documentation

struct pprz_transport pprz_tp

Definition at line 49 of file pprz_transport.c.

Referenced by downlink_init().