30 #ifndef UAVTALK_PRIV_H
31 #define UAVTALK_PRIV_H
33 #include "uavobjectsinit.h"
46 #define UAVTALK_MIN_HEADER_LENGTH sizeof(uavtalk_min_header)
56 #define UAVTALK_MAX_HEADER_LENGTH sizeof(uavtalk_max_header)
69 #define UAVTALK_CHECKSUM_LENGTH sizeof(uavtalk_checksum)
70 #define UAVTALK_MAX_PAYLOAD_LENGTH (UAVOBJECTS_LARGEST + 1)
71 #define UAVTALK_MIN_PACKET_LENGTH UAVTALK_MAX_HEADER_LENGTH + UAVTALK_CHECKSUM_LENGTH
72 #define UAVTALK_MAX_PACKET_LENGTH UAVTALK_MIN_PACKET_LENGTH + UAVTALK_MAX_PAYLOAD_LENGTH
106 #define UAVTALK_CANARI 0xCA
107 #define UAVTALK_WAITFOREVER -1
108 #define UAVTALK_NOWAIT 0
109 #define UAVTALK_SYNC_VAL 0x3C
110 #define UAVTALK_TYPE_MASK 0x70
111 #define UAVTALK_TYPE_VER 0x20
112 #define UAVTALK_TIMESTAMPED 0x80
113 #define UAVTALK_TYPE_OBJ (UAVTALK_TYPE_VER | 0x00)
114 #define UAVTALK_TYPE_OBJ_REQ (UAVTALK_TYPE_VER | 0x01)
115 #define UAVTALK_TYPE_OBJ_ACK (UAVTALK_TYPE_VER | 0x02)
116 #define UAVTALK_TYPE_ACK (UAVTALK_TYPE_VER | 0x03)
117 #define UAVTALK_TYPE_NACK (UAVTALK_TYPE_VER | 0x04)
118 #define UAVTALK_TYPE_FILEREQ (UAVTALK_TYPE_VER | 0x08)
119 #define UAVTALK_TYPE_FILEDATA (UAVTALK_TYPE_VER | 0x09)
120 #define UAVTALK_TYPE_OBJ_TS (UAVTALK_TIMESTAMPED | UAVTALK_TYPE_OBJ)
122 #define UAVTALK_FILEDATA_EOF 0x01
123 #define UAVTALK_FILEDATA_LAST 0x02
126 #define CHECKCONHANDLE(handle,variable,failcommand) \
127 variable = (UAVTalkConnectionData*) handle; \
128 if (variable == NULL || variable->canari != UAVTALK_CANARI) { \
int32_t(* UAVTalkOutputCb)(void *ctx, uint8_t *data, int32_t length)
void(* UAVTalkAckCb)(void *ctx, uint32_t obj_id, uint16_t inst_id)
UAVTalkInputProcessor iproc
void(* UAVTalkReqCb)(void *ctx, uint32_t obj_id, uint16_t inst_id)
int32_t(* UAVTalkFileCb)(void *ctx, uint8_t *buf, uint32_t file_id, uint32_t offset, uint32_t len)
struct pios_recursive_mutex * lock
Tracking statistics for a UAVTalk connection.
Information for the physical link.