#pragma once #include #include #include #define VKWEIGHER_WEIGHERSTATUS_MAX_SIZE 35 #define VKWEIGHER_WEIGHERSTATUS_SIGNATURE (0x5B77380AAF093557ULL) #define VKWEIGHER_WEIGHERSTATUS_ID 52000 #if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS) class vkweigher_WeigherStatus_cxx_iface; #endif struct vkweigher_WeigherStatus { #if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS) using cxx_iface = vkweigher_WeigherStatus_cxx_iface; #endif uint32_t weight; uint16_t rate; uint8_t status; int16_t gx; int16_t gy; int16_t gz; int16_t ax; int16_t ay; int16_t az; float Q[4]; }; #ifdef __cplusplus extern "C" { #endif uint32_t vkweigher_WeigherStatus_encode(struct vkweigher_WeigherStatus* msg, uint8_t* buffer #if CANARD_ENABLE_TAO_OPTION , bool tao #endif ); bool vkweigher_WeigherStatus_decode(const CanardRxTransfer* transfer, struct vkweigher_WeigherStatus* msg); #if defined(CANARD_DSDLC_INTERNAL) static inline void _vkweigher_WeigherStatus_encode(uint8_t* buffer, uint32_t* bit_ofs, struct vkweigher_WeigherStatus* msg, bool tao); static inline bool _vkweigher_WeigherStatus_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct vkweigher_WeigherStatus* msg, bool tao); void _vkweigher_WeigherStatus_encode(uint8_t* buffer, uint32_t* bit_ofs, struct vkweigher_WeigherStatus* msg, bool tao) { (void)buffer; (void)bit_ofs; (void)msg; (void)tao; canardEncodeScalar(buffer, *bit_ofs, 32, &msg->weight); *bit_ofs += 32; canardEncodeScalar(buffer, *bit_ofs, 16, &msg->rate); *bit_ofs += 16; canardEncodeScalar(buffer, *bit_ofs, 8, &msg->status); *bit_ofs += 8; canardEncodeScalar(buffer, *bit_ofs, 16, &msg->gx); *bit_ofs += 16; canardEncodeScalar(buffer, *bit_ofs, 16, &msg->gy); *bit_ofs += 16; canardEncodeScalar(buffer, *bit_ofs, 16, &msg->gz); *bit_ofs += 16; canardEncodeScalar(buffer, *bit_ofs, 16, &msg->ax); *bit_ofs += 16; canardEncodeScalar(buffer, *bit_ofs, 16, &msg->ay); *bit_ofs += 16; canardEncodeScalar(buffer, *bit_ofs, 16, &msg->az); *bit_ofs += 16; for (size_t i=0; i < 4; i++) { canardEncodeScalar(buffer, *bit_ofs, 32, &msg->Q[i]); *bit_ofs += 32; } } /* decode vkweigher_WeigherStatus, return true on failure, false on success */ bool _vkweigher_WeigherStatus_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct vkweigher_WeigherStatus* msg, bool tao) { (void)transfer; (void)bit_ofs; (void)msg; (void)tao; canardDecodeScalar(transfer, *bit_ofs, 32, false, &msg->weight); *bit_ofs += 32; canardDecodeScalar(transfer, *bit_ofs, 16, false, &msg->rate); *bit_ofs += 16; canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->status); *bit_ofs += 8; canardDecodeScalar(transfer, *bit_ofs, 16, true, &msg->gx); *bit_ofs += 16; canardDecodeScalar(transfer, *bit_ofs, 16, true, &msg->gy); *bit_ofs += 16; canardDecodeScalar(transfer, *bit_ofs, 16, true, &msg->gz); *bit_ofs += 16; canardDecodeScalar(transfer, *bit_ofs, 16, true, &msg->ax); *bit_ofs += 16; canardDecodeScalar(transfer, *bit_ofs, 16, true, &msg->ay); *bit_ofs += 16; canardDecodeScalar(transfer, *bit_ofs, 16, true, &msg->az); *bit_ofs += 16; for (size_t i=0; i < 4; i++) { canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->Q[i]); *bit_ofs += 32; } return false; /* success */ } #endif #ifdef CANARD_DSDLC_TEST_BUILD struct vkweigher_WeigherStatus sample_vkweigher_WeigherStatus_msg(void); #endif #ifdef __cplusplus } // extern "C" #ifdef DRONECAN_CXX_WRAPPERS #include BROADCAST_MESSAGE_CXX_IFACE(vkweigher_WeigherStatus, VKWEIGHER_WEIGHERSTATUS_ID, VKWEIGHER_WEIGHERSTATUS_SIGNATURE, VKWEIGHER_WEIGHERSTATUS_MAX_SIZE); #endif #endif