diff options
Diffstat (limited to 'mavlink/include/mavlink/v1.0/common/mavlink_msg_param_value.h')
-rw-r--r-- | mavlink/include/mavlink/v1.0/common/mavlink_msg_param_value.h | 43 |
1 files changed, 31 insertions, 12 deletions
diff --git a/mavlink/include/mavlink/v1.0/common/mavlink_msg_param_value.h b/mavlink/include/mavlink/v1.0/common/mavlink_msg_param_value.h index 03a631984..599139374 100644 --- a/mavlink/include/mavlink/v1.0/common/mavlink_msg_param_value.h +++ b/mavlink/include/mavlink/v1.0/common/mavlink_msg_param_value.h @@ -14,6 +14,9 @@ typedef struct __mavlink_param_value_t #define MAVLINK_MSG_ID_PARAM_VALUE_LEN 25 #define MAVLINK_MSG_ID_22_LEN 25 +#define MAVLINK_MSG_ID_PARAM_VALUE_CRC 220 +#define MAVLINK_MSG_ID_22_CRC 220 + #define MAVLINK_MSG_PARAM_VALUE_FIELD_PARAM_ID_LEN 16 #define MAVLINK_MESSAGE_INFO_PARAM_VALUE { \ @@ -45,13 +48,13 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; _mav_put_float(buf, 0, param_value); _mav_put_uint16_t(buf, 4, param_count); _mav_put_uint16_t(buf, 6, param_index); _mav_put_uint8_t(buf, 24, param_type); _mav_put_char_array(buf, 8, param_id, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #else mavlink_param_value_t packet; packet.param_value = param_value; @@ -59,11 +62,15 @@ static inline uint16_t mavlink_msg_param_value_pack(uint8_t system_id, uint8_t c packet.param_index = param_index; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; - return mavlink_finalize_message(msg, system_id, component_id, 25, 220); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); +#else + return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_VALUE_LEN); +#endif } /** @@ -84,13 +91,13 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint const char *param_id,float param_value,uint8_t param_type,uint16_t param_count,uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; _mav_put_float(buf, 0, param_value); _mav_put_uint16_t(buf, 4, param_count); _mav_put_uint16_t(buf, 6, param_index); _mav_put_uint8_t(buf, 24, param_type); _mav_put_char_array(buf, 8, param_id, 16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #else mavlink_param_value_t packet; packet.param_value = param_value; @@ -98,11 +105,15 @@ static inline uint16_t mavlink_msg_param_value_pack_chan(uint8_t system_id, uint packet.param_index = param_index; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); + memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); #endif msg->msgid = MAVLINK_MSG_ID_PARAM_VALUE; - return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 25, 220); +#if MAVLINK_CRC_EXTRA + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); +#else + return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_VALUE_LEN); +#endif } /** @@ -133,13 +144,17 @@ static inline uint16_t mavlink_msg_param_value_encode(uint8_t system_id, uint8_t static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const char *param_id, float param_value, uint8_t param_type, uint16_t param_count, uint16_t param_index) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS - char buf[25]; + char buf[MAVLINK_MSG_ID_PARAM_VALUE_LEN]; _mav_put_float(buf, 0, param_value); _mav_put_uint16_t(buf, 4, param_count); _mav_put_uint16_t(buf, 6, param_index); _mav_put_uint8_t(buf, 24, param_type); _mav_put_char_array(buf, 8, param_id, 16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, 25, 220); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, buf, MAVLINK_MSG_ID_PARAM_VALUE_LEN); +#endif #else mavlink_param_value_t packet; packet.param_value = param_value; @@ -147,7 +162,11 @@ static inline void mavlink_msg_param_value_send(mavlink_channel_t chan, const ch packet.param_index = param_index; packet.param_type = param_type; mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16); - _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, 25, 220); +#if MAVLINK_CRC_EXTRA + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN, MAVLINK_MSG_ID_PARAM_VALUE_CRC); +#else + _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_VALUE, (const char *)&packet, MAVLINK_MSG_ID_PARAM_VALUE_LEN); +#endif #endif } @@ -221,6 +240,6 @@ static inline void mavlink_msg_param_value_decode(const mavlink_message_t* msg, mavlink_msg_param_value_get_param_id(msg, param_value->param_id); param_value->param_type = mavlink_msg_param_value_get_param_type(msg); #else - memcpy(param_value, _MAV_PAYLOAD(msg), 25); + memcpy(param_value, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_PARAM_VALUE_LEN); #endif } |