|
|
@@ -1464,6 +1464,74 @@ static void mavlink_test_vkfly_tianqu_servo_status(uint8_t system_id, uint8_t co
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+static void mavlink_test_vk_adc_ext_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
|
|
+{
|
|
|
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
|
|
|
+ mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
|
|
|
+ if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_ADC_EXT_STATUS >= 256) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+#endif
|
|
|
+ mavlink_message_t msg;
|
|
|
+ uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
|
|
|
+ uint16_t i;
|
|
|
+ mavlink_vk_adc_ext_status_t packet_in = {
|
|
|
+ 963497464,45.0,73.0,101.0,129.0,157.0,77,144,211,22
|
|
|
+ };
|
|
|
+ mavlink_vk_adc_ext_status_t packet1, packet2;
|
|
|
+ memset(&packet1, 0, sizeof(packet1));
|
|
|
+ packet1.time_boot_ms = packet_in.time_boot_ms;
|
|
|
+ packet1.raw_voltage = packet_in.raw_voltage;
|
|
|
+ packet1.voltage_ratio = packet_in.voltage_ratio;
|
|
|
+ packet1.voltage = packet_in.voltage;
|
|
|
+ packet1.current = packet_in.current;
|
|
|
+ packet1.fuel_percent = packet_in.fuel_percent;
|
|
|
+ packet1.type = packet_in.type;
|
|
|
+ packet1.valid = packet_in.valid;
|
|
|
+ packet1.fuel_low1 = packet_in.fuel_low1;
|
|
|
+ packet1.fuel_low2 = packet_in.fuel_low2;
|
|
|
+
|
|
|
+
|
|
|
+#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
|
|
|
+ if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
|
|
|
+ // cope with extensions
|
|
|
+ memset(MAVLINK_MSG_ID_VK_ADC_EXT_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_ADC_EXT_STATUS_MIN_LEN);
|
|
|
+ }
|
|
|
+#endif
|
|
|
+ memset(&packet2, 0, sizeof(packet2));
|
|
|
+ mavlink_msg_vk_adc_ext_status_encode(system_id, component_id, &msg, &packet1);
|
|
|
+ mavlink_msg_vk_adc_ext_status_decode(&msg, &packet2);
|
|
|
+ MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
|
|
+
|
|
|
+ memset(&packet2, 0, sizeof(packet2));
|
|
|
+ mavlink_msg_vk_adc_ext_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.type , packet1.valid , packet1.raw_voltage , packet1.voltage_ratio , packet1.voltage , packet1.current , packet1.fuel_percent , packet1.fuel_low1 , packet1.fuel_low2 );
|
|
|
+ mavlink_msg_vk_adc_ext_status_decode(&msg, &packet2);
|
|
|
+ MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
|
|
+
|
|
|
+ memset(&packet2, 0, sizeof(packet2));
|
|
|
+ mavlink_msg_vk_adc_ext_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.type , packet1.valid , packet1.raw_voltage , packet1.voltage_ratio , packet1.voltage , packet1.current , packet1.fuel_percent , packet1.fuel_low1 , packet1.fuel_low2 );
|
|
|
+ mavlink_msg_vk_adc_ext_status_decode(&msg, &packet2);
|
|
|
+ MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
|
|
+
|
|
|
+ memset(&packet2, 0, sizeof(packet2));
|
|
|
+ mavlink_msg_to_send_buffer(buffer, &msg);
|
|
|
+ for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
|
|
|
+ comm_send_ch(MAVLINK_COMM_0, buffer[i]);
|
|
|
+ }
|
|
|
+ mavlink_msg_vk_adc_ext_status_decode(last_msg, &packet2);
|
|
|
+ MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
|
|
+
|
|
|
+ memset(&packet2, 0, sizeof(packet2));
|
|
|
+ mavlink_msg_vk_adc_ext_status_send(MAVLINK_COMM_1 , packet1.time_boot_ms , packet1.type , packet1.valid , packet1.raw_voltage , packet1.voltage_ratio , packet1.voltage , packet1.current , packet1.fuel_percent , packet1.fuel_low1 , packet1.fuel_low2 );
|
|
|
+ mavlink_msg_vk_adc_ext_status_decode(last_msg, &packet2);
|
|
|
+ MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
|
|
|
+
|
|
|
+#ifdef MAVLINK_HAVE_GET_MESSAGE_INFO
|
|
|
+ MAVLINK_ASSERT(mavlink_get_message_info_by_name("VK_ADC_EXT_STATUS") != NULL);
|
|
|
+ MAVLINK_ASSERT(mavlink_get_message_info_by_id(MAVLINK_MSG_ID_VK_ADC_EXT_STATUS) != NULL);
|
|
|
+#endif
|
|
|
+}
|
|
|
+
|
|
|
static void mavlink_test_vk_fw_update_begin(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
|
|
|
{
|
|
|
#ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
|
|
|
@@ -2083,6 +2151,7 @@ static void mavlink_test_VKFly(uint8_t system_id, uint8_t component_id, mavlink_
|
|
|
mavlink_test_vkfly_edu_status(system_id, component_id, last_msg);
|
|
|
mavlink_test_vkfly_edu_status_ack(system_id, component_id, last_msg);
|
|
|
mavlink_test_vkfly_tianqu_servo_status(system_id, component_id, last_msg);
|
|
|
+ mavlink_test_vk_adc_ext_status(system_id, component_id, last_msg);
|
|
|
mavlink_test_vk_fw_update_begin(system_id, component_id, last_msg);
|
|
|
mavlink_test_vk_fw_update_ack(system_id, component_id, last_msg);
|
|
|
mavlink_test_vk_fw_update_data_request(system_id, component_id, last_msg);
|