Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Maxstream XBee serial input and output. More...
#include "subsystems/datalink/datalink.h"
#include "generated/airframe.h"
#include "subsystems/datalink/transport.h"
#include "subsystems/datalink/xbee24.h"
Go to the source code of this file.
Data Structures | |
struct | xbee_transport |
Macros | |
#define | XBEE_START 0x7e |
#define | XBEE_UNINIT 0 |
Status of the API packet receiver automata. More... | |
#define | XBEE_GOT_START 1 |
#define | XBEE_GOT_LENGTH_MSB 2 |
#define | XBEE_GOT_LENGTH_LSB 3 |
#define | XBEE_GOT_PAYLOAD 4 |
#define | XBeeCheckAndParse(_dev, _trans) xbee_check_and_parse(&(_dev).device, &(_trans)) |
Functions | |
void | xbee_init (void) |
Initialisation in API mode and setting of the local address FIXME: busy wait. More... | |
static void | parse_xbee (struct xbee_transport *t, uint8_t c) |
Parsing a XBee API frame. More... | |
static void | xbee_parse_payload (struct xbee_transport *t) |
Parsing a frame data and copy the payload to the datalink buffer. More... | |
static void | xbee_check_and_parse (struct link_device *dev, struct xbee_transport *trans) |
Variables | |
struct xbee_transport | xbee_tp |
Maxstream XBee serial input and output.
Definition in file xbee.h.
struct xbee_transport |
Data Fields | ||
---|---|---|
uint8_t | cs_rx | |
uint8_t | cs_tx | |
uint8_t | payload_idx | |
uint8_t | rssi | |
uint8_t | status | |
struct transport_rx | trans_rx | |
struct transport_tx | trans_tx |
#define XBEE_GOT_LENGTH_LSB 3 |
Definition at line 51 of file xbee.h.
Referenced by parse_xbee().
#define XBEE_GOT_LENGTH_MSB 2 |
Definition at line 50 of file xbee.h.
Referenced by parse_xbee().
#define XBEE_GOT_PAYLOAD 4 |
Definition at line 52 of file xbee.h.
Referenced by parse_xbee().
#define XBEE_GOT_START 1 |
Definition at line 49 of file xbee.h.
Referenced by parse_xbee().
#define XBEE_START 0x7e |
Definition at line 41 of file xbee.h.
Referenced by parse_xbee(), and start_message().
#define XBEE_UNINIT 0 |
Status of the API packet receiver automata.
Definition at line 48 of file xbee.h.
Referenced by parse_xbee(), and xbee_init().
#define XBeeCheckAndParse | ( | _dev, | |
_trans | |||
) | xbee_check_and_parse(&(_dev).device, &(_trans)) |
|
inlinestatic |
Parsing a XBee API frame.
Definition at line 71 of file xbee.h.
References xbee_transport::cs_rx, transport_rx::error, transport_rx::msg_received, transport_rx::ovrn, transport_rx::payload, xbee_transport::payload_idx, transport_rx::payload_len, xbee_transport::status, xbee_transport::trans_rx, TRUE, XBEE_GOT_LENGTH_LSB, XBEE_GOT_LENGTH_MSB, XBEE_GOT_PAYLOAD, XBEE_GOT_START, XBEE_START, and XBEE_UNINIT.
Referenced by xbee_check_and_parse().
|
inlinestatic |
Definition at line 139 of file xbee.h.
References link_device::char_available, FALSE, link_device::get_byte, transport_rx::msg_received, parse_xbee(), link_device::periph, xbee_transport::trans_rx, and xbee_parse_payload().
void xbee_init | ( | void | ) |
Initialisation in API mode and setting of the local address FIXME: busy wait.
Setting my address
Switching back to normal mode
Definition at line 165 of file xbee.c.
References AT_AP_MODE, AT_EXIT, AT_SET_MY, link_device::char_available, transport_tx::check_available_space, check_available_space(), transport_tx::count_bytes, count_bytes(), end_message(), transport_tx::end_message, FALSE, link_device::get_byte, transport_tx::impl, transport_rx::msg_received, transport_tx::overrun, overrun(), link_device::periph, print_hex16(), print_string(), 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, xbee_transport::status, sys_time_usleep(), xbee_transport::trans_rx, xbee_transport::trans_tx, uart_periph_set_baudrate(), XBEE_ATBD_CODE, XBEE_BAUD_ALTERNATE, XBEE_MY_ADDR, xbee_tp, xbee_try_to_enter_api(), and XBEE_UNINIT.
Referenced by downlink_init().
|
inlinestatic |
Parsing a frame data and copy the payload to the datalink buffer.
Definition at line 120 of file xbee.h.
References dl_buffer, dl_msg_available, transport_rx::payload, transport_rx::payload_len, xbee_transport::trans_rx, TRUE, XBEE_RFDATA_OFFSET, XBEE_RX_ID, XBEE_TX_ID, and XbeeGetRSSI.
Referenced by xbee_check_and_parse().
struct xbee_transport xbee_tp |
Definition at line 43 of file xbee.c.
Referenced by xbee_init().