Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Building and parsing Paparazzi frames. More...
#include <inttypes.h>
#include "std.h"
#include "subsystems/datalink/datalink.h"
#include "subsystems/datalink/transport.h"
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 |
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:
Definition in file pprz_transport.h.
struct pprz_transport |
Definition at line 66 of file pprz_transport.h.
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 |
#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().
|
inlinestatic |
Definition at line 84 of file pprz_transport.h.
References pprz_transport::ck_a_rx, pprz_transport::ck_b_rx, transport_rx::error, GOT_CRC1, GOT_LENGTH, GOT_PAYLOAD, GOT_STX, transport_rx::msg_received, transport_rx::ovrn, transport_rx::payload, pprz_transport::payload_idx, transport_rx::payload_len, pprz_transport::status, STX, pprz_transport::trans_rx, TRUE, and UNINIT.
Referenced by bluegiga_read_buffer(), InterMcuEvent(), pprz_check_and_parse(), RadioControlEvent(), superbitrf_receive_packet_cb(), and w5100_read_buffer().
|
inlinestatic |
Definition at line 145 of file pprz_transport.h.
References link_device::char_available, FALSE, link_device::get_byte, transport_rx::msg_received, parse_pprz(), link_device::periph, pprz_parse_payload(), and pprz_transport::trans_rx.
|
inlinestatic |
Definition at line 133 of file pprz_transport.h.
References dl_buffer, dl_msg_available, transport_rx::payload, transport_rx::payload_len, pprz_transport::trans_rx, and TRUE.
Referenced by bluegiga_read_buffer(), main_event_task(), pprz_check_and_parse(), superbitrf_receive_packet_cb(), and w5100_check_and_parse().
void pprz_transport_init | ( | struct pprz_transport * | t | ) |
Definition at line 117 of file pprz_transport.c.
References transport_tx::check_available_space, check_available_space(), transport_tx::count_bytes, count_bytes(), end_message(), transport_tx::end_message, FALSE, transport_tx::impl, transport_rx::msg_received, transport_tx::overrun, overrun(), put_bytes(), transport_tx::put_bytes, put_named_byte(), transport_tx::put_named_byte, size_of(), transport_tx::size_of, start_message(), transport_tx::start_message, pprz_transport::status, pprz_transport::trans_rx, pprz_transport::trans_tx, and UNINIT.
Referenced by downlink_init(), extra_pprz_dl_init(), and intermcu_init().
struct pprz_transport pprz_tp |
Definition at line 49 of file pprz_transport.c.
Referenced by downlink_init().