/** @file * @brief MAVLink comm protocol testsuite generated from VKFly.xml * @see https://mavlink.io/en/ */ #pragma once #ifndef VKFLY_TESTSUITE_H #define VKFLY_TESTSUITE_H #ifdef __cplusplus extern "C" { #endif #ifndef MAVLINK_TEST_ALL #define MAVLINK_TEST_ALL static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg); static void mavlink_test_VKFly(uint8_t, uint8_t, mavlink_message_t *last_msg); static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg) { mavlink_test_common(system_id, component_id, last_msg); mavlink_test_VKFly(system_id, component_id, last_msg); } #endif #include "../common/testsuite.h" static void mavlink_test_vkins_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_VKINS_STATUS >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vkins_status_t packet_in = { 963497464,45.0,963497880,963498088,129.0,157.0,18483,211,22,89,156,223,34,101,168,235,46,113 }; mavlink_vkins_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.time_boot_ms = packet_in.time_boot_ms; packet1.g0 = packet_in.g0; packet1.raw_latitude = packet_in.raw_latitude; packet1.raw_longitude = packet_in.raw_longitude; packet1.baro_alt = packet_in.baro_alt; packet1.raw_gps_alt = packet_in.raw_gps_alt; packet1.temperature = packet_in.temperature; packet1.nav_status = packet_in.nav_status; packet1.s_flag1 = packet_in.s_flag1; packet1.s_flag2 = packet_in.s_flag2; packet1.s_flag3 = packet_in.s_flag3; packet1.s_flag4 = packet_in.s_flag4; packet1.s_flag5 = packet_in.s_flag5; packet1.s_flag6 = packet_in.s_flag6; packet1.mag_calib_stage = packet_in.mag_calib_stage; packet1.solv_psat_num = packet_in.solv_psat_num; packet1.solv_hsat_num = packet_in.solv_hsat_num; packet1.vibe_coe = packet_in.vibe_coe; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VKINS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VKINS_STATUS_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vkins_status_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vkins_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vkins_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.nav_status , packet1.s_flag1 , packet1.s_flag2 , packet1.s_flag3 , packet1.s_flag4 , packet1.s_flag5 , packet1.s_flag6 , packet1.mag_calib_stage , packet1.g0 , packet1.raw_latitude , packet1.raw_longitude , packet1.baro_alt , packet1.raw_gps_alt , packet1.solv_psat_num , packet1.solv_hsat_num , packet1.temperature , packet1.vibe_coe ); mavlink_msg_vkins_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vkins_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.nav_status , packet1.s_flag1 , packet1.s_flag2 , packet1.s_flag3 , packet1.s_flag4 , packet1.s_flag5 , packet1.s_flag6 , packet1.mag_calib_stage , packet1.g0 , packet1.raw_latitude , packet1.raw_longitude , packet1.baro_alt , packet1.raw_gps_alt , packet1.solv_psat_num , packet1.solv_hsat_num , packet1.temperature , packet1.vibe_coe ); mavlink_msg_vkins_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VKFMU_STATUS >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vkfmu_status_t packet_in = { 963497464,963497672,963497880,101.0,18067,18171,18275,199,10,77 }; mavlink_vkfmu_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.time_boot_ms = packet_in.time_boot_ms; packet1.flight_time = packet_in.flight_time; packet1.dist_to_tar = packet_in.dist_to_tar; packet1.flight_dist = packet_in.flight_dist; packet1.ups_volt = packet_in.ups_volt; packet1.adc_volt = packet_in.adc_volt; packet1.servo_state = packet_in.servo_state; packet1.rtl_reason = packet_in.rtl_reason; packet1.loiter_reason = packet_in.loiter_reason; packet1.s_flag3 = packet_in.s_flag3; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VKFMU_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VKFMU_STATUS_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vkfmu_status_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vkfmu_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vkfmu_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.rtl_reason , packet1.loiter_reason , packet1.s_flag3 , packet1.ups_volt , packet1.adc_volt , packet1.flight_time , packet1.dist_to_tar , packet1.servo_state , packet1.flight_dist ); mavlink_msg_vkfmu_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vkfmu_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.rtl_reason , packet1.loiter_reason , packet1.s_flag3 , packet1.ups_volt , packet1.adc_volt , packet1.flight_time , packet1.dist_to_tar , packet1.servo_state , packet1.flight_dist ); mavlink_msg_vkfmu_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_ROI_TARGET >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_roi_target_t packet_in = { 963497464,963497672,963497880,101.0,18067 }; mavlink_vk_roi_target_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.time_boot_ms = packet_in.time_boot_ms; packet1.lat = packet_in.lat; packet1.lon = packet_in.lon; packet1.alt = packet_in.alt; packet1.state = packet_in.state; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_ROI_TARGET_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_ROI_TARGET_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_roi_target_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_roi_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_roi_target_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.state ); mavlink_msg_vk_roi_target_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_roi_target_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.lat , packet1.lon , packet1.alt , packet1.state ); mavlink_msg_vk_roi_target_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_BMS_STATUS >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_bms_status_t packet_in = { 963497464,963497672,963497880,17859,17963,18067,{ 18171, 18172, 18173, 18174, 18175, 18176, 18177, 18178, 18179, 18180, 18181, 18182, 18183, 18184, 18185, 18186, 18187, 18188, 18189, 18190, 18191, 18192, 18193, 18194, 18195, 18196, 18197, 18198, 18199, 18200 },21291,245,56,123 }; mavlink_vk_bms_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.time_boot_ms = packet_in.time_boot_ms; packet1.voltage = packet_in.voltage; packet1.err_code = packet_in.err_code; packet1.current = packet_in.current; packet1.temperature = packet_in.temperature; packet1.cell_num = packet_in.cell_num; packet1.cyc_cnt = packet_in.cyc_cnt; packet1.cap_percent = packet_in.cap_percent; packet1.bat_id = packet_in.bat_id; packet1.health = packet_in.health; mav_array_memcpy(packet1.cell_volt, packet_in.cell_volt, sizeof(uint16_t)*30); #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_BMS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_BMS_STATUS_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_bms_status_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_bms_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_bms_status_pack(system_id, component_id, &msg , packet1.time_boot_ms , packet1.voltage , packet1.current , packet1.temperature , packet1.cap_percent , packet1.bat_id , packet1.err_code , packet1.cell_num , packet1.cell_volt , packet1.cyc_cnt , packet1.health ); mavlink_msg_vk_bms_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_bms_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_boot_ms , packet1.voltage , packet1.current , packet1.temperature , packet1.cap_percent , packet1.bat_id , packet1.err_code , packet1.cell_num , packet1.cell_volt , packet1.cyc_cnt , packet1.health ); mavlink_msg_vk_bms_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_FORMATION_LEADER >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_formation_leader_t packet_in = { 963497464,963497672,963497880,963498088,129.0,157.0,185.0,213.0,241.0,19107,19211,19315,19419,137 }; mavlink_vk_formation_leader_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.timestamp = packet_in.timestamp; packet1.state = packet_in.state; packet1.lat = packet_in.lat; packet1.lon = packet_in.lon; packet1.msl = packet_in.msl; packet1.ve = packet_in.ve; packet1.vn = packet_in.vn; packet1.vu = packet_in.vu; packet1.yaw = packet_in.yaw; packet1.x_dist = packet_in.x_dist; packet1.y_dist = packet_in.y_dist; packet1.z_dist = packet_in.z_dist; packet1.rect_col_num = packet_in.rect_col_num; packet1.formation_type = packet_in.formation_type; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_FORMATION_LEADER_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_FORMATION_LEADER_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_formation_leader_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_formation_leader_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_formation_leader_pack(system_id, component_id, &msg , packet1.timestamp , packet1.state , packet1.lat , packet1.lon , packet1.msl , packet1.ve , packet1.vn , packet1.vu , packet1.yaw , packet1.formation_type , packet1.x_dist , packet1.y_dist , packet1.z_dist , packet1.rect_col_num ); mavlink_msg_vk_formation_leader_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_formation_leader_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.state , packet1.lat , packet1.lon , packet1.msl , packet1.ve , packet1.vn , packet1.vu , packet1.yaw , packet1.formation_type , packet1.x_dist , packet1.y_dist , packet1.z_dist , packet1.rect_col_num ); mavlink_msg_vk_formation_leader_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_ENGINE_ECU_STAUS >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_engine_ecu_staus_t packet_in = { 963497464,963497672,17651,17755,17859,17963,18067,18171,18275,18379,18483,18587,89,156,223,34,101,{ 168, 169, 170, 171 } }; mavlink_vk_engine_ecu_staus_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.timestamp = packet_in.timestamp; packet1.total_runtime = packet_in.total_runtime; packet1.spd_rpm = packet_in.spd_rpm; packet1.cylinderA_temp = packet_in.cylinderA_temp; packet1.cylinderB_temp = packet_in.cylinderB_temp; packet1.coolant_temp = packet_in.coolant_temp; packet1.fuel_remain = packet_in.fuel_remain; packet1.alarm = packet_in.alarm; packet1.runtime = packet_in.runtime; packet1.service_time = packet_in.service_time; packet1.output_volt = packet_in.output_volt; packet1.output_curr = packet_in.output_curr; packet1.thr_pos = packet_in.thr_pos; packet1.fuel_pos = packet_in.fuel_pos; packet1.fault = packet_in.fault; packet1.engine_state = packet_in.engine_state; packet1.index = packet_in.index; mav_array_memcpy(packet1.reserve, packet_in.reserve, sizeof(uint8_t)*4); #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_ENGINE_ECU_STAUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_ENGINE_ECU_STAUS_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_engine_ecu_staus_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_engine_ecu_staus_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_engine_ecu_staus_pack(system_id, component_id, &msg , packet1.timestamp , packet1.spd_rpm , packet1.thr_pos , packet1.fuel_pos , packet1.cylinderA_temp , packet1.cylinderB_temp , packet1.coolant_temp , packet1.fuel_remain , packet1.alarm , packet1.total_runtime , packet1.runtime , packet1.service_time , packet1.output_volt , packet1.output_curr , packet1.fault , packet1.engine_state , packet1.index , packet1.reserve ); mavlink_msg_vk_engine_ecu_staus_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_engine_ecu_staus_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.spd_rpm , packet1.thr_pos , packet1.fuel_pos , packet1.cylinderA_temp , packet1.cylinderB_temp , packet1.coolant_temp , packet1.fuel_remain , packet1.alarm , packet1.total_runtime , packet1.runtime , packet1.service_time , packet1.output_volt , packet1.output_curr , packet1.fault , packet1.engine_state , packet1.index , packet1.reserve ); mavlink_msg_vk_engine_ecu_staus_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_COMP_VERSION >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_comp_version_t packet_in = { 17235,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154 },{ 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202 },{ 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250 },{ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42 },{ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90 },{ 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138 } }; mavlink_vk_comp_version_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.comp_id = packet_in.comp_id; mav_array_memcpy(packet1.hw_ver, packet_in.hw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet1.fw_ver, packet_in.fw_ver, sizeof(uint8_t)*16); mav_array_memcpy(packet1.SN, packet_in.SN, sizeof(uint8_t)*16); mav_array_memcpy(packet1.manufactory, packet_in.manufactory, sizeof(uint8_t)*16); mav_array_memcpy(packet1.model, packet_in.model, sizeof(uint8_t)*16); mav_array_memcpy(packet1.priv_data, packet_in.priv_data, sizeof(uint8_t)*16); #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_COMP_VERSION_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_comp_version_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_comp_version_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_comp_version_pack(system_id, component_id, &msg , packet1.comp_id , packet1.hw_ver , packet1.fw_ver , packet1.SN , packet1.manufactory , packet1.model , packet1.priv_data ); mavlink_msg_vk_comp_version_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_comp_version_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.comp_id , packet1.hw_ver , packet1.fw_ver , packet1.SN , packet1.manufactory , packet1.model , packet1.priv_data ); mavlink_msg_vk_comp_version_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_MOSAICH_GPS_RAW >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_mosaich_gps_raw_t packet_in = { 93372036854775807ULL,963497880,963498088,129.0,157.0,185.0,213.0,241.0,269.0,19315,19419,137,204,15,82,149,216,27,94 }; mavlink_vk_mosaich_gps_raw_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.time_usec = packet_in.time_usec; packet1.lat = packet_in.lat; packet1.lon = packet_in.lon; packet1.ellipsoid_alt = packet_in.ellipsoid_alt; packet1.ve = packet_in.ve; packet1.vn = packet_in.vn; packet1.vu = packet_in.vu; packet1.yaw = packet_in.yaw; packet1.pitch = packet_in.pitch; packet1.h_acc = packet_in.h_acc; packet1.v_acc = packet_in.v_acc; packet1.fix_type = packet_in.fix_type; packet1.psv_num = packet_in.psv_num; packet1.pvt_err = packet_in.pvt_err; packet1.pvt_mode = packet_in.pvt_mode; packet1.hsv_num = packet_in.hsv_num; packet1.att_err = packet_in.att_err; packet1.att_mode = packet_in.att_mode; packet1.reserved = packet_in.reserved; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_MOSAICH_GPS_RAW_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_MOSAICH_GPS_RAW_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_mosaich_gps_raw_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_mosaich_gps_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_mosaich_gps_raw_pack(system_id, component_id, &msg , packet1.time_usec , packet1.fix_type , packet1.psv_num , packet1.pvt_err , packet1.pvt_mode , packet1.lat , packet1.lon , packet1.ellipsoid_alt , packet1.ve , packet1.vn , packet1.vu , packet1.h_acc , packet1.v_acc , packet1.yaw , packet1.pitch , packet1.hsv_num , packet1.att_err , packet1.att_mode , packet1.reserved ); mavlink_msg_vk_mosaich_gps_raw_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_mosaich_gps_raw_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.fix_type , packet1.psv_num , packet1.pvt_err , packet1.pvt_mode , packet1.lat , packet1.lon , packet1.ellipsoid_alt , packet1.ve , packet1.vn , packet1.vu , packet1.h_acc , packet1.v_acc , packet1.yaw , packet1.pitch , packet1.hsv_num , packet1.att_err , packet1.att_mode , packet1.reserved ); mavlink_msg_vk_mosaich_gps_raw_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_DIGI_ESC_STATUS >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_digi_esc_status_t packet_in = { 963497464,{ 963497672, 963497673, 963497674, 963497675 },{ 157.0, 158.0, 159.0, 160.0 },{ 269.0, 270.0, 271.0, 272.0 },{ 963500168, 963500169, 963500170, 963500171 },{ 20771, 20772, 20773, 20774 },233 }; mavlink_vk_digi_esc_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.timestamp = packet_in.timestamp; packet1.index = packet_in.index; mav_array_memcpy(packet1.rpm, packet_in.rpm, sizeof(int32_t)*4); mav_array_memcpy(packet1.voltage, packet_in.voltage, sizeof(float)*4); mav_array_memcpy(packet1.current, packet_in.current, sizeof(float)*4); mav_array_memcpy(packet1.status, packet_in.status, sizeof(uint32_t)*4); mav_array_memcpy(packet1.temperature, packet_in.temperature, sizeof(int16_t)*4); #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_DIGI_ESC_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_DIGI_ESC_STATUS_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_digi_esc_status_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_digi_esc_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_digi_esc_status_pack(system_id, component_id, &msg , packet1.index , packet1.timestamp , packet1.rpm , packet1.voltage , packet1.current , packet1.temperature , packet1.status ); mavlink_msg_vk_digi_esc_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_digi_esc_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.index , packet1.timestamp , packet1.rpm , packet1.voltage , packet1.current , packet1.temperature , packet1.status ); mavlink_msg_vk_digi_esc_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_FIXEDWING_CONTROL_VALUE >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_fixedwing_control_value_t packet_in = { 963497464,45.0,73.0,101.0,129.0 }; mavlink_vk_fixedwing_control_value_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.timestamp = packet_in.timestamp; packet1.roll_value = packet_in.roll_value; packet1.pitch_value = packet_in.pitch_value; packet1.throttle_value = packet_in.throttle_value; packet1.yaw_value = packet_in.yaw_value; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_FIXEDWING_CONTROL_VALUE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_FIXEDWING_CONTROL_VALUE_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fixedwing_control_value_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_fixedwing_control_value_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fixedwing_control_value_pack(system_id, component_id, &msg , packet1.timestamp , packet1.roll_value , packet1.pitch_value , packet1.throttle_value , packet1.yaw_value ); mavlink_msg_vk_fixedwing_control_value_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fixedwing_control_value_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.roll_value , packet1.pitch_value , packet1.throttle_value , packet1.yaw_value ); mavlink_msg_vk_fixedwing_control_value_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_FIXEDWING_SERVO_SIGNAL >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_fixedwing_servo_signal_t packet_in = { 963497464,{ 17443, 17444, 17445, 17446, 17447, 17448, 17449, 17450, 17451, 17452, 17453, 17454, 17455, 17456, 17457, 17458 } }; mavlink_vk_fixedwing_servo_signal_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.timestamp = packet_in.timestamp; mav_array_memcpy(packet1.servo_signal, packet_in.servo_signal, sizeof(uint16_t)*16); #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_FIXEDWING_SERVO_SIGNAL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_FIXEDWING_SERVO_SIGNAL_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fixedwing_servo_signal_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_fixedwing_servo_signal_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fixedwing_servo_signal_pack(system_id, component_id, &msg , packet1.timestamp , packet1.servo_signal ); mavlink_msg_vk_fixedwing_servo_signal_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fixedwing_servo_signal_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.servo_signal ); mavlink_msg_vk_fixedwing_servo_signal_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_FIXEDWING_RTL_CIRCLE_WP >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_fixedwing_rtl_circle_wp_t packet_in = { 963497464,963497672,73.0,101.0 }; mavlink_vk_fixedwing_rtl_circle_wp_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.latitude = packet_in.latitude; packet1.longitude = packet_in.longitude; packet1.altitude = packet_in.altitude; packet1.radius = packet_in.radius; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_FIXEDWING_RTL_CIRCLE_WP_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_FIXEDWING_RTL_CIRCLE_WP_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fixedwing_rtl_circle_wp_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_fixedwing_rtl_circle_wp_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fixedwing_rtl_circle_wp_pack(system_id, component_id, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.radius ); mavlink_msg_vk_fixedwing_rtl_circle_wp_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fixedwing_rtl_circle_wp_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.latitude , packet1.longitude , packet1.altitude , packet1.radius ); mavlink_msg_vk_fixedwing_rtl_circle_wp_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_PARACHUTE_STATUS >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_parachute_status_t packet_in = { 963497464,45.0,17651,163,230,41 }; mavlink_vk_parachute_status_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.timestamp = packet_in.timestamp; packet1.backvolt = packet_in.backvolt; packet1.err_code = packet_in.err_code; packet1.state = packet_in.state; packet1.auto_launch = packet_in.auto_launch; packet1.uav_cmd = packet_in.uav_cmd; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_PARACHUTE_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_PARACHUTE_STATUS_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_parachute_status_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_parachute_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_parachute_status_pack(system_id, component_id, &msg , packet1.timestamp , packet1.state , packet1.auto_launch , packet1.uav_cmd , packet1.err_code , packet1.backvolt ); mavlink_msg_vk_parachute_status_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_parachute_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.state , packet1.auto_launch , packet1.uav_cmd , packet1.err_code , packet1.backvolt ); mavlink_msg_vk_parachute_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_WEIGHER_STATE >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_weigher_state_t packet_in = { 963497464,963497672,17651,163,230 }; mavlink_vk_weigher_state_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.timestamp = packet_in.timestamp; packet1.weight = packet_in.weight; packet1.weight_d = packet_in.weight_d; packet1.work_state = packet_in.work_state; packet1.err_code = packet_in.err_code; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_WEIGHER_STATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_WEIGHER_STATE_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_weigher_state_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_weigher_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_weigher_state_pack(system_id, component_id, &msg , packet1.timestamp , packet1.weight , packet1.weight_d , packet1.work_state , packet1.err_code ); mavlink_msg_vk_weigher_state_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_weigher_state_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.weight , packet1.weight_d , packet1.work_state , packet1.err_code ); mavlink_msg_vk_weigher_state_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_PAYLOAD_DATA_RELAY >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_payload_data_relay_t packet_in = { 17235,139,206,{ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144 } }; mavlink_vk_payload_data_relay_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.payload_addr = packet_in.payload_addr; packet1.reserve = packet_in.reserve; packet1.data_len = packet_in.data_len; mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*128); #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_PAYLOAD_DATA_RELAY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_PAYLOAD_DATA_RELAY_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_payload_data_relay_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_payload_data_relay_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_payload_data_relay_pack(system_id, component_id, &msg , packet1.payload_addr , packet1.reserve , packet1.data_len , packet1.data ); mavlink_msg_vk_payload_data_relay_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_payload_data_relay_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.payload_addr , packet1.reserve , packet1.data_len , packet1.data ); mavlink_msg_vk_payload_data_relay_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_EXTERNAL_INS_NAV >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_external_ins_nav_t packet_in = { 963497464,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,437.0,963500792,963501000,521.0,549.0,577.0,605.0,13,80,147,214 }; mavlink_vk_external_ins_nav_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.timestamp = packet_in.timestamp; packet1.lon = packet_in.lon; packet1.lat = packet_in.lat; packet1.msl = packet_in.msl; packet1.ve = packet_in.ve; packet1.vn = packet_in.vn; packet1.vu = packet_in.vu; packet1.yaw = packet_in.yaw; packet1.pitch = packet_in.pitch; packet1.roll = packet_in.roll; packet1.gx = packet_in.gx; packet1.gy = packet_in.gy; packet1.gz = packet_in.gz; packet1.ax = packet_in.ax; packet1.ay = packet_in.ay; packet1.az = packet_in.az; packet1.sat_lon = packet_in.sat_lon; packet1.sat_lat = packet_in.sat_lat; packet1.sat_msl = packet_in.sat_msl; packet1.sat_ve = packet_in.sat_ve; packet1.sat_vn = packet_in.sat_vn; packet1.sat_vu = packet_in.sat_vu; packet1.sat_pfix = packet_in.sat_pfix; packet1.sat_hfix = packet_in.sat_hfix; packet1.wk_state = packet_in.wk_state; packet1.err_code = packet_in.err_code; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_EXTERNAL_INS_NAV_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_EXTERNAL_INS_NAV_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_external_ins_nav_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_external_ins_nav_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_external_ins_nav_pack(system_id, component_id, &msg , packet1.timestamp , packet1.lon , packet1.lat , packet1.msl , packet1.ve , packet1.vn , packet1.vu , packet1.yaw , packet1.pitch , packet1.roll , packet1.gx , packet1.gy , packet1.gz , packet1.ax , packet1.ay , packet1.az , packet1.sat_lon , packet1.sat_lat , packet1.sat_msl , packet1.sat_ve , packet1.sat_vn , packet1.sat_vu , packet1.sat_pfix , packet1.sat_hfix , packet1.wk_state , packet1.err_code ); mavlink_msg_vk_external_ins_nav_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_external_ins_nav_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.timestamp , packet1.lon , packet1.lat , packet1.msl , packet1.ve , packet1.vn , packet1.vu , packet1.yaw , packet1.pitch , packet1.roll , packet1.gx , packet1.gy , packet1.gz , packet1.ax , packet1.ay , packet1.az , packet1.sat_lon , packet1.sat_lat , packet1.sat_msl , packet1.sat_ve , packet1.sat_vn , packet1.sat_vu , packet1.sat_pfix , packet1.sat_hfix , packet1.wk_state , packet1.err_code ); mavlink_msg_vk_external_ins_nav_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_FW_UPDATE_BEGIN >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_fw_update_begin_t packet_in = { 963497464,17,84 }; mavlink_vk_fw_update_begin_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.file_size = packet_in.file_size; packet1.target_system = packet_in.target_system; packet1.target_comp = packet_in.target_comp; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_FW_UPDATE_BEGIN_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_FW_UPDATE_BEGIN_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_begin_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_fw_update_begin_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_begin_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_comp , packet1.file_size ); mavlink_msg_vk_fw_update_begin_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_begin_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_comp , packet1.file_size ); mavlink_msg_vk_fw_update_begin_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_FW_UPDATE_ACK >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_fw_update_ack_t packet_in = { 5 }; mavlink_vk_fw_update_ack_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.result = packet_in.result; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_FW_UPDATE_ACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_FW_UPDATE_ACK_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_ack_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_fw_update_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_ack_pack(system_id, component_id, &msg , packet1.result ); mavlink_msg_vk_fw_update_ack_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_ack_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.result ); mavlink_msg_vk_fw_update_ack_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_FW_UPDATE_DATA_REQUEST >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_fw_update_data_request_t packet_in = { 963497464,963497672 }; mavlink_vk_fw_update_data_request_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.offset = packet_in.offset; packet1.count = packet_in.count; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_FW_UPDATE_DATA_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_FW_UPDATE_DATA_REQUEST_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_data_request_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_fw_update_data_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_data_request_pack(system_id, component_id, &msg , packet1.offset , packet1.count ); mavlink_msg_vk_fw_update_data_request_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_data_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.offset , packet1.count ); mavlink_msg_vk_fw_update_data_request_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_FW_UPDATE_DATA >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_fw_update_data_t packet_in = { 963497464,17,{ 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211 } }; mavlink_vk_fw_update_data_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.offset = packet_in.offset; packet1.count = packet_in.count; mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*128); #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_FW_UPDATE_DATA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_FW_UPDATE_DATA_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_data_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_fw_update_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_data_pack(system_id, component_id, &msg , packet1.offset , packet1.count , packet1.data ); mavlink_msg_vk_fw_update_data_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_fw_update_data_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.offset , packet1.count , packet1.data ); mavlink_msg_vk_fw_update_data_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VK_UPDATE_TERMINATE >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_vk_update_terminate_t packet_in = { 5,72 }; mavlink_vk_update_terminate_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.target_system = packet_in.target_system; packet1.target_comp = packet_in.target_comp; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_VK_UPDATE_TERMINATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VK_UPDATE_TERMINATE_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_update_terminate_encode(system_id, component_id, &msg, &packet1); mavlink_msg_vk_update_terminate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_update_terminate_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_comp ); mavlink_msg_vk_update_terminate_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_vk_update_terminate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_comp ); mavlink_msg_vk_update_terminate_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; iflags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_QINGXIE_BMS >= 256) { return; } #endif mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_qingxie_bms_t packet_in = { 17235,17339,17443,17547,17651,17755,17859,17963,18067,18171,18275,199,10,18483,18587,18691,223,34,101,168,19003,19107,19211 }; mavlink_qingxie_bms_t packet1, packet2; memset(&packet1, 0, sizeof(packet1)); packet1.bat_voltage = packet_in.bat_voltage; packet1.servo_current = packet_in.servo_current; packet1.stack_voltage = packet_in.stack_voltage; packet1.servo_voltage = packet_in.servo_voltage; packet1.bat_refuel_current = packet_in.bat_refuel_current; packet1.gas_tank_pressure = packet_in.gas_tank_pressure; packet1.pipe_pressure = packet_in.pipe_pressure; packet1.pcb_temp = packet_in.pcb_temp; packet1.stack_temp = packet_in.stack_temp; packet1.work_status = packet_in.work_status; packet1.falt_status = packet_in.falt_status; packet1.self_check = packet_in.self_check; packet1.Id = packet_in.Id; packet1.gass_mass = packet_in.gass_mass; packet1.gass_percent = packet_in.gass_percent; packet1.runtime_remain = packet_in.runtime_remain; packet1.fan_percent = packet_in.fan_percent; packet1.fan_rpm = packet_in.fan_rpm; packet1.sys_run_state = packet_in.sys_run_state; packet1.sys_fault_state = packet_in.sys_fault_state; packet1.sys_fault_code = packet_in.sys_fault_code; packet1.lipo_current = packet_in.lipo_current; packet1.total_runtime = packet_in.total_runtime; #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1 if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) { // cope with extensions memset(MAVLINK_MSG_ID_QINGXIE_BMS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_QINGXIE_BMS_MIN_LEN); } #endif memset(&packet2, 0, sizeof(packet2)); mavlink_msg_qingxie_bms_encode(system_id, component_id, &msg, &packet1); mavlink_msg_qingxie_bms_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_qingxie_bms_pack(system_id, component_id, &msg , packet1.bat_voltage , packet1.servo_current , packet1.stack_voltage , packet1.servo_voltage , packet1.bat_refuel_current , packet1.gas_tank_pressure , packet1.pipe_pressure , packet1.pcb_temp , packet1.stack_temp , packet1.work_status , packet1.falt_status , packet1.self_check , packet1.Id , packet1.gass_mass , packet1.gass_percent , packet1.runtime_remain , packet1.fan_percent , packet1.fan_rpm , packet1.sys_run_state , packet1.sys_fault_state , packet1.sys_fault_code , packet1.lipo_current , packet1.total_runtime ); mavlink_msg_qingxie_bms_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); memset(&packet2, 0, sizeof(packet2)); mavlink_msg_qingxie_bms_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.bat_voltage , packet1.servo_current , packet1.stack_voltage , packet1.servo_voltage , packet1.bat_refuel_current , packet1.gas_tank_pressure , packet1.pipe_pressure , packet1.pcb_temp , packet1.stack_temp , packet1.work_status , packet1.falt_status , packet1.self_check , packet1.Id , packet1.gass_mass , packet1.gass_percent , packet1.runtime_remain , packet1.fan_percent , packet1.fan_rpm , packet1.sys_run_state , packet1.sys_fault_state , packet1.sys_fault_code , packet1.lipo_current , packet1.total_runtime ); mavlink_msg_qingxie_bms_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