/** @file * @brief MAVLink comm protocol testsuite generated from pixhawk.xml * @see http://qgroundcontrol.org/mavlink/ */ #ifndef PIXHAWK_TESTSUITE_H #define PIXHAWK_TESTSUITE_H #ifdef __cplusplus extern "C" { #endif #ifndef MAVLINK_TEST_ALL #define MAVLINK_TEST_ALL static void mavlink_test_common(uint8_t, uint8_t); static void mavlink_test_pixhawk(uint8_t, uint8_t); static void mavlink_test_all(uint8_t system_id, uint8_t component_id) { mavlink_test_common(system_id, component_id); mavlink_test_pixhawk(system_id, component_id); } #endif #include "../common/testsuite.h" static void mavlink_test_set_cam_shutter(uint8_t system_id, uint8_t component_id) { mavlink_message_t msg; uint8_t buffer[MAVLINK_MAX_PACKET_LEN]; uint16_t i; mavlink_set_cam_shutter_t packet2, packet1 = { 17.0, 17443, 17547, 29, 96, 163, }; if (sizeof(packet2) != 11) { packet2 = packet1; // cope with alignment within the packet } mavlink_msg_set_cam_shutter_encode(system_id, component_id, &msg, &packet1); mavlink_msg_set_cam_shutter_decode(&msg, &packet2); MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0); mavlink_msg_set_cam_shutter_pack(system_id, component_id, &msg , packet1.cam_no , packet1.cam_mode , packet1.trigger_pin , packet1.interval , packet1.exposure , packet1.gain ); mavlink_msg_set_cam_shutter_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.cam_no , packet1.cam_mode , packet1.trigger_pin , packet1.interval , packet1.exposure , packet1.gain ); mavlink_msg_to_send_buffer(buffer, &msg); for (i=0; i