/* * UAVCAN data structure definition for libcanard. * * Autogenerated, do not edit. * * Source file: /Users/jaime/Developer/ardupilot/modules/uavcan/dsdl/uavcan/protocol/param/Value.uavcan */ #ifndef __UAVCAN_PROTOCOL_PARAM_VALUE #define __UAVCAN_PROTOCOL_PARAM_VALUE #include #include "canard.h" #ifdef __cplusplus extern "C" { #endif #include /******************************* Source text ********************************** # # Single parameter value. # # This is a union, which means that this structure can contain either one of the fields below. # The structure is prefixed with tag - a selector value that indicates which particular field is encoded. # @union # Tag is 3 bit long, so outer structure has 5-bit prefix to ensure proper alignment Empty empty # Empty field, used to represent an undefined value. int64 integer_value float32 real_value # 32-bit type is used to simplify implementation on low-end systems uint8 boolean_value # 8-bit value is used for alignment reasons uint8[<=128] string_value # Length prefix is exactly one byte long, which ensures proper alignment of payload ******************************************************************************/ /********************* DSDL signature source definition *********************** uavcan.protocol.param.Value @union uavcan.protocol.param.Empty empty saturated int64 integer_value saturated float32 real_value saturated uint8 boolean_value saturated uint8[<=128] string_value ******************************************************************************/ #define UAVCAN_PROTOCOL_PARAM_VALUE_NAME "uavcan.protocol.param.Value" #define UAVCAN_PROTOCOL_PARAM_VALUE_SIGNATURE (0x29F14BF484727267ULL) #define UAVCAN_PROTOCOL_PARAM_VALUE_MAX_SIZE ((1035 + 7)/8) // Constants #define UAVCAN_PROTOCOL_PARAM_VALUE_STRING_VALUE_MAX_LENGTH 128 typedef enum { UAVCAN_PROTOCOL_PARAM_VALUE_EMPTY, UAVCAN_PROTOCOL_PARAM_VALUE_INTEGER_VALUE, UAVCAN_PROTOCOL_PARAM_VALUE_REAL_VALUE, UAVCAN_PROTOCOL_PARAM_VALUE_BOOLEAN_VALUE, UAVCAN_PROTOCOL_PARAM_VALUE_STRING_VALUE } uavcan_protocol_param_Value_ENUM; typedef struct { uavcan_protocol_param_Value_ENUM union_tag; // union_tag indicates what field the data structure is holding union { // FieldTypes uavcan_protocol_param_Empty empty; // int64_t integer_value; // bit len 64 float real_value; // float32 Saturate uint8_t boolean_value; // bit len 8 struct { uint8_t len; // Dynamic array length uint8_t* data; // Dynamic Array 8bit[128] max items } string_value; }; } uavcan_protocol_param_Value; extern uint32_t uavcan_protocol_param_Value_encode(uavcan_protocol_param_Value* source, void* msg_buf); extern int32_t uavcan_protocol_param_Value_decode(const CanardRxTransfer* transfer, uint16_t payload_len, uavcan_protocol_param_Value* dest, uint8_t** dyn_arr_buf); extern uint32_t uavcan_protocol_param_Value_encode_internal(uavcan_protocol_param_Value* source, void* msg_buf, uint32_t offset, uint8_t root_item); extern int32_t uavcan_protocol_param_Value_decode_internal(const CanardRxTransfer* transfer, uint16_t payload_len, uavcan_protocol_param_Value* dest, uint8_t** dyn_arr_buf, int32_t offset); #ifdef __cplusplus } // extern "C" #endif #endif // __UAVCAN_PROTOCOL_PARAM_VALUE