dRonin
adbada4
dRonin firmware
|
Files | |
file | uavtalk.h |
Include file of the UAVTalk library. | |
file | uavtalk_priv.h |
Private include file of the UAVTalk library. | |
file | uavtalk.c |
UAVTalk library, implements to telemetry protocol. See the wiki for more details. | |
Data Structures | |
struct | UAVTalkStats |
Tracking statistics for a UAVTalk connection. More... | |
struct | uavtalk_min_header |
Minimal UAVTalk header without an instance field. More... | |
struct | uavtalk_max_header |
Full UAVTalk header with an instance field. More... | |
struct | filereq_data |
struct | fileresp_data |
struct | UAVTalkInputProcessor |
State information for the UAVTalk parser. More... | |
struct | UAVTalkConnectionData |
Information for the physical link. More... | |
Typedefs | |
typedef int32_t(* | UAVTalkOutputCb )(void *ctx, uint8_t *data, int32_t length) |
typedef void(* | UAVTalkAckCb )(void *ctx, uint32_t obj_id, uint16_t inst_id) |
typedef void(* | UAVTalkReqCb )(void *ctx, uint32_t obj_id, uint16_t inst_id) |
typedef int32_t(* | UAVTalkFileCb )(void *ctx, uint8_t *buf, uint32_t file_id, uint32_t offset, uint32_t len) |
typedef void * | UAVTalkConnection |
typedef uint8_t | uavtalk_checksum |
Variables | |
typedef | __attribute__ |
#define CHECKCONHANDLE | ( | handle, | |
variable, | |||
failcommand | |||
) |
Definition at line 126 of file uavtalk_priv.h.
#define UAVTALK_CANARI 0xCA |
Definition at line 106 of file uavtalk_priv.h.
#define UAVTALK_CHECKSUM_LENGTH sizeof(uavtalk_checksum) |
Definition at line 69 of file uavtalk_priv.h.
#define UAVTALK_FILEDATA_EOF 0x01 |
Definition at line 122 of file uavtalk_priv.h.
#define UAVTALK_FILEDATA_LAST 0x02 |
Definition at line 123 of file uavtalk_priv.h.
#define UAVTALK_MAX_HEADER_LENGTH sizeof(uavtalk_max_header) |
Definition at line 56 of file uavtalk_priv.h.
#define UAVTALK_MAX_PACKET_LENGTH UAVTALK_MIN_PACKET_LENGTH + UAVTALK_MAX_PAYLOAD_LENGTH |
Definition at line 72 of file uavtalk_priv.h.
#define UAVTALK_MAX_PAYLOAD_LENGTH (UAVOBJECTS_LARGEST + 1) |
Definition at line 70 of file uavtalk_priv.h.
#define UAVTALK_MIN_HEADER_LENGTH sizeof(uavtalk_min_header) |
Definition at line 46 of file uavtalk_priv.h.
#define UAVTALK_MIN_PACKET_LENGTH UAVTALK_MAX_HEADER_LENGTH + UAVTALK_CHECKSUM_LENGTH |
Definition at line 71 of file uavtalk_priv.h.
#define UAVTALK_NOWAIT 0 |
Definition at line 108 of file uavtalk_priv.h.
#define UAVTALK_SYNC_VAL 0x3C |
Definition at line 109 of file uavtalk_priv.h.
#define UAVTALK_TIMESTAMPED 0x80 |
Definition at line 112 of file uavtalk_priv.h.
#define UAVTALK_TYPE_ACK (UAVTALK_TYPE_VER | 0x03) |
Definition at line 116 of file uavtalk_priv.h.
#define UAVTALK_TYPE_FILEDATA (UAVTALK_TYPE_VER | 0x09) |
Definition at line 119 of file uavtalk_priv.h.
#define UAVTALK_TYPE_FILEREQ (UAVTALK_TYPE_VER | 0x08) |
Definition at line 118 of file uavtalk_priv.h.
#define UAVTALK_TYPE_MASK 0x70 |
Definition at line 110 of file uavtalk_priv.h.
#define UAVTALK_TYPE_NACK (UAVTALK_TYPE_VER | 0x04) |
Definition at line 117 of file uavtalk_priv.h.
#define UAVTALK_TYPE_OBJ (UAVTALK_TYPE_VER | 0x00) |
Definition at line 113 of file uavtalk_priv.h.
#define UAVTALK_TYPE_OBJ_ACK (UAVTALK_TYPE_VER | 0x02) |
Definition at line 115 of file uavtalk_priv.h.
#define UAVTALK_TYPE_OBJ_REQ (UAVTALK_TYPE_VER | 0x01) |
Definition at line 114 of file uavtalk_priv.h.
#define UAVTALK_TYPE_OBJ_TS (UAVTALK_TIMESTAMPED | UAVTALK_TYPE_OBJ) |
Definition at line 120 of file uavtalk_priv.h.
#define UAVTALK_TYPE_VER 0x20 |
Definition at line 111 of file uavtalk_priv.h.
#define UAVTALK_WAITFOREVER -1 |
Definition at line 107 of file uavtalk_priv.h.
typedef uint8_t uavtalk_checksum |
Definition at line 68 of file uavtalk_priv.h.
typedef void(* UAVTalkAckCb)(void *ctx, uint32_t obj_id, uint16_t inst_id) |
typedef void* UAVTalkConnection |
typedef void(* UAVTalkReqCb)(void *ctx, uint32_t obj_id, uint16_t inst_id) |
enum UAVTalkRxState |
struct filereq_data __attribute__ | ( | (packed) | ) |
Definition at line 38 of file serial_4way.h.
|
static |
|
static |
Execute the requested transaction on an object.
[in] | connection | UAVTalkConnection to be used |
[in] | obj | Object |
[in] | instId | The instance ID of UAVOBJ_ALL_INSTANCES for all instances. |
[in] | type | Transaction type UAVTALK_TYPE_OBJ: send object, UAVTALK_TYPE_OBJ_REQ: request object update UAVTALK_TYPE_OBJ_ACK: send object with an ack |
|
static |
Receive an object. This function process objects received through the telemetry stream.
[in] | connection | UAVTalkConnection to be used |
[in] | type | Type of received message (UAVTALK_TYPE_OBJ, UAVTALK_TYPE_OBJ_REQ, UAVTALK_TYPE_OBJ_ACK, UAVTALK_TYPE_ACK, UAVTALK_TYPE_NACK) |
[in] | objId | ID of the object to work on |
[in] | instId | The instance ID of UAVOBJ_ALL_INSTANCES for all instances. |
[in] | data | Data buffer |
[in] | length | Buffer length |
|
static |
|
static |
|
static |
Send an object through the telemetry link.
[in] | connection | UAVTalkConnection to be used |
[in] | obj | Object handle to send |
[in] | instId | The instance ID (can NOT be UAVOBJ_ALL_INSTANCES, use sendObject() instead) |
[in] | type | Transaction type |
uint32_t UAVTalkGetPacketInstId | ( | UAVTalkConnection | connectionHandle | ) |
uint32_t UAVTalkGetPacketObjId | ( | UAVTalkConnection | connectionHandle | ) |
void UAVTalkGetStats | ( | UAVTalkConnection | connectionHandle, |
UAVTalkStats * | statsOut | ||
) |
UAVTalkConnection UAVTalkInitialize | ( | void * | ctx, |
UAVTalkOutputCb | outputStream, | ||
UAVTalkAckCb | ackCallback, | ||
UAVTalkReqCb | reqCallback, | ||
UAVTalkFileCb | fileCallback | ||
) |
Initialize the UAVTalk library
[in] | connection | UAVTalkConnection to be used |
[in] | outputStream | Function pointer that is called to send a data buffer |
[in] | ackCallback | A function to invoke when receiving an ack ] fileCallback A function which provides file data upon demand |
void UAVTalkProcessInputStream | ( | UAVTalkConnection | connectionHandle, |
uint8_t * | rxbytes, | ||
int | numbytes | ||
) |
UAVTalkRxState UAVTalkProcessInputStreamQuiet | ( | UAVTalkConnection | connectionHandle, |
uint8_t | rxbyte | ||
) |
int32_t UAVTalkReceiveObject | ( | UAVTalkConnection | connectionHandle | ) |
int32_t UAVTalkRelayPacket | ( | UAVTalkConnection | inConnectionHandle, |
UAVTalkConnection | outConnectionHandle | ||
) |
Send a parsed packet received on one connection handle out on a different connection handle. The packet must be in a complete state, meaning it is completed parsing. The packet is re-assembled from the component parts into a complete message and sent. This can be used to relay packets from one UAVTalk connection to another.
[in] | connection | UAVTalkConnection to be used |
[in] | rxbyte | Received byte |
int32_t UAVTalkSendNack | ( | UAVTalkConnection | connectionHandle, |
uint32_t | objId, | ||
uint16_t | instId | ||
) |
int32_t UAVTalkSendObject | ( | UAVTalkConnection | connectionHandle, |
UAVObjHandle | obj, | ||
uint16_t | instId, | ||
uint8_t | acked | ||
) |
Send the specified object through the telemetry link.
[in] | connection | UAVTalkConnection to be used |
[in] | obj | Object to send |
[in] | instId | The instance ID or UAVOBJ_ALL_INSTANCES for all instances. |
[in] | acked | True if an ack is requested |
int32_t UAVTalkSendObjectTimestamped | ( | UAVTalkConnection | connectionHandle, |
UAVObjHandle | obj, | ||
uint16_t | instId | ||
) |
Send the specified object through the telemetry link with a timestamp.
[in] | connection | UAVTalkConnection to be used |
[in] | obj | Object to send |
[in] | instId | The instance ID or UAVOBJ_ALL_INSTANCES for all instances. |
[in] | acked | Selects if an ack is required (1:ack required, 0: ack not required) |
[in] | timeoutMs | Time to wait for the ack, when zero it will return immediately |
struct UAVOMulti __attribute__ |
Definition at line 43 of file serial_4way.h.