8 #define CHECKSIZE(s) static_assert(sizeof(s) <= CRTP_MAXSIZE, #s " packet is too large"); 9 #define CHECKSIZE_WITH_STATE(s, stateSize) static_assert(sizeof(s) - stateSize <= CRTP_MAXSIZE, #s " packet is too large"); 12 #define CHECKSIZE_RESPONSE(s) static_assert(sizeof(s) <= CRTP_MAXSIZE_RESPONSE, #s " packet is too large"); 56 const uint8_t
cmd = 0xFF;
63 return crtp(response.data[0]) ==
crtp(0, 0);
110 return response.size > 5 &&
111 crtp(response.data[0]) ==
crtp(2, 0) &&
112 response.data[1] == 0;
135 bool operator==(
const crtpParamTocGetInfoRequest& other)
const {
139 typedef crtpParamTocGetInfoResponse
Response;
149 return response.size == 7 &&
150 crtp(response.data[0]) ==
crtp(2, 0) &&
151 response.data[1] == 1;
160 struct crtpParamValueResponse;
170 bool operator==(
const crtpParamReadRequest& other)
const {
174 typedef crtpParamValueResponse
Response;
199 struct crtpParamValueResponse
202 return response.size > 2 &&
203 (
crtp(response.data[0]) ==
crtp(2, 1) ||
204 crtp(response.data[0]) ==
crtp(2, 2));
211 uint16_t valueUint16;
213 uint32_t valueUint32;
232 bool operator==(
const crtpParamTocGetItemV2Request& other)
const {
247 return response.size > 5 &&
248 crtp(response.data[0]) ==
crtp(2, 0) &&
249 response.data[1] == 2;
286 return response.size == 8 &&
287 crtp(response.data[0]) ==
crtp(2, 0) &&
288 response.data[1] == 3;
297 struct crtpParamValueV2Response;
311 typedef crtpParamValueV2Response
Response;
336 struct crtpParamValueV2Response
339 return response.size > 2 &&
340 (
crtp(response.data[0]) ==
crtp(2, 1) ||
341 crtp(response.data[0]) ==
crtp(2, 2));
349 uint16_t valueUint16;
351 uint32_t valueUint32;
367 const uint8_t
cmd = 0;
370 uint8_t
size()
const {
393 struct crtpParamSetByNameResponse
396 return response.size > 2 &&
397 (
crtp(response.data[0]) ==
crtp(2, 3));
412 struct crtpSetpointRequest
451 return response.size == 3 &&
453 response.data[1] == 1;
487 return response.size > 2 &&
488 crtp(response.data[0]) ==
crtp(4, 0) &&
489 response.data[1] == 2;
521 return response.size > 2 &&
522 crtp(response.data[0]) ==
crtp(4, 1);
553 return response.size > 2 &&
554 crtp(response.data[0]) ==
crtp(4, 2);
589 return response.size == 9 &&
590 crtp(response.data[0]) ==
crtp(5, 0) &&
591 response.data[1] == 1;
631 return response.size > 5 &&
632 crtp(response.data[0]) ==
crtp(5, 0) &&
633 response.data[1] == 0;
750 return response.size == 4 &&
751 crtp(response.data[0]) ==
crtp(5, 1);
764 return response.size > 4 &&
765 crtp(response.data[0]) ==
crtp(5, 2);
800 return response.size == 10 &&
801 crtp(response.data[0]) ==
crtp(5, 0) &&
802 response.data[1] == 3;
842 return response.size > 6 &&
843 crtp(response.data[0]) ==
crtp(5, 0) &&
844 response.data[1] == 2;
932 const uint8_t
type = 3;
943 const uint8_t
type = 4;
968 const uint8_t
type = 8;
986 const uint8_t
type = 9;
1042 float x,
float y,
float z,
1043 float vx,
float vy,
float vz,
1044 float ax,
float ay,
float az,
1045 float qx,
float qy,
float qz,
float qw,
1046 float rollRate,
float pitchRate,
float yawRate);
1101 , groupMask(groupMask)
1119 , groupMask(groupMask)
1121 , duration(duration)
1284 const uint8_t
cmd = 0;
1303 const uint8_t
cmd = 1;
1322 const uint8_t
cmd = 2;
1337 return crtp(response.data[0]) ==
crtp(15, 3);
crtpLogStopRequest(uint8_t id)
crtpHoverSetpointRequest(float vx, float vy, float yawrate, float zDistance)
crtpCommanderHighLevelSetGroupMaskRequest(uint8_t groupMask)
static int const CRTP_MAXSIZE_RESPONSE
crtpParamWriteRequest(uint8_t id, const T &value)
crtpMemoryWriteRequest(uint8_t memId, uint32_t memAddr)
crtpCommanderHighLevelStopRequest(uint8_t groupMask)
crtpLogGetInfoV2Request()
crtpParamWriteV2Request(uint16_t id, const T &value)
crtpParamReadRequest(uint8_t id)
uint32_t remainValidMillisecs
crtpGetDeviceTypeNameRequest()
crtpMemoryGetNumberRequest()
crtpParamTocGetItemRequest request
crtpNotifySetpointsStopRequest(uint32_t remainValidMillisecs)
crtpParamTocGetItemResponse Response
crtpLogCreateBlockV2Request()
crtpGetFirmwareVersionRequest()
crtpCommanderHighLevelLandRequest(uint8_t groupMask, float height, float duration)
crtpFullStateSetpointRequest(float x, float y, float z, float vx, float vy, float vz, float ax, float ay, float az, float qx, float qy, float qz, float qw, float rollRate, float pitchRate, float yawRate)
#define CHECKSIZE_WITH_STATE(s, stateSize)
#define CHECKSIZE_RESPONSE(s)
crtpExternalPositionUpdate(float x, float y, float z)
crtpEmergencyStopWatchdogRequest()
crtpGetProtocolVersionRequest()
crtpParamSetByNameRequest(const char *group, const char *name, const T &value)
constexpr crtp(uint8_t port, uint8_t channel)
crtpCommanderHighLevelTakeoffRequest(uint8_t groupMask, float height, float duration)
crtpPositionSetpointRequest(float x, float y, float z, float yaw)
static bool match(const Crazyradio::Ack &response)
crtpExternalPositionPacked()
void quatdecompress(uint32_t comp, float q[4])
crtpLogCreateBlockRequest()
crtpMemoryGetInfoRequest(uint8_t memId)
union @10 trajectoryIdentifier
uint8_t responseSize() const
crtpLogStartRequest(uint8_t id, uint8_t period)
crtpExternalPoseUpdate(float x, float y, float z, float qx, float qy, float qz, float qw)
crtpParamReadV2Request(uint16_t id)
uint8_t trajectoryLocation
crtpVelocityWorldSetpointRequest(float x, float y, float z, float yawRate)
crtpParamTocGetItemRequest(uint8_t id)
crtpLogGetItemRequest(uint8_t id)
crtpParamTocGetInfoRequest()
crtpEmergencyStopRequest()
static int const CRTP_MAX_DATA_SIZE
bool operator==(const crtp &other) const
static int const CRTP_MAXSIZE
crtpCommanderHighLevelGoToRequest(uint8_t groupMask, bool relative, float x, float y, float z, float yaw, float duration)
crtpCommanderHighLevelStartTrajectoryRequest(uint8_t groupMask, bool relative, bool reversed, uint8_t trajectoryId, float timescale)
crtpMemoryReadRequest(uint8_t memId, uint32_t memAddr, uint8_t length)
crtpLogGetItemV2Request(uint16_t id)
crtpLogAppendBlockV2Request()
crtpParamTocGetItemV2Request(uint16_t id)
crtpParamTocGetInfoV2Request()
crtpCommanderHighLevelDefineTrajectoryRequest(uint8_t trajectoryId)