You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3595 lines
182 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /** @file
  2. * @brief MAVLink comm protocol testsuite generated from ardupilotmega.xml
  3. * @see http://qgroundcontrol.org/mavlink/
  4. */
  5. #pragma once
  6. #ifndef ARDUPILOTMEGA_TESTSUITE_H
  7. #define ARDUPILOTMEGA_TESTSUITE_H
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #ifndef MAVLINK_TEST_ALL
  12. #define MAVLINK_TEST_ALL
  13. static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
  14. static void mavlink_test_uAvionix(uint8_t, uint8_t, mavlink_message_t *last_msg);
  15. static void mavlink_test_icarous(uint8_t, uint8_t, mavlink_message_t *last_msg);
  16. static void mavlink_test_ardupilotmega(uint8_t, uint8_t, mavlink_message_t *last_msg);
  17. static void mavlink_test_all(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  18. {
  19. mavlink_test_common(system_id, component_id, last_msg);
  20. mavlink_test_uAvionix(system_id, component_id, last_msg);
  21. mavlink_test_icarous(system_id, component_id, last_msg);
  22. mavlink_test_ardupilotmega(system_id, component_id, last_msg);
  23. }
  24. #endif
  25. #include "../common/testsuite.h"
  26. #include "../uAvionix/testsuite.h"
  27. #include "../icarous/testsuite.h"
  28. static void mavlink_test_sensor_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  29. {
  30. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  31. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  32. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SENSOR_OFFSETS >= 256) {
  33. return;
  34. }
  35. #endif
  36. mavlink_message_t msg;
  37. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  38. uint16_t i;
  39. mavlink_sensor_offsets_t packet_in = {
  40. 17.0,963497672,963497880,101.0,129.0,157.0,185.0,213.0,241.0,19107,19211,19315
  41. };
  42. mavlink_sensor_offsets_t packet1, packet2;
  43. memset(&packet1, 0, sizeof(packet1));
  44. packet1.mag_declination = packet_in.mag_declination;
  45. packet1.raw_press = packet_in.raw_press;
  46. packet1.raw_temp = packet_in.raw_temp;
  47. packet1.gyro_cal_x = packet_in.gyro_cal_x;
  48. packet1.gyro_cal_y = packet_in.gyro_cal_y;
  49. packet1.gyro_cal_z = packet_in.gyro_cal_z;
  50. packet1.accel_cal_x = packet_in.accel_cal_x;
  51. packet1.accel_cal_y = packet_in.accel_cal_y;
  52. packet1.accel_cal_z = packet_in.accel_cal_z;
  53. packet1.mag_ofs_x = packet_in.mag_ofs_x;
  54. packet1.mag_ofs_y = packet_in.mag_ofs_y;
  55. packet1.mag_ofs_z = packet_in.mag_ofs_z;
  56. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  57. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  58. // cope with extensions
  59. memset(MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SENSOR_OFFSETS_MIN_LEN);
  60. }
  61. #endif
  62. memset(&packet2, 0, sizeof(packet2));
  63. mavlink_msg_sensor_offsets_encode(system_id, component_id, &msg, &packet1);
  64. mavlink_msg_sensor_offsets_decode(&msg, &packet2);
  65. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  66. memset(&packet2, 0, sizeof(packet2));
  67. mavlink_msg_sensor_offsets_pack(system_id, component_id, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
  68. mavlink_msg_sensor_offsets_decode(&msg, &packet2);
  69. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  70. memset(&packet2, 0, sizeof(packet2));
  71. mavlink_msg_sensor_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
  72. mavlink_msg_sensor_offsets_decode(&msg, &packet2);
  73. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  74. memset(&packet2, 0, sizeof(packet2));
  75. mavlink_msg_to_send_buffer(buffer, &msg);
  76. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  77. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  78. }
  79. mavlink_msg_sensor_offsets_decode(last_msg, &packet2);
  80. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  81. memset(&packet2, 0, sizeof(packet2));
  82. mavlink_msg_sensor_offsets_send(MAVLINK_COMM_1 , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z , packet1.mag_declination , packet1.raw_press , packet1.raw_temp , packet1.gyro_cal_x , packet1.gyro_cal_y , packet1.gyro_cal_z , packet1.accel_cal_x , packet1.accel_cal_y , packet1.accel_cal_z );
  83. mavlink_msg_sensor_offsets_decode(last_msg, &packet2);
  84. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  85. }
  86. static void mavlink_test_set_mag_offsets(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  87. {
  88. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  89. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  90. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SET_MAG_OFFSETS >= 256) {
  91. return;
  92. }
  93. #endif
  94. mavlink_message_t msg;
  95. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  96. uint16_t i;
  97. mavlink_set_mag_offsets_t packet_in = {
  98. 17235,17339,17443,151,218
  99. };
  100. mavlink_set_mag_offsets_t packet1, packet2;
  101. memset(&packet1, 0, sizeof(packet1));
  102. packet1.mag_ofs_x = packet_in.mag_ofs_x;
  103. packet1.mag_ofs_y = packet_in.mag_ofs_y;
  104. packet1.mag_ofs_z = packet_in.mag_ofs_z;
  105. packet1.target_system = packet_in.target_system;
  106. packet1.target_component = packet_in.target_component;
  107. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  108. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  109. // cope with extensions
  110. memset(MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SET_MAG_OFFSETS_MIN_LEN);
  111. }
  112. #endif
  113. memset(&packet2, 0, sizeof(packet2));
  114. mavlink_msg_set_mag_offsets_encode(system_id, component_id, &msg, &packet1);
  115. mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
  116. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  117. memset(&packet2, 0, sizeof(packet2));
  118. mavlink_msg_set_mag_offsets_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
  119. mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
  120. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  121. memset(&packet2, 0, sizeof(packet2));
  122. mavlink_msg_set_mag_offsets_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
  123. mavlink_msg_set_mag_offsets_decode(&msg, &packet2);
  124. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  125. memset(&packet2, 0, sizeof(packet2));
  126. mavlink_msg_to_send_buffer(buffer, &msg);
  127. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  128. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  129. }
  130. mavlink_msg_set_mag_offsets_decode(last_msg, &packet2);
  131. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  132. memset(&packet2, 0, sizeof(packet2));
  133. mavlink_msg_set_mag_offsets_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mag_ofs_x , packet1.mag_ofs_y , packet1.mag_ofs_z );
  134. mavlink_msg_set_mag_offsets_decode(last_msg, &packet2);
  135. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  136. }
  137. static void mavlink_test_meminfo(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  138. {
  139. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  140. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  141. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MEMINFO >= 256) {
  142. return;
  143. }
  144. #endif
  145. mavlink_message_t msg;
  146. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  147. uint16_t i;
  148. mavlink_meminfo_t packet_in = {
  149. 17235,17339,963497672
  150. };
  151. mavlink_meminfo_t packet1, packet2;
  152. memset(&packet1, 0, sizeof(packet1));
  153. packet1.brkval = packet_in.brkval;
  154. packet1.freemem = packet_in.freemem;
  155. packet1.freemem32 = packet_in.freemem32;
  156. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  157. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  158. // cope with extensions
  159. memset(MAVLINK_MSG_ID_MEMINFO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MEMINFO_MIN_LEN);
  160. }
  161. #endif
  162. memset(&packet2, 0, sizeof(packet2));
  163. mavlink_msg_meminfo_encode(system_id, component_id, &msg, &packet1);
  164. mavlink_msg_meminfo_decode(&msg, &packet2);
  165. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  166. memset(&packet2, 0, sizeof(packet2));
  167. mavlink_msg_meminfo_pack(system_id, component_id, &msg , packet1.brkval , packet1.freemem , packet1.freemem32 );
  168. mavlink_msg_meminfo_decode(&msg, &packet2);
  169. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  170. memset(&packet2, 0, sizeof(packet2));
  171. mavlink_msg_meminfo_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.brkval , packet1.freemem , packet1.freemem32 );
  172. mavlink_msg_meminfo_decode(&msg, &packet2);
  173. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  174. memset(&packet2, 0, sizeof(packet2));
  175. mavlink_msg_to_send_buffer(buffer, &msg);
  176. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  177. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  178. }
  179. mavlink_msg_meminfo_decode(last_msg, &packet2);
  180. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  181. memset(&packet2, 0, sizeof(packet2));
  182. mavlink_msg_meminfo_send(MAVLINK_COMM_1 , packet1.brkval , packet1.freemem , packet1.freemem32 );
  183. mavlink_msg_meminfo_decode(last_msg, &packet2);
  184. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  185. }
  186. static void mavlink_test_ap_adc(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  187. {
  188. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  189. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  190. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AP_ADC >= 256) {
  191. return;
  192. }
  193. #endif
  194. mavlink_message_t msg;
  195. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  196. uint16_t i;
  197. mavlink_ap_adc_t packet_in = {
  198. 17235,17339,17443,17547,17651,17755
  199. };
  200. mavlink_ap_adc_t packet1, packet2;
  201. memset(&packet1, 0, sizeof(packet1));
  202. packet1.adc1 = packet_in.adc1;
  203. packet1.adc2 = packet_in.adc2;
  204. packet1.adc3 = packet_in.adc3;
  205. packet1.adc4 = packet_in.adc4;
  206. packet1.adc5 = packet_in.adc5;
  207. packet1.adc6 = packet_in.adc6;
  208. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  209. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  210. // cope with extensions
  211. memset(MAVLINK_MSG_ID_AP_ADC_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AP_ADC_MIN_LEN);
  212. }
  213. #endif
  214. memset(&packet2, 0, sizeof(packet2));
  215. mavlink_msg_ap_adc_encode(system_id, component_id, &msg, &packet1);
  216. mavlink_msg_ap_adc_decode(&msg, &packet2);
  217. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  218. memset(&packet2, 0, sizeof(packet2));
  219. mavlink_msg_ap_adc_pack(system_id, component_id, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 );
  220. mavlink_msg_ap_adc_decode(&msg, &packet2);
  221. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  222. memset(&packet2, 0, sizeof(packet2));
  223. mavlink_msg_ap_adc_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 );
  224. mavlink_msg_ap_adc_decode(&msg, &packet2);
  225. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  226. memset(&packet2, 0, sizeof(packet2));
  227. mavlink_msg_to_send_buffer(buffer, &msg);
  228. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  229. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  230. }
  231. mavlink_msg_ap_adc_decode(last_msg, &packet2);
  232. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  233. memset(&packet2, 0, sizeof(packet2));
  234. mavlink_msg_ap_adc_send(MAVLINK_COMM_1 , packet1.adc1 , packet1.adc2 , packet1.adc3 , packet1.adc4 , packet1.adc5 , packet1.adc6 );
  235. mavlink_msg_ap_adc_decode(last_msg, &packet2);
  236. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  237. }
  238. static void mavlink_test_digicam_configure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  239. {
  240. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  241. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  242. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DIGICAM_CONFIGURE >= 256) {
  243. return;
  244. }
  245. #endif
  246. mavlink_message_t msg;
  247. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  248. uint16_t i;
  249. mavlink_digicam_configure_t packet_in = {
  250. 17.0,17443,151,218,29,96,163,230,41,108,175
  251. };
  252. mavlink_digicam_configure_t packet1, packet2;
  253. memset(&packet1, 0, sizeof(packet1));
  254. packet1.extra_value = packet_in.extra_value;
  255. packet1.shutter_speed = packet_in.shutter_speed;
  256. packet1.target_system = packet_in.target_system;
  257. packet1.target_component = packet_in.target_component;
  258. packet1.mode = packet_in.mode;
  259. packet1.aperture = packet_in.aperture;
  260. packet1.iso = packet_in.iso;
  261. packet1.exposure_type = packet_in.exposure_type;
  262. packet1.command_id = packet_in.command_id;
  263. packet1.engine_cut_off = packet_in.engine_cut_off;
  264. packet1.extra_param = packet_in.extra_param;
  265. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  266. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  267. // cope with extensions
  268. memset(MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DIGICAM_CONFIGURE_MIN_LEN);
  269. }
  270. #endif
  271. memset(&packet2, 0, sizeof(packet2));
  272. mavlink_msg_digicam_configure_encode(system_id, component_id, &msg, &packet1);
  273. mavlink_msg_digicam_configure_decode(&msg, &packet2);
  274. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  275. memset(&packet2, 0, sizeof(packet2));
  276. mavlink_msg_digicam_configure_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value );
  277. mavlink_msg_digicam_configure_decode(&msg, &packet2);
  278. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  279. memset(&packet2, 0, sizeof(packet2));
  280. mavlink_msg_digicam_configure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value );
  281. mavlink_msg_digicam_configure_decode(&msg, &packet2);
  282. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  283. memset(&packet2, 0, sizeof(packet2));
  284. mavlink_msg_to_send_buffer(buffer, &msg);
  285. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  286. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  287. }
  288. mavlink_msg_digicam_configure_decode(last_msg, &packet2);
  289. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  290. memset(&packet2, 0, sizeof(packet2));
  291. mavlink_msg_digicam_configure_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mode , packet1.shutter_speed , packet1.aperture , packet1.iso , packet1.exposure_type , packet1.command_id , packet1.engine_cut_off , packet1.extra_param , packet1.extra_value );
  292. mavlink_msg_digicam_configure_decode(last_msg, &packet2);
  293. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  294. }
  295. static void mavlink_test_digicam_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  296. {
  297. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  298. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  299. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DIGICAM_CONTROL >= 256) {
  300. return;
  301. }
  302. #endif
  303. mavlink_message_t msg;
  304. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  305. uint16_t i;
  306. mavlink_digicam_control_t packet_in = {
  307. 17.0,17,84,151,218,29,96,163,230,41
  308. };
  309. mavlink_digicam_control_t packet1, packet2;
  310. memset(&packet1, 0, sizeof(packet1));
  311. packet1.extra_value = packet_in.extra_value;
  312. packet1.target_system = packet_in.target_system;
  313. packet1.target_component = packet_in.target_component;
  314. packet1.session = packet_in.session;
  315. packet1.zoom_pos = packet_in.zoom_pos;
  316. packet1.zoom_step = packet_in.zoom_step;
  317. packet1.focus_lock = packet_in.focus_lock;
  318. packet1.shot = packet_in.shot;
  319. packet1.command_id = packet_in.command_id;
  320. packet1.extra_param = packet_in.extra_param;
  321. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  322. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  323. // cope with extensions
  324. memset(MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DIGICAM_CONTROL_MIN_LEN);
  325. }
  326. #endif
  327. memset(&packet2, 0, sizeof(packet2));
  328. mavlink_msg_digicam_control_encode(system_id, component_id, &msg, &packet1);
  329. mavlink_msg_digicam_control_decode(&msg, &packet2);
  330. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  331. memset(&packet2, 0, sizeof(packet2));
  332. mavlink_msg_digicam_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value );
  333. mavlink_msg_digicam_control_decode(&msg, &packet2);
  334. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  335. memset(&packet2, 0, sizeof(packet2));
  336. mavlink_msg_digicam_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value );
  337. mavlink_msg_digicam_control_decode(&msg, &packet2);
  338. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  339. memset(&packet2, 0, sizeof(packet2));
  340. mavlink_msg_to_send_buffer(buffer, &msg);
  341. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  342. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  343. }
  344. mavlink_msg_digicam_control_decode(last_msg, &packet2);
  345. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  346. memset(&packet2, 0, sizeof(packet2));
  347. mavlink_msg_digicam_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.session , packet1.zoom_pos , packet1.zoom_step , packet1.focus_lock , packet1.shot , packet1.command_id , packet1.extra_param , packet1.extra_value );
  348. mavlink_msg_digicam_control_decode(last_msg, &packet2);
  349. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  350. }
  351. static void mavlink_test_mount_configure(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  352. {
  353. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  354. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  355. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MOUNT_CONFIGURE >= 256) {
  356. return;
  357. }
  358. #endif
  359. mavlink_message_t msg;
  360. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  361. uint16_t i;
  362. mavlink_mount_configure_t packet_in = {
  363. 5,72,139,206,17,84
  364. };
  365. mavlink_mount_configure_t packet1, packet2;
  366. memset(&packet1, 0, sizeof(packet1));
  367. packet1.target_system = packet_in.target_system;
  368. packet1.target_component = packet_in.target_component;
  369. packet1.mount_mode = packet_in.mount_mode;
  370. packet1.stab_roll = packet_in.stab_roll;
  371. packet1.stab_pitch = packet_in.stab_pitch;
  372. packet1.stab_yaw = packet_in.stab_yaw;
  373. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  374. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  375. // cope with extensions
  376. memset(MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MOUNT_CONFIGURE_MIN_LEN);
  377. }
  378. #endif
  379. memset(&packet2, 0, sizeof(packet2));
  380. mavlink_msg_mount_configure_encode(system_id, component_id, &msg, &packet1);
  381. mavlink_msg_mount_configure_decode(&msg, &packet2);
  382. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  383. memset(&packet2, 0, sizeof(packet2));
  384. mavlink_msg_mount_configure_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw );
  385. mavlink_msg_mount_configure_decode(&msg, &packet2);
  386. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  387. memset(&packet2, 0, sizeof(packet2));
  388. mavlink_msg_mount_configure_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw );
  389. mavlink_msg_mount_configure_decode(&msg, &packet2);
  390. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  391. memset(&packet2, 0, sizeof(packet2));
  392. mavlink_msg_to_send_buffer(buffer, &msg);
  393. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  394. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  395. }
  396. mavlink_msg_mount_configure_decode(last_msg, &packet2);
  397. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  398. memset(&packet2, 0, sizeof(packet2));
  399. mavlink_msg_mount_configure_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.mount_mode , packet1.stab_roll , packet1.stab_pitch , packet1.stab_yaw );
  400. mavlink_msg_mount_configure_decode(last_msg, &packet2);
  401. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  402. }
  403. static void mavlink_test_mount_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  404. {
  405. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  406. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  407. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MOUNT_CONTROL >= 256) {
  408. return;
  409. }
  410. #endif
  411. mavlink_message_t msg;
  412. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  413. uint16_t i;
  414. mavlink_mount_control_t packet_in = {
  415. 963497464,963497672,963497880,41,108,175
  416. };
  417. mavlink_mount_control_t packet1, packet2;
  418. memset(&packet1, 0, sizeof(packet1));
  419. packet1.input_a = packet_in.input_a;
  420. packet1.input_b = packet_in.input_b;
  421. packet1.input_c = packet_in.input_c;
  422. packet1.target_system = packet_in.target_system;
  423. packet1.target_component = packet_in.target_component;
  424. packet1.save_position = packet_in.save_position;
  425. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  426. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  427. // cope with extensions
  428. memset(MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MOUNT_CONTROL_MIN_LEN);
  429. }
  430. #endif
  431. memset(&packet2, 0, sizeof(packet2));
  432. mavlink_msg_mount_control_encode(system_id, component_id, &msg, &packet1);
  433. mavlink_msg_mount_control_decode(&msg, &packet2);
  434. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  435. memset(&packet2, 0, sizeof(packet2));
  436. mavlink_msg_mount_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position );
  437. mavlink_msg_mount_control_decode(&msg, &packet2);
  438. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  439. memset(&packet2, 0, sizeof(packet2));
  440. mavlink_msg_mount_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position );
  441. mavlink_msg_mount_control_decode(&msg, &packet2);
  442. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  443. memset(&packet2, 0, sizeof(packet2));
  444. mavlink_msg_to_send_buffer(buffer, &msg);
  445. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  446. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  447. }
  448. mavlink_msg_mount_control_decode(last_msg, &packet2);
  449. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  450. memset(&packet2, 0, sizeof(packet2));
  451. mavlink_msg_mount_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.input_a , packet1.input_b , packet1.input_c , packet1.save_position );
  452. mavlink_msg_mount_control_decode(last_msg, &packet2);
  453. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  454. }
  455. static void mavlink_test_mount_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  456. {
  457. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  458. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  459. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MOUNT_STATUS >= 256) {
  460. return;
  461. }
  462. #endif
  463. mavlink_message_t msg;
  464. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  465. uint16_t i;
  466. mavlink_mount_status_t packet_in = {
  467. 963497464,963497672,963497880,41,108
  468. };
  469. mavlink_mount_status_t packet1, packet2;
  470. memset(&packet1, 0, sizeof(packet1));
  471. packet1.pointing_a = packet_in.pointing_a;
  472. packet1.pointing_b = packet_in.pointing_b;
  473. packet1.pointing_c = packet_in.pointing_c;
  474. packet1.target_system = packet_in.target_system;
  475. packet1.target_component = packet_in.target_component;
  476. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  477. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  478. // cope with extensions
  479. memset(MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MOUNT_STATUS_MIN_LEN);
  480. }
  481. #endif
  482. memset(&packet2, 0, sizeof(packet2));
  483. mavlink_msg_mount_status_encode(system_id, component_id, &msg, &packet1);
  484. mavlink_msg_mount_status_decode(&msg, &packet2);
  485. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  486. memset(&packet2, 0, sizeof(packet2));
  487. mavlink_msg_mount_status_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c );
  488. mavlink_msg_mount_status_decode(&msg, &packet2);
  489. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  490. memset(&packet2, 0, sizeof(packet2));
  491. mavlink_msg_mount_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c );
  492. mavlink_msg_mount_status_decode(&msg, &packet2);
  493. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  494. memset(&packet2, 0, sizeof(packet2));
  495. mavlink_msg_to_send_buffer(buffer, &msg);
  496. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  497. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  498. }
  499. mavlink_msg_mount_status_decode(last_msg, &packet2);
  500. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  501. memset(&packet2, 0, sizeof(packet2));
  502. mavlink_msg_mount_status_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.pointing_a , packet1.pointing_b , packet1.pointing_c );
  503. mavlink_msg_mount_status_decode(last_msg, &packet2);
  504. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  505. }
  506. static void mavlink_test_fence_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  507. {
  508. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  509. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  510. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FENCE_POINT >= 256) {
  511. return;
  512. }
  513. #endif
  514. mavlink_message_t msg;
  515. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  516. uint16_t i;
  517. mavlink_fence_point_t packet_in = {
  518. 17.0,45.0,29,96,163,230
  519. };
  520. mavlink_fence_point_t packet1, packet2;
  521. memset(&packet1, 0, sizeof(packet1));
  522. packet1.lat = packet_in.lat;
  523. packet1.lng = packet_in.lng;
  524. packet1.target_system = packet_in.target_system;
  525. packet1.target_component = packet_in.target_component;
  526. packet1.idx = packet_in.idx;
  527. packet1.count = packet_in.count;
  528. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  529. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  530. // cope with extensions
  531. memset(MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FENCE_POINT_MIN_LEN);
  532. }
  533. #endif
  534. memset(&packet2, 0, sizeof(packet2));
  535. mavlink_msg_fence_point_encode(system_id, component_id, &msg, &packet1);
  536. mavlink_msg_fence_point_decode(&msg, &packet2);
  537. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  538. memset(&packet2, 0, sizeof(packet2));
  539. mavlink_msg_fence_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
  540. mavlink_msg_fence_point_decode(&msg, &packet2);
  541. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  542. memset(&packet2, 0, sizeof(packet2));
  543. mavlink_msg_fence_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
  544. mavlink_msg_fence_point_decode(&msg, &packet2);
  545. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  546. memset(&packet2, 0, sizeof(packet2));
  547. mavlink_msg_to_send_buffer(buffer, &msg);
  548. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  549. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  550. }
  551. mavlink_msg_fence_point_decode(last_msg, &packet2);
  552. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  553. memset(&packet2, 0, sizeof(packet2));
  554. mavlink_msg_fence_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng );
  555. mavlink_msg_fence_point_decode(last_msg, &packet2);
  556. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  557. }
  558. static void mavlink_test_fence_fetch_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  559. {
  560. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  561. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  562. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_FENCE_FETCH_POINT >= 256) {
  563. return;
  564. }
  565. #endif
  566. mavlink_message_t msg;
  567. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  568. uint16_t i;
  569. mavlink_fence_fetch_point_t packet_in = {
  570. 5,72,139
  571. };
  572. mavlink_fence_fetch_point_t packet1, packet2;
  573. memset(&packet1, 0, sizeof(packet1));
  574. packet1.target_system = packet_in.target_system;
  575. packet1.target_component = packet_in.target_component;
  576. packet1.idx = packet_in.idx;
  577. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  578. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  579. // cope with extensions
  580. memset(MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_FENCE_FETCH_POINT_MIN_LEN);
  581. }
  582. #endif
  583. memset(&packet2, 0, sizeof(packet2));
  584. mavlink_msg_fence_fetch_point_encode(system_id, component_id, &msg, &packet1);
  585. mavlink_msg_fence_fetch_point_decode(&msg, &packet2);
  586. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  587. memset(&packet2, 0, sizeof(packet2));
  588. mavlink_msg_fence_fetch_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx );
  589. mavlink_msg_fence_fetch_point_decode(&msg, &packet2);
  590. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  591. memset(&packet2, 0, sizeof(packet2));
  592. mavlink_msg_fence_fetch_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx );
  593. mavlink_msg_fence_fetch_point_decode(&msg, &packet2);
  594. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  595. memset(&packet2, 0, sizeof(packet2));
  596. mavlink_msg_to_send_buffer(buffer, &msg);
  597. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  598. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  599. }
  600. mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
  601. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  602. memset(&packet2, 0, sizeof(packet2));
  603. mavlink_msg_fence_fetch_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx );
  604. mavlink_msg_fence_fetch_point_decode(last_msg, &packet2);
  605. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  606. }
  607. static void mavlink_test_ahrs(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  608. {
  609. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  610. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  611. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AHRS >= 256) {
  612. return;
  613. }
  614. #endif
  615. mavlink_message_t msg;
  616. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  617. uint16_t i;
  618. mavlink_ahrs_t packet_in = {
  619. 17.0,45.0,73.0,101.0,129.0,157.0,185.0
  620. };
  621. mavlink_ahrs_t packet1, packet2;
  622. memset(&packet1, 0, sizeof(packet1));
  623. packet1.omegaIx = packet_in.omegaIx;
  624. packet1.omegaIy = packet_in.omegaIy;
  625. packet1.omegaIz = packet_in.omegaIz;
  626. packet1.accel_weight = packet_in.accel_weight;
  627. packet1.renorm_val = packet_in.renorm_val;
  628. packet1.error_rp = packet_in.error_rp;
  629. packet1.error_yaw = packet_in.error_yaw;
  630. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  631. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  632. // cope with extensions
  633. memset(MAVLINK_MSG_ID_AHRS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AHRS_MIN_LEN);
  634. }
  635. #endif
  636. memset(&packet2, 0, sizeof(packet2));
  637. mavlink_msg_ahrs_encode(system_id, component_id, &msg, &packet1);
  638. mavlink_msg_ahrs_decode(&msg, &packet2);
  639. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  640. memset(&packet2, 0, sizeof(packet2));
  641. mavlink_msg_ahrs_pack(system_id, component_id, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
  642. mavlink_msg_ahrs_decode(&msg, &packet2);
  643. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  644. memset(&packet2, 0, sizeof(packet2));
  645. mavlink_msg_ahrs_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
  646. mavlink_msg_ahrs_decode(&msg, &packet2);
  647. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  648. memset(&packet2, 0, sizeof(packet2));
  649. mavlink_msg_to_send_buffer(buffer, &msg);
  650. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  651. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  652. }
  653. mavlink_msg_ahrs_decode(last_msg, &packet2);
  654. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  655. memset(&packet2, 0, sizeof(packet2));
  656. mavlink_msg_ahrs_send(MAVLINK_COMM_1 , packet1.omegaIx , packet1.omegaIy , packet1.omegaIz , packet1.accel_weight , packet1.renorm_val , packet1.error_rp , packet1.error_yaw );
  657. mavlink_msg_ahrs_decode(last_msg, &packet2);
  658. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  659. }
  660. static void mavlink_test_simstate(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  661. {
  662. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  663. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  664. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_SIMSTATE >= 256) {
  665. return;
  666. }
  667. #endif
  668. mavlink_message_t msg;
  669. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  670. uint16_t i;
  671. mavlink_simstate_t packet_in = {
  672. 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,963499336,963499544
  673. };
  674. mavlink_simstate_t packet1, packet2;
  675. memset(&packet1, 0, sizeof(packet1));
  676. packet1.roll = packet_in.roll;
  677. packet1.pitch = packet_in.pitch;
  678. packet1.yaw = packet_in.yaw;
  679. packet1.xacc = packet_in.xacc;
  680. packet1.yacc = packet_in.yacc;
  681. packet1.zacc = packet_in.zacc;
  682. packet1.xgyro = packet_in.xgyro;
  683. packet1.ygyro = packet_in.ygyro;
  684. packet1.zgyro = packet_in.zgyro;
  685. packet1.lat = packet_in.lat;
  686. packet1.lng = packet_in.lng;
  687. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  688. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  689. // cope with extensions
  690. memset(MAVLINK_MSG_ID_SIMSTATE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_SIMSTATE_MIN_LEN);
  691. }
  692. #endif
  693. memset(&packet2, 0, sizeof(packet2));
  694. mavlink_msg_simstate_encode(system_id, component_id, &msg, &packet1);
  695. mavlink_msg_simstate_decode(&msg, &packet2);
  696. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  697. memset(&packet2, 0, sizeof(packet2));
  698. mavlink_msg_simstate_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
  699. mavlink_msg_simstate_decode(&msg, &packet2);
  700. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  701. memset(&packet2, 0, sizeof(packet2));
  702. mavlink_msg_simstate_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
  703. mavlink_msg_simstate_decode(&msg, &packet2);
  704. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  705. memset(&packet2, 0, sizeof(packet2));
  706. mavlink_msg_to_send_buffer(buffer, &msg);
  707. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  708. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  709. }
  710. mavlink_msg_simstate_decode(last_msg, &packet2);
  711. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  712. memset(&packet2, 0, sizeof(packet2));
  713. mavlink_msg_simstate_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.xacc , packet1.yacc , packet1.zacc , packet1.xgyro , packet1.ygyro , packet1.zgyro , packet1.lat , packet1.lng );
  714. mavlink_msg_simstate_decode(last_msg, &packet2);
  715. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  716. }
  717. static void mavlink_test_hwstatus(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  718. {
  719. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  720. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  721. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_HWSTATUS >= 256) {
  722. return;
  723. }
  724. #endif
  725. mavlink_message_t msg;
  726. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  727. uint16_t i;
  728. mavlink_hwstatus_t packet_in = {
  729. 17235,139
  730. };
  731. mavlink_hwstatus_t packet1, packet2;
  732. memset(&packet1, 0, sizeof(packet1));
  733. packet1.Vcc = packet_in.Vcc;
  734. packet1.I2Cerr = packet_in.I2Cerr;
  735. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  736. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  737. // cope with extensions
  738. memset(MAVLINK_MSG_ID_HWSTATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_HWSTATUS_MIN_LEN);
  739. }
  740. #endif
  741. memset(&packet2, 0, sizeof(packet2));
  742. mavlink_msg_hwstatus_encode(system_id, component_id, &msg, &packet1);
  743. mavlink_msg_hwstatus_decode(&msg, &packet2);
  744. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  745. memset(&packet2, 0, sizeof(packet2));
  746. mavlink_msg_hwstatus_pack(system_id, component_id, &msg , packet1.Vcc , packet1.I2Cerr );
  747. mavlink_msg_hwstatus_decode(&msg, &packet2);
  748. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  749. memset(&packet2, 0, sizeof(packet2));
  750. mavlink_msg_hwstatus_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.Vcc , packet1.I2Cerr );
  751. mavlink_msg_hwstatus_decode(&msg, &packet2);
  752. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  753. memset(&packet2, 0, sizeof(packet2));
  754. mavlink_msg_to_send_buffer(buffer, &msg);
  755. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  756. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  757. }
  758. mavlink_msg_hwstatus_decode(last_msg, &packet2);
  759. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  760. memset(&packet2, 0, sizeof(packet2));
  761. mavlink_msg_hwstatus_send(MAVLINK_COMM_1 , packet1.Vcc , packet1.I2Cerr );
  762. mavlink_msg_hwstatus_decode(last_msg, &packet2);
  763. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  764. }
  765. static void mavlink_test_radio(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  766. {
  767. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  768. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  769. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RADIO >= 256) {
  770. return;
  771. }
  772. #endif
  773. mavlink_message_t msg;
  774. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  775. uint16_t i;
  776. mavlink_radio_t packet_in = {
  777. 17235,17339,17,84,151,218,29
  778. };
  779. mavlink_radio_t packet1, packet2;
  780. memset(&packet1, 0, sizeof(packet1));
  781. packet1.rxerrors = packet_in.rxerrors;
  782. packet1.fixed = packet_in.fixed;
  783. packet1.rssi = packet_in.rssi;
  784. packet1.remrssi = packet_in.remrssi;
  785. packet1.txbuf = packet_in.txbuf;
  786. packet1.noise = packet_in.noise;
  787. packet1.remnoise = packet_in.remnoise;
  788. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  789. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  790. // cope with extensions
  791. memset(MAVLINK_MSG_ID_RADIO_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RADIO_MIN_LEN);
  792. }
  793. #endif
  794. memset(&packet2, 0, sizeof(packet2));
  795. mavlink_msg_radio_encode(system_id, component_id, &msg, &packet1);
  796. mavlink_msg_radio_decode(&msg, &packet2);
  797. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  798. memset(&packet2, 0, sizeof(packet2));
  799. mavlink_msg_radio_pack(system_id, component_id, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
  800. mavlink_msg_radio_decode(&msg, &packet2);
  801. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  802. memset(&packet2, 0, sizeof(packet2));
  803. mavlink_msg_radio_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
  804. mavlink_msg_radio_decode(&msg, &packet2);
  805. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  806. memset(&packet2, 0, sizeof(packet2));
  807. mavlink_msg_to_send_buffer(buffer, &msg);
  808. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  809. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  810. }
  811. mavlink_msg_radio_decode(last_msg, &packet2);
  812. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  813. memset(&packet2, 0, sizeof(packet2));
  814. mavlink_msg_radio_send(MAVLINK_COMM_1 , packet1.rssi , packet1.remrssi , packet1.txbuf , packet1.noise , packet1.remnoise , packet1.rxerrors , packet1.fixed );
  815. mavlink_msg_radio_decode(last_msg, &packet2);
  816. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  817. }
  818. static void mavlink_test_limits_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  819. {
  820. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  821. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  822. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LIMITS_STATUS >= 256) {
  823. return;
  824. }
  825. #endif
  826. mavlink_message_t msg;
  827. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  828. uint16_t i;
  829. mavlink_limits_status_t packet_in = {
  830. 963497464,963497672,963497880,963498088,18067,187,254,65,132
  831. };
  832. mavlink_limits_status_t packet1, packet2;
  833. memset(&packet1, 0, sizeof(packet1));
  834. packet1.last_trigger = packet_in.last_trigger;
  835. packet1.last_action = packet_in.last_action;
  836. packet1.last_recovery = packet_in.last_recovery;
  837. packet1.last_clear = packet_in.last_clear;
  838. packet1.breach_count = packet_in.breach_count;
  839. packet1.limits_state = packet_in.limits_state;
  840. packet1.mods_enabled = packet_in.mods_enabled;
  841. packet1.mods_required = packet_in.mods_required;
  842. packet1.mods_triggered = packet_in.mods_triggered;
  843. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  844. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  845. // cope with extensions
  846. memset(MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LIMITS_STATUS_MIN_LEN);
  847. }
  848. #endif
  849. memset(&packet2, 0, sizeof(packet2));
  850. mavlink_msg_limits_status_encode(system_id, component_id, &msg, &packet1);
  851. mavlink_msg_limits_status_decode(&msg, &packet2);
  852. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  853. memset(&packet2, 0, sizeof(packet2));
  854. mavlink_msg_limits_status_pack(system_id, component_id, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
  855. mavlink_msg_limits_status_decode(&msg, &packet2);
  856. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  857. memset(&packet2, 0, sizeof(packet2));
  858. mavlink_msg_limits_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
  859. mavlink_msg_limits_status_decode(&msg, &packet2);
  860. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  861. memset(&packet2, 0, sizeof(packet2));
  862. mavlink_msg_to_send_buffer(buffer, &msg);
  863. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  864. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  865. }
  866. mavlink_msg_limits_status_decode(last_msg, &packet2);
  867. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  868. memset(&packet2, 0, sizeof(packet2));
  869. mavlink_msg_limits_status_send(MAVLINK_COMM_1 , packet1.limits_state , packet1.last_trigger , packet1.last_action , packet1.last_recovery , packet1.last_clear , packet1.breach_count , packet1.mods_enabled , packet1.mods_required , packet1.mods_triggered );
  870. mavlink_msg_limits_status_decode(last_msg, &packet2);
  871. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  872. }
  873. static void mavlink_test_wind(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  874. {
  875. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  876. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  877. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_WIND >= 256) {
  878. return;
  879. }
  880. #endif
  881. mavlink_message_t msg;
  882. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  883. uint16_t i;
  884. mavlink_wind_t packet_in = {
  885. 17.0,45.0,73.0
  886. };
  887. mavlink_wind_t packet1, packet2;
  888. memset(&packet1, 0, sizeof(packet1));
  889. packet1.direction = packet_in.direction;
  890. packet1.speed = packet_in.speed;
  891. packet1.speed_z = packet_in.speed_z;
  892. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  893. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  894. // cope with extensions
  895. memset(MAVLINK_MSG_ID_WIND_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_WIND_MIN_LEN);
  896. }
  897. #endif
  898. memset(&packet2, 0, sizeof(packet2));
  899. mavlink_msg_wind_encode(system_id, component_id, &msg, &packet1);
  900. mavlink_msg_wind_decode(&msg, &packet2);
  901. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  902. memset(&packet2, 0, sizeof(packet2));
  903. mavlink_msg_wind_pack(system_id, component_id, &msg , packet1.direction , packet1.speed , packet1.speed_z );
  904. mavlink_msg_wind_decode(&msg, &packet2);
  905. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  906. memset(&packet2, 0, sizeof(packet2));
  907. mavlink_msg_wind_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.direction , packet1.speed , packet1.speed_z );
  908. mavlink_msg_wind_decode(&msg, &packet2);
  909. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  910. memset(&packet2, 0, sizeof(packet2));
  911. mavlink_msg_to_send_buffer(buffer, &msg);
  912. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  913. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  914. }
  915. mavlink_msg_wind_decode(last_msg, &packet2);
  916. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  917. memset(&packet2, 0, sizeof(packet2));
  918. mavlink_msg_wind_send(MAVLINK_COMM_1 , packet1.direction , packet1.speed , packet1.speed_z );
  919. mavlink_msg_wind_decode(last_msg, &packet2);
  920. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  921. }
  922. static void mavlink_test_data16(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  923. {
  924. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  925. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  926. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA16 >= 256) {
  927. return;
  928. }
  929. #endif
  930. mavlink_message_t msg;
  931. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  932. uint16_t i;
  933. mavlink_data16_t packet_in = {
  934. 5,72,{ 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154 }
  935. };
  936. mavlink_data16_t packet1, packet2;
  937. memset(&packet1, 0, sizeof(packet1));
  938. packet1.type = packet_in.type;
  939. packet1.len = packet_in.len;
  940. mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*16);
  941. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  942. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  943. // cope with extensions
  944. memset(MAVLINK_MSG_ID_DATA16_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA16_MIN_LEN);
  945. }
  946. #endif
  947. memset(&packet2, 0, sizeof(packet2));
  948. mavlink_msg_data16_encode(system_id, component_id, &msg, &packet1);
  949. mavlink_msg_data16_decode(&msg, &packet2);
  950. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  951. memset(&packet2, 0, sizeof(packet2));
  952. mavlink_msg_data16_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
  953. mavlink_msg_data16_decode(&msg, &packet2);
  954. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  955. memset(&packet2, 0, sizeof(packet2));
  956. mavlink_msg_data16_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
  957. mavlink_msg_data16_decode(&msg, &packet2);
  958. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  959. memset(&packet2, 0, sizeof(packet2));
  960. mavlink_msg_to_send_buffer(buffer, &msg);
  961. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  962. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  963. }
  964. mavlink_msg_data16_decode(last_msg, &packet2);
  965. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  966. memset(&packet2, 0, sizeof(packet2));
  967. mavlink_msg_data16_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
  968. mavlink_msg_data16_decode(last_msg, &packet2);
  969. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  970. }
  971. static void mavlink_test_data32(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  972. {
  973. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  974. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  975. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA32 >= 256) {
  976. return;
  977. }
  978. #endif
  979. mavlink_message_t msg;
  980. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  981. uint16_t i;
  982. mavlink_data32_t packet_in = {
  983. 5,72,{ 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 }
  984. };
  985. mavlink_data32_t packet1, packet2;
  986. memset(&packet1, 0, sizeof(packet1));
  987. packet1.type = packet_in.type;
  988. packet1.len = packet_in.len;
  989. mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*32);
  990. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  991. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  992. // cope with extensions
  993. memset(MAVLINK_MSG_ID_DATA32_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA32_MIN_LEN);
  994. }
  995. #endif
  996. memset(&packet2, 0, sizeof(packet2));
  997. mavlink_msg_data32_encode(system_id, component_id, &msg, &packet1);
  998. mavlink_msg_data32_decode(&msg, &packet2);
  999. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1000. memset(&packet2, 0, sizeof(packet2));
  1001. mavlink_msg_data32_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
  1002. mavlink_msg_data32_decode(&msg, &packet2);
  1003. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1004. memset(&packet2, 0, sizeof(packet2));
  1005. mavlink_msg_data32_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
  1006. mavlink_msg_data32_decode(&msg, &packet2);
  1007. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1008. memset(&packet2, 0, sizeof(packet2));
  1009. mavlink_msg_to_send_buffer(buffer, &msg);
  1010. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1011. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1012. }
  1013. mavlink_msg_data32_decode(last_msg, &packet2);
  1014. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1015. memset(&packet2, 0, sizeof(packet2));
  1016. mavlink_msg_data32_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
  1017. mavlink_msg_data32_decode(last_msg, &packet2);
  1018. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1019. }
  1020. static void mavlink_test_data64(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1021. {
  1022. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1023. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1024. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA64 >= 256) {
  1025. return;
  1026. }
  1027. #endif
  1028. mavlink_message_t msg;
  1029. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1030. uint16_t i;
  1031. mavlink_data64_t packet_in = {
  1032. 5,72,{ 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 }
  1033. };
  1034. mavlink_data64_t packet1, packet2;
  1035. memset(&packet1, 0, sizeof(packet1));
  1036. packet1.type = packet_in.type;
  1037. packet1.len = packet_in.len;
  1038. mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*64);
  1039. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1040. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1041. // cope with extensions
  1042. memset(MAVLINK_MSG_ID_DATA64_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA64_MIN_LEN);
  1043. }
  1044. #endif
  1045. memset(&packet2, 0, sizeof(packet2));
  1046. mavlink_msg_data64_encode(system_id, component_id, &msg, &packet1);
  1047. mavlink_msg_data64_decode(&msg, &packet2);
  1048. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1049. memset(&packet2, 0, sizeof(packet2));
  1050. mavlink_msg_data64_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
  1051. mavlink_msg_data64_decode(&msg, &packet2);
  1052. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1053. memset(&packet2, 0, sizeof(packet2));
  1054. mavlink_msg_data64_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
  1055. mavlink_msg_data64_decode(&msg, &packet2);
  1056. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1057. memset(&packet2, 0, sizeof(packet2));
  1058. mavlink_msg_to_send_buffer(buffer, &msg);
  1059. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1060. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1061. }
  1062. mavlink_msg_data64_decode(last_msg, &packet2);
  1063. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1064. memset(&packet2, 0, sizeof(packet2));
  1065. mavlink_msg_data64_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
  1066. mavlink_msg_data64_decode(last_msg, &packet2);
  1067. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1068. }
  1069. static void mavlink_test_data96(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1070. {
  1071. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1072. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1073. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DATA96 >= 256) {
  1074. return;
  1075. }
  1076. #endif
  1077. mavlink_message_t msg;
  1078. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1079. uint16_t i;
  1080. mavlink_data96_t packet_in = {
  1081. 5,72,{ 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, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234 }
  1082. };
  1083. mavlink_data96_t packet1, packet2;
  1084. memset(&packet1, 0, sizeof(packet1));
  1085. packet1.type = packet_in.type;
  1086. packet1.len = packet_in.len;
  1087. mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*96);
  1088. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1089. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1090. // cope with extensions
  1091. memset(MAVLINK_MSG_ID_DATA96_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DATA96_MIN_LEN);
  1092. }
  1093. #endif
  1094. memset(&packet2, 0, sizeof(packet2));
  1095. mavlink_msg_data96_encode(system_id, component_id, &msg, &packet1);
  1096. mavlink_msg_data96_decode(&msg, &packet2);
  1097. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1098. memset(&packet2, 0, sizeof(packet2));
  1099. mavlink_msg_data96_pack(system_id, component_id, &msg , packet1.type , packet1.len , packet1.data );
  1100. mavlink_msg_data96_decode(&msg, &packet2);
  1101. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1102. memset(&packet2, 0, sizeof(packet2));
  1103. mavlink_msg_data96_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.type , packet1.len , packet1.data );
  1104. mavlink_msg_data96_decode(&msg, &packet2);
  1105. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1106. memset(&packet2, 0, sizeof(packet2));
  1107. mavlink_msg_to_send_buffer(buffer, &msg);
  1108. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1109. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1110. }
  1111. mavlink_msg_data96_decode(last_msg, &packet2);
  1112. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1113. memset(&packet2, 0, sizeof(packet2));
  1114. mavlink_msg_data96_send(MAVLINK_COMM_1 , packet1.type , packet1.len , packet1.data );
  1115. mavlink_msg_data96_decode(last_msg, &packet2);
  1116. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1117. }
  1118. static void mavlink_test_rangefinder(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1119. {
  1120. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1121. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1122. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RANGEFINDER >= 256) {
  1123. return;
  1124. }
  1125. #endif
  1126. mavlink_message_t msg;
  1127. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1128. uint16_t i;
  1129. mavlink_rangefinder_t packet_in = {
  1130. 17.0,45.0
  1131. };
  1132. mavlink_rangefinder_t packet1, packet2;
  1133. memset(&packet1, 0, sizeof(packet1));
  1134. packet1.distance = packet_in.distance;
  1135. packet1.voltage = packet_in.voltage;
  1136. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1137. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1138. // cope with extensions
  1139. memset(MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RANGEFINDER_MIN_LEN);
  1140. }
  1141. #endif
  1142. memset(&packet2, 0, sizeof(packet2));
  1143. mavlink_msg_rangefinder_encode(system_id, component_id, &msg, &packet1);
  1144. mavlink_msg_rangefinder_decode(&msg, &packet2);
  1145. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1146. memset(&packet2, 0, sizeof(packet2));
  1147. mavlink_msg_rangefinder_pack(system_id, component_id, &msg , packet1.distance , packet1.voltage );
  1148. mavlink_msg_rangefinder_decode(&msg, &packet2);
  1149. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1150. memset(&packet2, 0, sizeof(packet2));
  1151. mavlink_msg_rangefinder_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.distance , packet1.voltage );
  1152. mavlink_msg_rangefinder_decode(&msg, &packet2);
  1153. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1154. memset(&packet2, 0, sizeof(packet2));
  1155. mavlink_msg_to_send_buffer(buffer, &msg);
  1156. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1157. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1158. }
  1159. mavlink_msg_rangefinder_decode(last_msg, &packet2);
  1160. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1161. memset(&packet2, 0, sizeof(packet2));
  1162. mavlink_msg_rangefinder_send(MAVLINK_COMM_1 , packet1.distance , packet1.voltage );
  1163. mavlink_msg_rangefinder_decode(last_msg, &packet2);
  1164. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1165. }
  1166. static void mavlink_test_airspeed_autocal(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1167. {
  1168. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1169. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1170. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AIRSPEED_AUTOCAL >= 256) {
  1171. return;
  1172. }
  1173. #endif
  1174. mavlink_message_t msg;
  1175. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1176. uint16_t i;
  1177. mavlink_airspeed_autocal_t packet_in = {
  1178. 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0
  1179. };
  1180. mavlink_airspeed_autocal_t packet1, packet2;
  1181. memset(&packet1, 0, sizeof(packet1));
  1182. packet1.vx = packet_in.vx;
  1183. packet1.vy = packet_in.vy;
  1184. packet1.vz = packet_in.vz;
  1185. packet1.diff_pressure = packet_in.diff_pressure;
  1186. packet1.EAS2TAS = packet_in.EAS2TAS;
  1187. packet1.ratio = packet_in.ratio;
  1188. packet1.state_x = packet_in.state_x;
  1189. packet1.state_y = packet_in.state_y;
  1190. packet1.state_z = packet_in.state_z;
  1191. packet1.Pax = packet_in.Pax;
  1192. packet1.Pby = packet_in.Pby;
  1193. packet1.Pcz = packet_in.Pcz;
  1194. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1195. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1196. // cope with extensions
  1197. memset(MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AIRSPEED_AUTOCAL_MIN_LEN);
  1198. }
  1199. #endif
  1200. memset(&packet2, 0, sizeof(packet2));
  1201. mavlink_msg_airspeed_autocal_encode(system_id, component_id, &msg, &packet1);
  1202. mavlink_msg_airspeed_autocal_decode(&msg, &packet2);
  1203. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1204. memset(&packet2, 0, sizeof(packet2));
  1205. mavlink_msg_airspeed_autocal_pack(system_id, component_id, &msg , packet1.vx , packet1.vy , packet1.vz , packet1.diff_pressure , packet1.EAS2TAS , packet1.ratio , packet1.state_x , packet1.state_y , packet1.state_z , packet1.Pax , packet1.Pby , packet1.Pcz );
  1206. mavlink_msg_airspeed_autocal_decode(&msg, &packet2);
  1207. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1208. memset(&packet2, 0, sizeof(packet2));
  1209. mavlink_msg_airspeed_autocal_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.vx , packet1.vy , packet1.vz , packet1.diff_pressure , packet1.EAS2TAS , packet1.ratio , packet1.state_x , packet1.state_y , packet1.state_z , packet1.Pax , packet1.Pby , packet1.Pcz );
  1210. mavlink_msg_airspeed_autocal_decode(&msg, &packet2);
  1211. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1212. memset(&packet2, 0, sizeof(packet2));
  1213. mavlink_msg_to_send_buffer(buffer, &msg);
  1214. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1215. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1216. }
  1217. mavlink_msg_airspeed_autocal_decode(last_msg, &packet2);
  1218. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1219. memset(&packet2, 0, sizeof(packet2));
  1220. mavlink_msg_airspeed_autocal_send(MAVLINK_COMM_1 , packet1.vx , packet1.vy , packet1.vz , packet1.diff_pressure , packet1.EAS2TAS , packet1.ratio , packet1.state_x , packet1.state_y , packet1.state_z , packet1.Pax , packet1.Pby , packet1.Pcz );
  1221. mavlink_msg_airspeed_autocal_decode(last_msg, &packet2);
  1222. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1223. }
  1224. static void mavlink_test_rally_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1225. {
  1226. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1227. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1228. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RALLY_POINT >= 256) {
  1229. return;
  1230. }
  1231. #endif
  1232. mavlink_message_t msg;
  1233. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1234. uint16_t i;
  1235. mavlink_rally_point_t packet_in = {
  1236. 963497464,963497672,17651,17755,17859,175,242,53,120,187
  1237. };
  1238. mavlink_rally_point_t packet1, packet2;
  1239. memset(&packet1, 0, sizeof(packet1));
  1240. packet1.lat = packet_in.lat;
  1241. packet1.lng = packet_in.lng;
  1242. packet1.alt = packet_in.alt;
  1243. packet1.break_alt = packet_in.break_alt;
  1244. packet1.land_dir = packet_in.land_dir;
  1245. packet1.target_system = packet_in.target_system;
  1246. packet1.target_component = packet_in.target_component;
  1247. packet1.idx = packet_in.idx;
  1248. packet1.count = packet_in.count;
  1249. packet1.flags = packet_in.flags;
  1250. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1251. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1252. // cope with extensions
  1253. memset(MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RALLY_POINT_MIN_LEN);
  1254. }
  1255. #endif
  1256. memset(&packet2, 0, sizeof(packet2));
  1257. mavlink_msg_rally_point_encode(system_id, component_id, &msg, &packet1);
  1258. mavlink_msg_rally_point_decode(&msg, &packet2);
  1259. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1260. memset(&packet2, 0, sizeof(packet2));
  1261. mavlink_msg_rally_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng , packet1.alt , packet1.break_alt , packet1.land_dir , packet1.flags );
  1262. mavlink_msg_rally_point_decode(&msg, &packet2);
  1263. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1264. memset(&packet2, 0, sizeof(packet2));
  1265. mavlink_msg_rally_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng , packet1.alt , packet1.break_alt , packet1.land_dir , packet1.flags );
  1266. mavlink_msg_rally_point_decode(&msg, &packet2);
  1267. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1268. memset(&packet2, 0, sizeof(packet2));
  1269. mavlink_msg_to_send_buffer(buffer, &msg);
  1270. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1271. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1272. }
  1273. mavlink_msg_rally_point_decode(last_msg, &packet2);
  1274. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1275. memset(&packet2, 0, sizeof(packet2));
  1276. mavlink_msg_rally_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx , packet1.count , packet1.lat , packet1.lng , packet1.alt , packet1.break_alt , packet1.land_dir , packet1.flags );
  1277. mavlink_msg_rally_point_decode(last_msg, &packet2);
  1278. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1279. }
  1280. static void mavlink_test_rally_fetch_point(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1281. {
  1282. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1283. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1284. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RALLY_FETCH_POINT >= 256) {
  1285. return;
  1286. }
  1287. #endif
  1288. mavlink_message_t msg;
  1289. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1290. uint16_t i;
  1291. mavlink_rally_fetch_point_t packet_in = {
  1292. 5,72,139
  1293. };
  1294. mavlink_rally_fetch_point_t packet1, packet2;
  1295. memset(&packet1, 0, sizeof(packet1));
  1296. packet1.target_system = packet_in.target_system;
  1297. packet1.target_component = packet_in.target_component;
  1298. packet1.idx = packet_in.idx;
  1299. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1300. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1301. // cope with extensions
  1302. memset(MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RALLY_FETCH_POINT_MIN_LEN);
  1303. }
  1304. #endif
  1305. memset(&packet2, 0, sizeof(packet2));
  1306. mavlink_msg_rally_fetch_point_encode(system_id, component_id, &msg, &packet1);
  1307. mavlink_msg_rally_fetch_point_decode(&msg, &packet2);
  1308. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1309. memset(&packet2, 0, sizeof(packet2));
  1310. mavlink_msg_rally_fetch_point_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.idx );
  1311. mavlink_msg_rally_fetch_point_decode(&msg, &packet2);
  1312. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1313. memset(&packet2, 0, sizeof(packet2));
  1314. mavlink_msg_rally_fetch_point_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.idx );
  1315. mavlink_msg_rally_fetch_point_decode(&msg, &packet2);
  1316. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1317. memset(&packet2, 0, sizeof(packet2));
  1318. mavlink_msg_to_send_buffer(buffer, &msg);
  1319. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1320. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1321. }
  1322. mavlink_msg_rally_fetch_point_decode(last_msg, &packet2);
  1323. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1324. memset(&packet2, 0, sizeof(packet2));
  1325. mavlink_msg_rally_fetch_point_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.idx );
  1326. mavlink_msg_rally_fetch_point_decode(last_msg, &packet2);
  1327. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1328. }
  1329. static void mavlink_test_compassmot_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1330. {
  1331. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1332. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1333. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_COMPASSMOT_STATUS >= 256) {
  1334. return;
  1335. }
  1336. #endif
  1337. mavlink_message_t msg;
  1338. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1339. uint16_t i;
  1340. mavlink_compassmot_status_t packet_in = {
  1341. 17.0,45.0,73.0,101.0,18067,18171
  1342. };
  1343. mavlink_compassmot_status_t packet1, packet2;
  1344. memset(&packet1, 0, sizeof(packet1));
  1345. packet1.current = packet_in.current;
  1346. packet1.CompensationX = packet_in.CompensationX;
  1347. packet1.CompensationY = packet_in.CompensationY;
  1348. packet1.CompensationZ = packet_in.CompensationZ;
  1349. packet1.throttle = packet_in.throttle;
  1350. packet1.interference = packet_in.interference;
  1351. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1352. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1353. // cope with extensions
  1354. memset(MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_COMPASSMOT_STATUS_MIN_LEN);
  1355. }
  1356. #endif
  1357. memset(&packet2, 0, sizeof(packet2));
  1358. mavlink_msg_compassmot_status_encode(system_id, component_id, &msg, &packet1);
  1359. mavlink_msg_compassmot_status_decode(&msg, &packet2);
  1360. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1361. memset(&packet2, 0, sizeof(packet2));
  1362. mavlink_msg_compassmot_status_pack(system_id, component_id, &msg , packet1.throttle , packet1.current , packet1.interference , packet1.CompensationX , packet1.CompensationY , packet1.CompensationZ );
  1363. mavlink_msg_compassmot_status_decode(&msg, &packet2);
  1364. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1365. memset(&packet2, 0, sizeof(packet2));
  1366. mavlink_msg_compassmot_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.throttle , packet1.current , packet1.interference , packet1.CompensationX , packet1.CompensationY , packet1.CompensationZ );
  1367. mavlink_msg_compassmot_status_decode(&msg, &packet2);
  1368. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1369. memset(&packet2, 0, sizeof(packet2));
  1370. mavlink_msg_to_send_buffer(buffer, &msg);
  1371. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1372. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1373. }
  1374. mavlink_msg_compassmot_status_decode(last_msg, &packet2);
  1375. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1376. memset(&packet2, 0, sizeof(packet2));
  1377. mavlink_msg_compassmot_status_send(MAVLINK_COMM_1 , packet1.throttle , packet1.current , packet1.interference , packet1.CompensationX , packet1.CompensationY , packet1.CompensationZ );
  1378. mavlink_msg_compassmot_status_decode(last_msg, &packet2);
  1379. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1380. }
  1381. static void mavlink_test_ahrs2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1382. {
  1383. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1384. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1385. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AHRS2 >= 256) {
  1386. return;
  1387. }
  1388. #endif
  1389. mavlink_message_t msg;
  1390. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1391. uint16_t i;
  1392. mavlink_ahrs2_t packet_in = {
  1393. 17.0,45.0,73.0,101.0,963498296,963498504
  1394. };
  1395. mavlink_ahrs2_t packet1, packet2;
  1396. memset(&packet1, 0, sizeof(packet1));
  1397. packet1.roll = packet_in.roll;
  1398. packet1.pitch = packet_in.pitch;
  1399. packet1.yaw = packet_in.yaw;
  1400. packet1.altitude = packet_in.altitude;
  1401. packet1.lat = packet_in.lat;
  1402. packet1.lng = packet_in.lng;
  1403. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1404. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1405. // cope with extensions
  1406. memset(MAVLINK_MSG_ID_AHRS2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AHRS2_MIN_LEN);
  1407. }
  1408. #endif
  1409. memset(&packet2, 0, sizeof(packet2));
  1410. mavlink_msg_ahrs2_encode(system_id, component_id, &msg, &packet1);
  1411. mavlink_msg_ahrs2_decode(&msg, &packet2);
  1412. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1413. memset(&packet2, 0, sizeof(packet2));
  1414. mavlink_msg_ahrs2_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng );
  1415. mavlink_msg_ahrs2_decode(&msg, &packet2);
  1416. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1417. memset(&packet2, 0, sizeof(packet2));
  1418. mavlink_msg_ahrs2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng );
  1419. mavlink_msg_ahrs2_decode(&msg, &packet2);
  1420. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1421. memset(&packet2, 0, sizeof(packet2));
  1422. mavlink_msg_to_send_buffer(buffer, &msg);
  1423. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1424. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1425. }
  1426. mavlink_msg_ahrs2_decode(last_msg, &packet2);
  1427. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1428. memset(&packet2, 0, sizeof(packet2));
  1429. mavlink_msg_ahrs2_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng );
  1430. mavlink_msg_ahrs2_decode(last_msg, &packet2);
  1431. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1432. }
  1433. static void mavlink_test_camera_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1434. {
  1435. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1436. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1437. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_STATUS >= 256) {
  1438. return;
  1439. }
  1440. #endif
  1441. mavlink_message_t msg;
  1442. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1443. uint16_t i;
  1444. mavlink_camera_status_t packet_in = {
  1445. 93372036854775807ULL,73.0,101.0,129.0,157.0,18483,211,22,89
  1446. };
  1447. mavlink_camera_status_t packet1, packet2;
  1448. memset(&packet1, 0, sizeof(packet1));
  1449. packet1.time_usec = packet_in.time_usec;
  1450. packet1.p1 = packet_in.p1;
  1451. packet1.p2 = packet_in.p2;
  1452. packet1.p3 = packet_in.p3;
  1453. packet1.p4 = packet_in.p4;
  1454. packet1.img_idx = packet_in.img_idx;
  1455. packet1.target_system = packet_in.target_system;
  1456. packet1.cam_idx = packet_in.cam_idx;
  1457. packet1.event_id = packet_in.event_id;
  1458. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1459. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1460. // cope with extensions
  1461. memset(MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_STATUS_MIN_LEN);
  1462. }
  1463. #endif
  1464. memset(&packet2, 0, sizeof(packet2));
  1465. mavlink_msg_camera_status_encode(system_id, component_id, &msg, &packet1);
  1466. mavlink_msg_camera_status_decode(&msg, &packet2);
  1467. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1468. memset(&packet2, 0, sizeof(packet2));
  1469. mavlink_msg_camera_status_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
  1470. mavlink_msg_camera_status_decode(&msg, &packet2);
  1471. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1472. memset(&packet2, 0, sizeof(packet2));
  1473. mavlink_msg_camera_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
  1474. mavlink_msg_camera_status_decode(&msg, &packet2);
  1475. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1476. memset(&packet2, 0, sizeof(packet2));
  1477. mavlink_msg_to_send_buffer(buffer, &msg);
  1478. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1479. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1480. }
  1481. mavlink_msg_camera_status_decode(last_msg, &packet2);
  1482. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1483. memset(&packet2, 0, sizeof(packet2));
  1484. mavlink_msg_camera_status_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.event_id , packet1.p1 , packet1.p2 , packet1.p3 , packet1.p4 );
  1485. mavlink_msg_camera_status_decode(last_msg, &packet2);
  1486. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1487. }
  1488. static void mavlink_test_camera_feedback(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1489. {
  1490. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1491. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1492. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_CAMERA_FEEDBACK >= 256) {
  1493. return;
  1494. }
  1495. #endif
  1496. mavlink_message_t msg;
  1497. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1498. uint16_t i;
  1499. mavlink_camera_feedback_t packet_in = {
  1500. 93372036854775807ULL,963497880,963498088,129.0,157.0,185.0,213.0,241.0,269.0,19315,3,70,137,19575
  1501. };
  1502. mavlink_camera_feedback_t packet1, packet2;
  1503. memset(&packet1, 0, sizeof(packet1));
  1504. packet1.time_usec = packet_in.time_usec;
  1505. packet1.lat = packet_in.lat;
  1506. packet1.lng = packet_in.lng;
  1507. packet1.alt_msl = packet_in.alt_msl;
  1508. packet1.alt_rel = packet_in.alt_rel;
  1509. packet1.roll = packet_in.roll;
  1510. packet1.pitch = packet_in.pitch;
  1511. packet1.yaw = packet_in.yaw;
  1512. packet1.foc_len = packet_in.foc_len;
  1513. packet1.img_idx = packet_in.img_idx;
  1514. packet1.target_system = packet_in.target_system;
  1515. packet1.cam_idx = packet_in.cam_idx;
  1516. packet1.flags = packet_in.flags;
  1517. packet1.completed_captures = packet_in.completed_captures;
  1518. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1519. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1520. // cope with extensions
  1521. memset(MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_CAMERA_FEEDBACK_MIN_LEN);
  1522. }
  1523. #endif
  1524. memset(&packet2, 0, sizeof(packet2));
  1525. mavlink_msg_camera_feedback_encode(system_id, component_id, &msg, &packet1);
  1526. mavlink_msg_camera_feedback_decode(&msg, &packet2);
  1527. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1528. memset(&packet2, 0, sizeof(packet2));
  1529. mavlink_msg_camera_feedback_pack(system_id, component_id, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt_msl , packet1.alt_rel , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags , packet1.completed_captures );
  1530. mavlink_msg_camera_feedback_decode(&msg, &packet2);
  1531. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1532. memset(&packet2, 0, sizeof(packet2));
  1533. mavlink_msg_camera_feedback_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt_msl , packet1.alt_rel , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags , packet1.completed_captures );
  1534. mavlink_msg_camera_feedback_decode(&msg, &packet2);
  1535. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1536. memset(&packet2, 0, sizeof(packet2));
  1537. mavlink_msg_to_send_buffer(buffer, &msg);
  1538. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1539. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1540. }
  1541. mavlink_msg_camera_feedback_decode(last_msg, &packet2);
  1542. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1543. memset(&packet2, 0, sizeof(packet2));
  1544. mavlink_msg_camera_feedback_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.target_system , packet1.cam_idx , packet1.img_idx , packet1.lat , packet1.lng , packet1.alt_msl , packet1.alt_rel , packet1.roll , packet1.pitch , packet1.yaw , packet1.foc_len , packet1.flags , packet1.completed_captures );
  1545. mavlink_msg_camera_feedback_decode(last_msg, &packet2);
  1546. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1547. }
  1548. static void mavlink_test_battery2(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1549. {
  1550. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1551. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1552. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_BATTERY2 >= 256) {
  1553. return;
  1554. }
  1555. #endif
  1556. mavlink_message_t msg;
  1557. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1558. uint16_t i;
  1559. mavlink_battery2_t packet_in = {
  1560. 17235,17339
  1561. };
  1562. mavlink_battery2_t packet1, packet2;
  1563. memset(&packet1, 0, sizeof(packet1));
  1564. packet1.voltage = packet_in.voltage;
  1565. packet1.current_battery = packet_in.current_battery;
  1566. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1567. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1568. // cope with extensions
  1569. memset(MAVLINK_MSG_ID_BATTERY2_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_BATTERY2_MIN_LEN);
  1570. }
  1571. #endif
  1572. memset(&packet2, 0, sizeof(packet2));
  1573. mavlink_msg_battery2_encode(system_id, component_id, &msg, &packet1);
  1574. mavlink_msg_battery2_decode(&msg, &packet2);
  1575. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1576. memset(&packet2, 0, sizeof(packet2));
  1577. mavlink_msg_battery2_pack(system_id, component_id, &msg , packet1.voltage , packet1.current_battery );
  1578. mavlink_msg_battery2_decode(&msg, &packet2);
  1579. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1580. memset(&packet2, 0, sizeof(packet2));
  1581. mavlink_msg_battery2_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.voltage , packet1.current_battery );
  1582. mavlink_msg_battery2_decode(&msg, &packet2);
  1583. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1584. memset(&packet2, 0, sizeof(packet2));
  1585. mavlink_msg_to_send_buffer(buffer, &msg);
  1586. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1587. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1588. }
  1589. mavlink_msg_battery2_decode(last_msg, &packet2);
  1590. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1591. memset(&packet2, 0, sizeof(packet2));
  1592. mavlink_msg_battery2_send(MAVLINK_COMM_1 , packet1.voltage , packet1.current_battery );
  1593. mavlink_msg_battery2_decode(last_msg, &packet2);
  1594. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1595. }
  1596. static void mavlink_test_ahrs3(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1597. {
  1598. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1599. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1600. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AHRS3 >= 256) {
  1601. return;
  1602. }
  1603. #endif
  1604. mavlink_message_t msg;
  1605. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1606. uint16_t i;
  1607. mavlink_ahrs3_t packet_in = {
  1608. 17.0,45.0,73.0,101.0,963498296,963498504,185.0,213.0,241.0,269.0
  1609. };
  1610. mavlink_ahrs3_t packet1, packet2;
  1611. memset(&packet1, 0, sizeof(packet1));
  1612. packet1.roll = packet_in.roll;
  1613. packet1.pitch = packet_in.pitch;
  1614. packet1.yaw = packet_in.yaw;
  1615. packet1.altitude = packet_in.altitude;
  1616. packet1.lat = packet_in.lat;
  1617. packet1.lng = packet_in.lng;
  1618. packet1.v1 = packet_in.v1;
  1619. packet1.v2 = packet_in.v2;
  1620. packet1.v3 = packet_in.v3;
  1621. packet1.v4 = packet_in.v4;
  1622. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1623. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1624. // cope with extensions
  1625. memset(MAVLINK_MSG_ID_AHRS3_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AHRS3_MIN_LEN);
  1626. }
  1627. #endif
  1628. memset(&packet2, 0, sizeof(packet2));
  1629. mavlink_msg_ahrs3_encode(system_id, component_id, &msg, &packet1);
  1630. mavlink_msg_ahrs3_decode(&msg, &packet2);
  1631. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1632. memset(&packet2, 0, sizeof(packet2));
  1633. mavlink_msg_ahrs3_pack(system_id, component_id, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
  1634. mavlink_msg_ahrs3_decode(&msg, &packet2);
  1635. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1636. memset(&packet2, 0, sizeof(packet2));
  1637. mavlink_msg_ahrs3_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
  1638. mavlink_msg_ahrs3_decode(&msg, &packet2);
  1639. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1640. memset(&packet2, 0, sizeof(packet2));
  1641. mavlink_msg_to_send_buffer(buffer, &msg);
  1642. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1643. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1644. }
  1645. mavlink_msg_ahrs3_decode(last_msg, &packet2);
  1646. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1647. memset(&packet2, 0, sizeof(packet2));
  1648. mavlink_msg_ahrs3_send(MAVLINK_COMM_1 , packet1.roll , packet1.pitch , packet1.yaw , packet1.altitude , packet1.lat , packet1.lng , packet1.v1 , packet1.v2 , packet1.v3 , packet1.v4 );
  1649. mavlink_msg_ahrs3_decode(last_msg, &packet2);
  1650. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1651. }
  1652. static void mavlink_test_autopilot_version_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1653. {
  1654. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1655. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1656. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST >= 256) {
  1657. return;
  1658. }
  1659. #endif
  1660. mavlink_message_t msg;
  1661. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1662. uint16_t i;
  1663. mavlink_autopilot_version_request_t packet_in = {
  1664. 5,72
  1665. };
  1666. mavlink_autopilot_version_request_t packet1, packet2;
  1667. memset(&packet1, 0, sizeof(packet1));
  1668. packet1.target_system = packet_in.target_system;
  1669. packet1.target_component = packet_in.target_component;
  1670. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1671. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1672. // cope with extensions
  1673. memset(MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AUTOPILOT_VERSION_REQUEST_MIN_LEN);
  1674. }
  1675. #endif
  1676. memset(&packet2, 0, sizeof(packet2));
  1677. mavlink_msg_autopilot_version_request_encode(system_id, component_id, &msg, &packet1);
  1678. mavlink_msg_autopilot_version_request_decode(&msg, &packet2);
  1679. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1680. memset(&packet2, 0, sizeof(packet2));
  1681. mavlink_msg_autopilot_version_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component );
  1682. mavlink_msg_autopilot_version_request_decode(&msg, &packet2);
  1683. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1684. memset(&packet2, 0, sizeof(packet2));
  1685. mavlink_msg_autopilot_version_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component );
  1686. mavlink_msg_autopilot_version_request_decode(&msg, &packet2);
  1687. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1688. memset(&packet2, 0, sizeof(packet2));
  1689. mavlink_msg_to_send_buffer(buffer, &msg);
  1690. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1691. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1692. }
  1693. mavlink_msg_autopilot_version_request_decode(last_msg, &packet2);
  1694. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1695. memset(&packet2, 0, sizeof(packet2));
  1696. mavlink_msg_autopilot_version_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component );
  1697. mavlink_msg_autopilot_version_request_decode(last_msg, &packet2);
  1698. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1699. }
  1700. static void mavlink_test_remote_log_data_block(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1701. {
  1702. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1703. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1704. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK >= 256) {
  1705. return;
  1706. }
  1707. #endif
  1708. mavlink_message_t msg;
  1709. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1710. uint16_t i;
  1711. mavlink_remote_log_data_block_t packet_in = {
  1712. 963497464,17,84,{ 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, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 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 }
  1713. };
  1714. mavlink_remote_log_data_block_t packet1, packet2;
  1715. memset(&packet1, 0, sizeof(packet1));
  1716. packet1.seqno = packet_in.seqno;
  1717. packet1.target_system = packet_in.target_system;
  1718. packet1.target_component = packet_in.target_component;
  1719. mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*200);
  1720. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1721. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1722. // cope with extensions
  1723. memset(MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_REMOTE_LOG_DATA_BLOCK_MIN_LEN);
  1724. }
  1725. #endif
  1726. memset(&packet2, 0, sizeof(packet2));
  1727. mavlink_msg_remote_log_data_block_encode(system_id, component_id, &msg, &packet1);
  1728. mavlink_msg_remote_log_data_block_decode(&msg, &packet2);
  1729. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1730. memset(&packet2, 0, sizeof(packet2));
  1731. mavlink_msg_remote_log_data_block_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seqno , packet1.data );
  1732. mavlink_msg_remote_log_data_block_decode(&msg, &packet2);
  1733. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1734. memset(&packet2, 0, sizeof(packet2));
  1735. mavlink_msg_remote_log_data_block_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seqno , packet1.data );
  1736. mavlink_msg_remote_log_data_block_decode(&msg, &packet2);
  1737. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1738. memset(&packet2, 0, sizeof(packet2));
  1739. mavlink_msg_to_send_buffer(buffer, &msg);
  1740. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1741. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1742. }
  1743. mavlink_msg_remote_log_data_block_decode(last_msg, &packet2);
  1744. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1745. memset(&packet2, 0, sizeof(packet2));
  1746. mavlink_msg_remote_log_data_block_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seqno , packet1.data );
  1747. mavlink_msg_remote_log_data_block_decode(last_msg, &packet2);
  1748. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1749. }
  1750. static void mavlink_test_remote_log_block_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1751. {
  1752. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1753. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1754. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS >= 256) {
  1755. return;
  1756. }
  1757. #endif
  1758. mavlink_message_t msg;
  1759. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1760. uint16_t i;
  1761. mavlink_remote_log_block_status_t packet_in = {
  1762. 963497464,17,84,151
  1763. };
  1764. mavlink_remote_log_block_status_t packet1, packet2;
  1765. memset(&packet1, 0, sizeof(packet1));
  1766. packet1.seqno = packet_in.seqno;
  1767. packet1.target_system = packet_in.target_system;
  1768. packet1.target_component = packet_in.target_component;
  1769. packet1.status = packet_in.status;
  1770. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1771. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1772. // cope with extensions
  1773. memset(MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_REMOTE_LOG_BLOCK_STATUS_MIN_LEN);
  1774. }
  1775. #endif
  1776. memset(&packet2, 0, sizeof(packet2));
  1777. mavlink_msg_remote_log_block_status_encode(system_id, component_id, &msg, &packet1);
  1778. mavlink_msg_remote_log_block_status_decode(&msg, &packet2);
  1779. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1780. memset(&packet2, 0, sizeof(packet2));
  1781. mavlink_msg_remote_log_block_status_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.seqno , packet1.status );
  1782. mavlink_msg_remote_log_block_status_decode(&msg, &packet2);
  1783. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1784. memset(&packet2, 0, sizeof(packet2));
  1785. mavlink_msg_remote_log_block_status_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.seqno , packet1.status );
  1786. mavlink_msg_remote_log_block_status_decode(&msg, &packet2);
  1787. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1788. memset(&packet2, 0, sizeof(packet2));
  1789. mavlink_msg_to_send_buffer(buffer, &msg);
  1790. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1791. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1792. }
  1793. mavlink_msg_remote_log_block_status_decode(last_msg, &packet2);
  1794. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1795. memset(&packet2, 0, sizeof(packet2));
  1796. mavlink_msg_remote_log_block_status_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.seqno , packet1.status );
  1797. mavlink_msg_remote_log_block_status_decode(last_msg, &packet2);
  1798. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1799. }
  1800. static void mavlink_test_led_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1801. {
  1802. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1803. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1804. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_LED_CONTROL >= 256) {
  1805. return;
  1806. }
  1807. #endif
  1808. mavlink_message_t msg;
  1809. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1810. uint16_t i;
  1811. mavlink_led_control_t packet_in = {
  1812. 5,72,139,206,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 }
  1813. };
  1814. mavlink_led_control_t packet1, packet2;
  1815. memset(&packet1, 0, sizeof(packet1));
  1816. packet1.target_system = packet_in.target_system;
  1817. packet1.target_component = packet_in.target_component;
  1818. packet1.instance = packet_in.instance;
  1819. packet1.pattern = packet_in.pattern;
  1820. packet1.custom_len = packet_in.custom_len;
  1821. mav_array_memcpy(packet1.custom_bytes, packet_in.custom_bytes, sizeof(uint8_t)*24);
  1822. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1823. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1824. // cope with extensions
  1825. memset(MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_LED_CONTROL_MIN_LEN);
  1826. }
  1827. #endif
  1828. memset(&packet2, 0, sizeof(packet2));
  1829. mavlink_msg_led_control_encode(system_id, component_id, &msg, &packet1);
  1830. mavlink_msg_led_control_decode(&msg, &packet2);
  1831. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1832. memset(&packet2, 0, sizeof(packet2));
  1833. mavlink_msg_led_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.instance , packet1.pattern , packet1.custom_len , packet1.custom_bytes );
  1834. mavlink_msg_led_control_decode(&msg, &packet2);
  1835. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1836. memset(&packet2, 0, sizeof(packet2));
  1837. mavlink_msg_led_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.instance , packet1.pattern , packet1.custom_len , packet1.custom_bytes );
  1838. mavlink_msg_led_control_decode(&msg, &packet2);
  1839. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1840. memset(&packet2, 0, sizeof(packet2));
  1841. mavlink_msg_to_send_buffer(buffer, &msg);
  1842. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1843. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1844. }
  1845. mavlink_msg_led_control_decode(last_msg, &packet2);
  1846. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1847. memset(&packet2, 0, sizeof(packet2));
  1848. mavlink_msg_led_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.instance , packet1.pattern , packet1.custom_len , packet1.custom_bytes );
  1849. mavlink_msg_led_control_decode(last_msg, &packet2);
  1850. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1851. }
  1852. static void mavlink_test_mag_cal_progress(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1853. {
  1854. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1855. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1856. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MAG_CAL_PROGRESS >= 256) {
  1857. return;
  1858. }
  1859. #endif
  1860. mavlink_message_t msg;
  1861. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1862. uint16_t i;
  1863. mavlink_mag_cal_progress_t packet_in = {
  1864. 17.0,45.0,73.0,41,108,175,242,53,{ 120, 121, 122, 123, 124, 125, 126, 127, 128, 129 }
  1865. };
  1866. mavlink_mag_cal_progress_t packet1, packet2;
  1867. memset(&packet1, 0, sizeof(packet1));
  1868. packet1.direction_x = packet_in.direction_x;
  1869. packet1.direction_y = packet_in.direction_y;
  1870. packet1.direction_z = packet_in.direction_z;
  1871. packet1.compass_id = packet_in.compass_id;
  1872. packet1.cal_mask = packet_in.cal_mask;
  1873. packet1.cal_status = packet_in.cal_status;
  1874. packet1.attempt = packet_in.attempt;
  1875. packet1.completion_pct = packet_in.completion_pct;
  1876. mav_array_memcpy(packet1.completion_mask, packet_in.completion_mask, sizeof(uint8_t)*10);
  1877. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1878. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1879. // cope with extensions
  1880. memset(MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MAG_CAL_PROGRESS_MIN_LEN);
  1881. }
  1882. #endif
  1883. memset(&packet2, 0, sizeof(packet2));
  1884. mavlink_msg_mag_cal_progress_encode(system_id, component_id, &msg, &packet1);
  1885. mavlink_msg_mag_cal_progress_decode(&msg, &packet2);
  1886. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1887. memset(&packet2, 0, sizeof(packet2));
  1888. mavlink_msg_mag_cal_progress_pack(system_id, component_id, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.attempt , packet1.completion_pct , packet1.completion_mask , packet1.direction_x , packet1.direction_y , packet1.direction_z );
  1889. mavlink_msg_mag_cal_progress_decode(&msg, &packet2);
  1890. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1891. memset(&packet2, 0, sizeof(packet2));
  1892. mavlink_msg_mag_cal_progress_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.attempt , packet1.completion_pct , packet1.completion_mask , packet1.direction_x , packet1.direction_y , packet1.direction_z );
  1893. mavlink_msg_mag_cal_progress_decode(&msg, &packet2);
  1894. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1895. memset(&packet2, 0, sizeof(packet2));
  1896. mavlink_msg_to_send_buffer(buffer, &msg);
  1897. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1898. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1899. }
  1900. mavlink_msg_mag_cal_progress_decode(last_msg, &packet2);
  1901. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1902. memset(&packet2, 0, sizeof(packet2));
  1903. mavlink_msg_mag_cal_progress_send(MAVLINK_COMM_1 , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.attempt , packet1.completion_pct , packet1.completion_mask , packet1.direction_x , packet1.direction_y , packet1.direction_z );
  1904. mavlink_msg_mag_cal_progress_decode(last_msg, &packet2);
  1905. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1906. }
  1907. static void mavlink_test_mag_cal_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1908. {
  1909. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1910. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1911. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_MAG_CAL_REPORT >= 256) {
  1912. return;
  1913. }
  1914. #endif
  1915. mavlink_message_t msg;
  1916. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1917. uint16_t i;
  1918. mavlink_mag_cal_report_t packet_in = {
  1919. 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192,3,70,325.0,149,216
  1920. };
  1921. mavlink_mag_cal_report_t packet1, packet2;
  1922. memset(&packet1, 0, sizeof(packet1));
  1923. packet1.fitness = packet_in.fitness;
  1924. packet1.ofs_x = packet_in.ofs_x;
  1925. packet1.ofs_y = packet_in.ofs_y;
  1926. packet1.ofs_z = packet_in.ofs_z;
  1927. packet1.diag_x = packet_in.diag_x;
  1928. packet1.diag_y = packet_in.diag_y;
  1929. packet1.diag_z = packet_in.diag_z;
  1930. packet1.offdiag_x = packet_in.offdiag_x;
  1931. packet1.offdiag_y = packet_in.offdiag_y;
  1932. packet1.offdiag_z = packet_in.offdiag_z;
  1933. packet1.compass_id = packet_in.compass_id;
  1934. packet1.cal_mask = packet_in.cal_mask;
  1935. packet1.cal_status = packet_in.cal_status;
  1936. packet1.autosaved = packet_in.autosaved;
  1937. packet1.orientation_confidence = packet_in.orientation_confidence;
  1938. packet1.old_orientation = packet_in.old_orientation;
  1939. packet1.new_orientation = packet_in.new_orientation;
  1940. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1941. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1942. // cope with extensions
  1943. memset(MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_MAG_CAL_REPORT_MIN_LEN);
  1944. }
  1945. #endif
  1946. memset(&packet2, 0, sizeof(packet2));
  1947. mavlink_msg_mag_cal_report_encode(system_id, component_id, &msg, &packet1);
  1948. mavlink_msg_mag_cal_report_decode(&msg, &packet2);
  1949. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1950. memset(&packet2, 0, sizeof(packet2));
  1951. mavlink_msg_mag_cal_report_pack(system_id, component_id, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z , packet1.orientation_confidence , packet1.old_orientation , packet1.new_orientation );
  1952. mavlink_msg_mag_cal_report_decode(&msg, &packet2);
  1953. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1954. memset(&packet2, 0, sizeof(packet2));
  1955. mavlink_msg_mag_cal_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z , packet1.orientation_confidence , packet1.old_orientation , packet1.new_orientation );
  1956. mavlink_msg_mag_cal_report_decode(&msg, &packet2);
  1957. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1958. memset(&packet2, 0, sizeof(packet2));
  1959. mavlink_msg_to_send_buffer(buffer, &msg);
  1960. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  1961. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  1962. }
  1963. mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
  1964. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1965. memset(&packet2, 0, sizeof(packet2));
  1966. mavlink_msg_mag_cal_report_send(MAVLINK_COMM_1 , packet1.compass_id , packet1.cal_mask , packet1.cal_status , packet1.autosaved , packet1.fitness , packet1.ofs_x , packet1.ofs_y , packet1.ofs_z , packet1.diag_x , packet1.diag_y , packet1.diag_z , packet1.offdiag_x , packet1.offdiag_y , packet1.offdiag_z , packet1.orientation_confidence , packet1.old_orientation , packet1.new_orientation );
  1967. mavlink_msg_mag_cal_report_decode(last_msg, &packet2);
  1968. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  1969. }
  1970. static void mavlink_test_ekf_status_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  1971. {
  1972. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1973. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  1974. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_EKF_STATUS_REPORT >= 256) {
  1975. return;
  1976. }
  1977. #endif
  1978. mavlink_message_t msg;
  1979. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  1980. uint16_t i;
  1981. mavlink_ekf_status_report_t packet_in = {
  1982. 17.0,45.0,73.0,101.0,129.0,18275,171.0
  1983. };
  1984. mavlink_ekf_status_report_t packet1, packet2;
  1985. memset(&packet1, 0, sizeof(packet1));
  1986. packet1.velocity_variance = packet_in.velocity_variance;
  1987. packet1.pos_horiz_variance = packet_in.pos_horiz_variance;
  1988. packet1.pos_vert_variance = packet_in.pos_vert_variance;
  1989. packet1.compass_variance = packet_in.compass_variance;
  1990. packet1.terrain_alt_variance = packet_in.terrain_alt_variance;
  1991. packet1.flags = packet_in.flags;
  1992. packet1.airspeed_variance = packet_in.airspeed_variance;
  1993. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  1994. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  1995. // cope with extensions
  1996. memset(MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_EKF_STATUS_REPORT_MIN_LEN);
  1997. }
  1998. #endif
  1999. memset(&packet2, 0, sizeof(packet2));
  2000. mavlink_msg_ekf_status_report_encode(system_id, component_id, &msg, &packet1);
  2001. mavlink_msg_ekf_status_report_decode(&msg, &packet2);
  2002. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2003. memset(&packet2, 0, sizeof(packet2));
  2004. mavlink_msg_ekf_status_report_pack(system_id, component_id, &msg , packet1.flags , packet1.velocity_variance , packet1.pos_horiz_variance , packet1.pos_vert_variance , packet1.compass_variance , packet1.terrain_alt_variance , packet1.airspeed_variance );
  2005. mavlink_msg_ekf_status_report_decode(&msg, &packet2);
  2006. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2007. memset(&packet2, 0, sizeof(packet2));
  2008. mavlink_msg_ekf_status_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.flags , packet1.velocity_variance , packet1.pos_horiz_variance , packet1.pos_vert_variance , packet1.compass_variance , packet1.terrain_alt_variance , packet1.airspeed_variance );
  2009. mavlink_msg_ekf_status_report_decode(&msg, &packet2);
  2010. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2011. memset(&packet2, 0, sizeof(packet2));
  2012. mavlink_msg_to_send_buffer(buffer, &msg);
  2013. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2014. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2015. }
  2016. mavlink_msg_ekf_status_report_decode(last_msg, &packet2);
  2017. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2018. memset(&packet2, 0, sizeof(packet2));
  2019. mavlink_msg_ekf_status_report_send(MAVLINK_COMM_1 , packet1.flags , packet1.velocity_variance , packet1.pos_horiz_variance , packet1.pos_vert_variance , packet1.compass_variance , packet1.terrain_alt_variance , packet1.airspeed_variance );
  2020. mavlink_msg_ekf_status_report_decode(last_msg, &packet2);
  2021. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2022. }
  2023. static void mavlink_test_pid_tuning(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2024. {
  2025. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2026. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2027. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_PID_TUNING >= 256) {
  2028. return;
  2029. }
  2030. #endif
  2031. mavlink_message_t msg;
  2032. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2033. uint16_t i;
  2034. mavlink_pid_tuning_t packet_in = {
  2035. 17.0,45.0,73.0,101.0,129.0,157.0,77
  2036. };
  2037. mavlink_pid_tuning_t packet1, packet2;
  2038. memset(&packet1, 0, sizeof(packet1));
  2039. packet1.desired = packet_in.desired;
  2040. packet1.achieved = packet_in.achieved;
  2041. packet1.FF = packet_in.FF;
  2042. packet1.P = packet_in.P;
  2043. packet1.I = packet_in.I;
  2044. packet1.D = packet_in.D;
  2045. packet1.axis = packet_in.axis;
  2046. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2047. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2048. // cope with extensions
  2049. memset(MAVLINK_MSG_ID_PID_TUNING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_PID_TUNING_MIN_LEN);
  2050. }
  2051. #endif
  2052. memset(&packet2, 0, sizeof(packet2));
  2053. mavlink_msg_pid_tuning_encode(system_id, component_id, &msg, &packet1);
  2054. mavlink_msg_pid_tuning_decode(&msg, &packet2);
  2055. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2056. memset(&packet2, 0, sizeof(packet2));
  2057. mavlink_msg_pid_tuning_pack(system_id, component_id, &msg , packet1.axis , packet1.desired , packet1.achieved , packet1.FF , packet1.P , packet1.I , packet1.D );
  2058. mavlink_msg_pid_tuning_decode(&msg, &packet2);
  2059. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2060. memset(&packet2, 0, sizeof(packet2));
  2061. mavlink_msg_pid_tuning_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.axis , packet1.desired , packet1.achieved , packet1.FF , packet1.P , packet1.I , packet1.D );
  2062. mavlink_msg_pid_tuning_decode(&msg, &packet2);
  2063. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2064. memset(&packet2, 0, sizeof(packet2));
  2065. mavlink_msg_to_send_buffer(buffer, &msg);
  2066. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2067. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2068. }
  2069. mavlink_msg_pid_tuning_decode(last_msg, &packet2);
  2070. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2071. memset(&packet2, 0, sizeof(packet2));
  2072. mavlink_msg_pid_tuning_send(MAVLINK_COMM_1 , packet1.axis , packet1.desired , packet1.achieved , packet1.FF , packet1.P , packet1.I , packet1.D );
  2073. mavlink_msg_pid_tuning_decode(last_msg, &packet2);
  2074. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2075. }
  2076. static void mavlink_test_deepstall(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2077. {
  2078. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2079. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2080. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEEPSTALL >= 256) {
  2081. return;
  2082. }
  2083. #endif
  2084. mavlink_message_t msg;
  2085. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2086. uint16_t i;
  2087. mavlink_deepstall_t packet_in = {
  2088. 963497464,963497672,963497880,963498088,963498296,963498504,185.0,213.0,241.0,113
  2089. };
  2090. mavlink_deepstall_t packet1, packet2;
  2091. memset(&packet1, 0, sizeof(packet1));
  2092. packet1.landing_lat = packet_in.landing_lat;
  2093. packet1.landing_lon = packet_in.landing_lon;
  2094. packet1.path_lat = packet_in.path_lat;
  2095. packet1.path_lon = packet_in.path_lon;
  2096. packet1.arc_entry_lat = packet_in.arc_entry_lat;
  2097. packet1.arc_entry_lon = packet_in.arc_entry_lon;
  2098. packet1.altitude = packet_in.altitude;
  2099. packet1.expected_travel_distance = packet_in.expected_travel_distance;
  2100. packet1.cross_track_error = packet_in.cross_track_error;
  2101. packet1.stage = packet_in.stage;
  2102. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2103. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2104. // cope with extensions
  2105. memset(MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEEPSTALL_MIN_LEN);
  2106. }
  2107. #endif
  2108. memset(&packet2, 0, sizeof(packet2));
  2109. mavlink_msg_deepstall_encode(system_id, component_id, &msg, &packet1);
  2110. mavlink_msg_deepstall_decode(&msg, &packet2);
  2111. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2112. memset(&packet2, 0, sizeof(packet2));
  2113. mavlink_msg_deepstall_pack(system_id, component_id, &msg , packet1.landing_lat , packet1.landing_lon , packet1.path_lat , packet1.path_lon , packet1.arc_entry_lat , packet1.arc_entry_lon , packet1.altitude , packet1.expected_travel_distance , packet1.cross_track_error , packet1.stage );
  2114. mavlink_msg_deepstall_decode(&msg, &packet2);
  2115. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2116. memset(&packet2, 0, sizeof(packet2));
  2117. mavlink_msg_deepstall_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.landing_lat , packet1.landing_lon , packet1.path_lat , packet1.path_lon , packet1.arc_entry_lat , packet1.arc_entry_lon , packet1.altitude , packet1.expected_travel_distance , packet1.cross_track_error , packet1.stage );
  2118. mavlink_msg_deepstall_decode(&msg, &packet2);
  2119. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2120. memset(&packet2, 0, sizeof(packet2));
  2121. mavlink_msg_to_send_buffer(buffer, &msg);
  2122. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2123. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2124. }
  2125. mavlink_msg_deepstall_decode(last_msg, &packet2);
  2126. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2127. memset(&packet2, 0, sizeof(packet2));
  2128. mavlink_msg_deepstall_send(MAVLINK_COMM_1 , packet1.landing_lat , packet1.landing_lon , packet1.path_lat , packet1.path_lon , packet1.arc_entry_lat , packet1.arc_entry_lon , packet1.altitude , packet1.expected_travel_distance , packet1.cross_track_error , packet1.stage );
  2129. mavlink_msg_deepstall_decode(last_msg, &packet2);
  2130. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2131. }
  2132. static void mavlink_test_gimbal_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2133. {
  2134. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2135. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2136. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_REPORT >= 256) {
  2137. return;
  2138. }
  2139. #endif
  2140. mavlink_message_t msg;
  2141. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2142. uint16_t i;
  2143. mavlink_gimbal_report_t packet_in = {
  2144. 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,125,192
  2145. };
  2146. mavlink_gimbal_report_t packet1, packet2;
  2147. memset(&packet1, 0, sizeof(packet1));
  2148. packet1.delta_time = packet_in.delta_time;
  2149. packet1.delta_angle_x = packet_in.delta_angle_x;
  2150. packet1.delta_angle_y = packet_in.delta_angle_y;
  2151. packet1.delta_angle_z = packet_in.delta_angle_z;
  2152. packet1.delta_velocity_x = packet_in.delta_velocity_x;
  2153. packet1.delta_velocity_y = packet_in.delta_velocity_y;
  2154. packet1.delta_velocity_z = packet_in.delta_velocity_z;
  2155. packet1.joint_roll = packet_in.joint_roll;
  2156. packet1.joint_el = packet_in.joint_el;
  2157. packet1.joint_az = packet_in.joint_az;
  2158. packet1.target_system = packet_in.target_system;
  2159. packet1.target_component = packet_in.target_component;
  2160. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2161. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2162. // cope with extensions
  2163. memset(MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_REPORT_MIN_LEN);
  2164. }
  2165. #endif
  2166. memset(&packet2, 0, sizeof(packet2));
  2167. mavlink_msg_gimbal_report_encode(system_id, component_id, &msg, &packet1);
  2168. mavlink_msg_gimbal_report_decode(&msg, &packet2);
  2169. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2170. memset(&packet2, 0, sizeof(packet2));
  2171. mavlink_msg_gimbal_report_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.delta_time , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_roll , packet1.joint_el , packet1.joint_az );
  2172. mavlink_msg_gimbal_report_decode(&msg, &packet2);
  2173. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2174. memset(&packet2, 0, sizeof(packet2));
  2175. mavlink_msg_gimbal_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.delta_time , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_roll , packet1.joint_el , packet1.joint_az );
  2176. mavlink_msg_gimbal_report_decode(&msg, &packet2);
  2177. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2178. memset(&packet2, 0, sizeof(packet2));
  2179. mavlink_msg_to_send_buffer(buffer, &msg);
  2180. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2181. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2182. }
  2183. mavlink_msg_gimbal_report_decode(last_msg, &packet2);
  2184. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2185. memset(&packet2, 0, sizeof(packet2));
  2186. mavlink_msg_gimbal_report_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.delta_time , packet1.delta_angle_x , packet1.delta_angle_y , packet1.delta_angle_z , packet1.delta_velocity_x , packet1.delta_velocity_y , packet1.delta_velocity_z , packet1.joint_roll , packet1.joint_el , packet1.joint_az );
  2187. mavlink_msg_gimbal_report_decode(last_msg, &packet2);
  2188. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2189. }
  2190. static void mavlink_test_gimbal_control(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2191. {
  2192. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2193. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2194. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_CONTROL >= 256) {
  2195. return;
  2196. }
  2197. #endif
  2198. mavlink_message_t msg;
  2199. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2200. uint16_t i;
  2201. mavlink_gimbal_control_t packet_in = {
  2202. 17.0,45.0,73.0,41,108
  2203. };
  2204. mavlink_gimbal_control_t packet1, packet2;
  2205. memset(&packet1, 0, sizeof(packet1));
  2206. packet1.demanded_rate_x = packet_in.demanded_rate_x;
  2207. packet1.demanded_rate_y = packet_in.demanded_rate_y;
  2208. packet1.demanded_rate_z = packet_in.demanded_rate_z;
  2209. packet1.target_system = packet_in.target_system;
  2210. packet1.target_component = packet_in.target_component;
  2211. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2212. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2213. // cope with extensions
  2214. memset(MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_CONTROL_MIN_LEN);
  2215. }
  2216. #endif
  2217. memset(&packet2, 0, sizeof(packet2));
  2218. mavlink_msg_gimbal_control_encode(system_id, component_id, &msg, &packet1);
  2219. mavlink_msg_gimbal_control_decode(&msg, &packet2);
  2220. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2221. memset(&packet2, 0, sizeof(packet2));
  2222. mavlink_msg_gimbal_control_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z );
  2223. mavlink_msg_gimbal_control_decode(&msg, &packet2);
  2224. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2225. memset(&packet2, 0, sizeof(packet2));
  2226. mavlink_msg_gimbal_control_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z );
  2227. mavlink_msg_gimbal_control_decode(&msg, &packet2);
  2228. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2229. memset(&packet2, 0, sizeof(packet2));
  2230. mavlink_msg_to_send_buffer(buffer, &msg);
  2231. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2232. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2233. }
  2234. mavlink_msg_gimbal_control_decode(last_msg, &packet2);
  2235. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2236. memset(&packet2, 0, sizeof(packet2));
  2237. mavlink_msg_gimbal_control_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.demanded_rate_x , packet1.demanded_rate_y , packet1.demanded_rate_z );
  2238. mavlink_msg_gimbal_control_decode(last_msg, &packet2);
  2239. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2240. }
  2241. static void mavlink_test_gimbal_torque_cmd_report(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2242. {
  2243. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2244. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2245. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT >= 256) {
  2246. return;
  2247. }
  2248. #endif
  2249. mavlink_message_t msg;
  2250. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2251. uint16_t i;
  2252. mavlink_gimbal_torque_cmd_report_t packet_in = {
  2253. 17235,17339,17443,151,218
  2254. };
  2255. mavlink_gimbal_torque_cmd_report_t packet1, packet2;
  2256. memset(&packet1, 0, sizeof(packet1));
  2257. packet1.rl_torque_cmd = packet_in.rl_torque_cmd;
  2258. packet1.el_torque_cmd = packet_in.el_torque_cmd;
  2259. packet1.az_torque_cmd = packet_in.az_torque_cmd;
  2260. packet1.target_system = packet_in.target_system;
  2261. packet1.target_component = packet_in.target_component;
  2262. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2263. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2264. // cope with extensions
  2265. memset(MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GIMBAL_TORQUE_CMD_REPORT_MIN_LEN);
  2266. }
  2267. #endif
  2268. memset(&packet2, 0, sizeof(packet2));
  2269. mavlink_msg_gimbal_torque_cmd_report_encode(system_id, component_id, &msg, &packet1);
  2270. mavlink_msg_gimbal_torque_cmd_report_decode(&msg, &packet2);
  2271. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2272. memset(&packet2, 0, sizeof(packet2));
  2273. mavlink_msg_gimbal_torque_cmd_report_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.rl_torque_cmd , packet1.el_torque_cmd , packet1.az_torque_cmd );
  2274. mavlink_msg_gimbal_torque_cmd_report_decode(&msg, &packet2);
  2275. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2276. memset(&packet2, 0, sizeof(packet2));
  2277. mavlink_msg_gimbal_torque_cmd_report_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.rl_torque_cmd , packet1.el_torque_cmd , packet1.az_torque_cmd );
  2278. mavlink_msg_gimbal_torque_cmd_report_decode(&msg, &packet2);
  2279. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2280. memset(&packet2, 0, sizeof(packet2));
  2281. mavlink_msg_to_send_buffer(buffer, &msg);
  2282. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2283. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2284. }
  2285. mavlink_msg_gimbal_torque_cmd_report_decode(last_msg, &packet2);
  2286. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2287. memset(&packet2, 0, sizeof(packet2));
  2288. mavlink_msg_gimbal_torque_cmd_report_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.rl_torque_cmd , packet1.el_torque_cmd , packet1.az_torque_cmd );
  2289. mavlink_msg_gimbal_torque_cmd_report_decode(last_msg, &packet2);
  2290. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2291. }
  2292. static void mavlink_test_gopro_heartbeat(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2293. {
  2294. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2295. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2296. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_HEARTBEAT >= 256) {
  2297. return;
  2298. }
  2299. #endif
  2300. mavlink_message_t msg;
  2301. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2302. uint16_t i;
  2303. mavlink_gopro_heartbeat_t packet_in = {
  2304. 5,72,139
  2305. };
  2306. mavlink_gopro_heartbeat_t packet1, packet2;
  2307. memset(&packet1, 0, sizeof(packet1));
  2308. packet1.status = packet_in.status;
  2309. packet1.capture_mode = packet_in.capture_mode;
  2310. packet1.flags = packet_in.flags;
  2311. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2312. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2313. // cope with extensions
  2314. memset(MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_HEARTBEAT_MIN_LEN);
  2315. }
  2316. #endif
  2317. memset(&packet2, 0, sizeof(packet2));
  2318. mavlink_msg_gopro_heartbeat_encode(system_id, component_id, &msg, &packet1);
  2319. mavlink_msg_gopro_heartbeat_decode(&msg, &packet2);
  2320. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2321. memset(&packet2, 0, sizeof(packet2));
  2322. mavlink_msg_gopro_heartbeat_pack(system_id, component_id, &msg , packet1.status , packet1.capture_mode , packet1.flags );
  2323. mavlink_msg_gopro_heartbeat_decode(&msg, &packet2);
  2324. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2325. memset(&packet2, 0, sizeof(packet2));
  2326. mavlink_msg_gopro_heartbeat_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.status , packet1.capture_mode , packet1.flags );
  2327. mavlink_msg_gopro_heartbeat_decode(&msg, &packet2);
  2328. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2329. memset(&packet2, 0, sizeof(packet2));
  2330. mavlink_msg_to_send_buffer(buffer, &msg);
  2331. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2332. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2333. }
  2334. mavlink_msg_gopro_heartbeat_decode(last_msg, &packet2);
  2335. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2336. memset(&packet2, 0, sizeof(packet2));
  2337. mavlink_msg_gopro_heartbeat_send(MAVLINK_COMM_1 , packet1.status , packet1.capture_mode , packet1.flags );
  2338. mavlink_msg_gopro_heartbeat_decode(last_msg, &packet2);
  2339. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2340. }
  2341. static void mavlink_test_gopro_get_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2342. {
  2343. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2344. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2345. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_GET_REQUEST >= 256) {
  2346. return;
  2347. }
  2348. #endif
  2349. mavlink_message_t msg;
  2350. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2351. uint16_t i;
  2352. mavlink_gopro_get_request_t packet_in = {
  2353. 5,72,139
  2354. };
  2355. mavlink_gopro_get_request_t packet1, packet2;
  2356. memset(&packet1, 0, sizeof(packet1));
  2357. packet1.target_system = packet_in.target_system;
  2358. packet1.target_component = packet_in.target_component;
  2359. packet1.cmd_id = packet_in.cmd_id;
  2360. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2361. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2362. // cope with extensions
  2363. memset(MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_GET_REQUEST_MIN_LEN);
  2364. }
  2365. #endif
  2366. memset(&packet2, 0, sizeof(packet2));
  2367. mavlink_msg_gopro_get_request_encode(system_id, component_id, &msg, &packet1);
  2368. mavlink_msg_gopro_get_request_decode(&msg, &packet2);
  2369. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2370. memset(&packet2, 0, sizeof(packet2));
  2371. mavlink_msg_gopro_get_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.cmd_id );
  2372. mavlink_msg_gopro_get_request_decode(&msg, &packet2);
  2373. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2374. memset(&packet2, 0, sizeof(packet2));
  2375. mavlink_msg_gopro_get_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.cmd_id );
  2376. mavlink_msg_gopro_get_request_decode(&msg, &packet2);
  2377. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2378. memset(&packet2, 0, sizeof(packet2));
  2379. mavlink_msg_to_send_buffer(buffer, &msg);
  2380. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2381. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2382. }
  2383. mavlink_msg_gopro_get_request_decode(last_msg, &packet2);
  2384. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2385. memset(&packet2, 0, sizeof(packet2));
  2386. mavlink_msg_gopro_get_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.cmd_id );
  2387. mavlink_msg_gopro_get_request_decode(last_msg, &packet2);
  2388. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2389. }
  2390. static void mavlink_test_gopro_get_response(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2391. {
  2392. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2393. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2394. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_GET_RESPONSE >= 256) {
  2395. return;
  2396. }
  2397. #endif
  2398. mavlink_message_t msg;
  2399. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2400. uint16_t i;
  2401. mavlink_gopro_get_response_t packet_in = {
  2402. 5,72,{ 139, 140, 141, 142 }
  2403. };
  2404. mavlink_gopro_get_response_t packet1, packet2;
  2405. memset(&packet1, 0, sizeof(packet1));
  2406. packet1.cmd_id = packet_in.cmd_id;
  2407. packet1.status = packet_in.status;
  2408. mav_array_memcpy(packet1.value, packet_in.value, sizeof(uint8_t)*4);
  2409. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2410. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2411. // cope with extensions
  2412. memset(MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_GET_RESPONSE_MIN_LEN);
  2413. }
  2414. #endif
  2415. memset(&packet2, 0, sizeof(packet2));
  2416. mavlink_msg_gopro_get_response_encode(system_id, component_id, &msg, &packet1);
  2417. mavlink_msg_gopro_get_response_decode(&msg, &packet2);
  2418. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2419. memset(&packet2, 0, sizeof(packet2));
  2420. mavlink_msg_gopro_get_response_pack(system_id, component_id, &msg , packet1.cmd_id , packet1.status , packet1.value );
  2421. mavlink_msg_gopro_get_response_decode(&msg, &packet2);
  2422. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2423. memset(&packet2, 0, sizeof(packet2));
  2424. mavlink_msg_gopro_get_response_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.cmd_id , packet1.status , packet1.value );
  2425. mavlink_msg_gopro_get_response_decode(&msg, &packet2);
  2426. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2427. memset(&packet2, 0, sizeof(packet2));
  2428. mavlink_msg_to_send_buffer(buffer, &msg);
  2429. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2430. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2431. }
  2432. mavlink_msg_gopro_get_response_decode(last_msg, &packet2);
  2433. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2434. memset(&packet2, 0, sizeof(packet2));
  2435. mavlink_msg_gopro_get_response_send(MAVLINK_COMM_1 , packet1.cmd_id , packet1.status , packet1.value );
  2436. mavlink_msg_gopro_get_response_decode(last_msg, &packet2);
  2437. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2438. }
  2439. static void mavlink_test_gopro_set_request(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2440. {
  2441. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2442. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2443. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_SET_REQUEST >= 256) {
  2444. return;
  2445. }
  2446. #endif
  2447. mavlink_message_t msg;
  2448. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2449. uint16_t i;
  2450. mavlink_gopro_set_request_t packet_in = {
  2451. 5,72,139,{ 206, 207, 208, 209 }
  2452. };
  2453. mavlink_gopro_set_request_t packet1, packet2;
  2454. memset(&packet1, 0, sizeof(packet1));
  2455. packet1.target_system = packet_in.target_system;
  2456. packet1.target_component = packet_in.target_component;
  2457. packet1.cmd_id = packet_in.cmd_id;
  2458. mav_array_memcpy(packet1.value, packet_in.value, sizeof(uint8_t)*4);
  2459. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2460. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2461. // cope with extensions
  2462. memset(MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_SET_REQUEST_MIN_LEN);
  2463. }
  2464. #endif
  2465. memset(&packet2, 0, sizeof(packet2));
  2466. mavlink_msg_gopro_set_request_encode(system_id, component_id, &msg, &packet1);
  2467. mavlink_msg_gopro_set_request_decode(&msg, &packet2);
  2468. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2469. memset(&packet2, 0, sizeof(packet2));
  2470. mavlink_msg_gopro_set_request_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.cmd_id , packet1.value );
  2471. mavlink_msg_gopro_set_request_decode(&msg, &packet2);
  2472. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2473. memset(&packet2, 0, sizeof(packet2));
  2474. mavlink_msg_gopro_set_request_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.cmd_id , packet1.value );
  2475. mavlink_msg_gopro_set_request_decode(&msg, &packet2);
  2476. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2477. memset(&packet2, 0, sizeof(packet2));
  2478. mavlink_msg_to_send_buffer(buffer, &msg);
  2479. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2480. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2481. }
  2482. mavlink_msg_gopro_set_request_decode(last_msg, &packet2);
  2483. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2484. memset(&packet2, 0, sizeof(packet2));
  2485. mavlink_msg_gopro_set_request_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.cmd_id , packet1.value );
  2486. mavlink_msg_gopro_set_request_decode(last_msg, &packet2);
  2487. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2488. }
  2489. static void mavlink_test_gopro_set_response(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2490. {
  2491. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2492. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2493. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_GOPRO_SET_RESPONSE >= 256) {
  2494. return;
  2495. }
  2496. #endif
  2497. mavlink_message_t msg;
  2498. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2499. uint16_t i;
  2500. mavlink_gopro_set_response_t packet_in = {
  2501. 5,72
  2502. };
  2503. mavlink_gopro_set_response_t packet1, packet2;
  2504. memset(&packet1, 0, sizeof(packet1));
  2505. packet1.cmd_id = packet_in.cmd_id;
  2506. packet1.status = packet_in.status;
  2507. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2508. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2509. // cope with extensions
  2510. memset(MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_GOPRO_SET_RESPONSE_MIN_LEN);
  2511. }
  2512. #endif
  2513. memset(&packet2, 0, sizeof(packet2));
  2514. mavlink_msg_gopro_set_response_encode(system_id, component_id, &msg, &packet1);
  2515. mavlink_msg_gopro_set_response_decode(&msg, &packet2);
  2516. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2517. memset(&packet2, 0, sizeof(packet2));
  2518. mavlink_msg_gopro_set_response_pack(system_id, component_id, &msg , packet1.cmd_id , packet1.status );
  2519. mavlink_msg_gopro_set_response_decode(&msg, &packet2);
  2520. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2521. memset(&packet2, 0, sizeof(packet2));
  2522. mavlink_msg_gopro_set_response_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.cmd_id , packet1.status );
  2523. mavlink_msg_gopro_set_response_decode(&msg, &packet2);
  2524. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2525. memset(&packet2, 0, sizeof(packet2));
  2526. mavlink_msg_to_send_buffer(buffer, &msg);
  2527. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2528. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2529. }
  2530. mavlink_msg_gopro_set_response_decode(last_msg, &packet2);
  2531. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2532. memset(&packet2, 0, sizeof(packet2));
  2533. mavlink_msg_gopro_set_response_send(MAVLINK_COMM_1 , packet1.cmd_id , packet1.status );
  2534. mavlink_msg_gopro_set_response_decode(last_msg, &packet2);
  2535. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2536. }
  2537. static void mavlink_test_rpm(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2538. {
  2539. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2540. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2541. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_RPM >= 256) {
  2542. return;
  2543. }
  2544. #endif
  2545. mavlink_message_t msg;
  2546. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2547. uint16_t i;
  2548. mavlink_rpm_t packet_in = {
  2549. 17.0,45.0
  2550. };
  2551. mavlink_rpm_t packet1, packet2;
  2552. memset(&packet1, 0, sizeof(packet1));
  2553. packet1.rpm1 = packet_in.rpm1;
  2554. packet1.rpm2 = packet_in.rpm2;
  2555. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2556. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2557. // cope with extensions
  2558. memset(MAVLINK_MSG_ID_RPM_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_RPM_MIN_LEN);
  2559. }
  2560. #endif
  2561. memset(&packet2, 0, sizeof(packet2));
  2562. mavlink_msg_rpm_encode(system_id, component_id, &msg, &packet1);
  2563. mavlink_msg_rpm_decode(&msg, &packet2);
  2564. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2565. memset(&packet2, 0, sizeof(packet2));
  2566. mavlink_msg_rpm_pack(system_id, component_id, &msg , packet1.rpm1 , packet1.rpm2 );
  2567. mavlink_msg_rpm_decode(&msg, &packet2);
  2568. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2569. memset(&packet2, 0, sizeof(packet2));
  2570. mavlink_msg_rpm_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.rpm1 , packet1.rpm2 );
  2571. mavlink_msg_rpm_decode(&msg, &packet2);
  2572. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2573. memset(&packet2, 0, sizeof(packet2));
  2574. mavlink_msg_to_send_buffer(buffer, &msg);
  2575. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2576. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2577. }
  2578. mavlink_msg_rpm_decode(last_msg, &packet2);
  2579. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2580. memset(&packet2, 0, sizeof(packet2));
  2581. mavlink_msg_rpm_send(MAVLINK_COMM_1 , packet1.rpm1 , packet1.rpm2 );
  2582. mavlink_msg_rpm_decode(last_msg, &packet2);
  2583. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2584. }
  2585. static void mavlink_test_device_op_read(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2586. {
  2587. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2588. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2589. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEVICE_OP_READ >= 256) {
  2590. return;
  2591. }
  2592. #endif
  2593. mavlink_message_t msg;
  2594. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2595. uint16_t i;
  2596. mavlink_device_op_read_t packet_in = {
  2597. 963497464,17,84,151,218,29,"JKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUV",216,27
  2598. };
  2599. mavlink_device_op_read_t packet1, packet2;
  2600. memset(&packet1, 0, sizeof(packet1));
  2601. packet1.request_id = packet_in.request_id;
  2602. packet1.target_system = packet_in.target_system;
  2603. packet1.target_component = packet_in.target_component;
  2604. packet1.bustype = packet_in.bustype;
  2605. packet1.bus = packet_in.bus;
  2606. packet1.address = packet_in.address;
  2607. packet1.regstart = packet_in.regstart;
  2608. packet1.count = packet_in.count;
  2609. mav_array_memcpy(packet1.busname, packet_in.busname, sizeof(char)*40);
  2610. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2611. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2612. // cope with extensions
  2613. memset(MAVLINK_MSG_ID_DEVICE_OP_READ_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEVICE_OP_READ_MIN_LEN);
  2614. }
  2615. #endif
  2616. memset(&packet2, 0, sizeof(packet2));
  2617. mavlink_msg_device_op_read_encode(system_id, component_id, &msg, &packet1);
  2618. mavlink_msg_device_op_read_decode(&msg, &packet2);
  2619. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2620. memset(&packet2, 0, sizeof(packet2));
  2621. mavlink_msg_device_op_read_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count );
  2622. mavlink_msg_device_op_read_decode(&msg, &packet2);
  2623. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2624. memset(&packet2, 0, sizeof(packet2));
  2625. mavlink_msg_device_op_read_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count );
  2626. mavlink_msg_device_op_read_decode(&msg, &packet2);
  2627. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2628. memset(&packet2, 0, sizeof(packet2));
  2629. mavlink_msg_to_send_buffer(buffer, &msg);
  2630. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2631. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2632. }
  2633. mavlink_msg_device_op_read_decode(last_msg, &packet2);
  2634. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2635. memset(&packet2, 0, sizeof(packet2));
  2636. mavlink_msg_device_op_read_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count );
  2637. mavlink_msg_device_op_read_decode(last_msg, &packet2);
  2638. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2639. }
  2640. static void mavlink_test_device_op_read_reply(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2641. {
  2642. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2643. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2644. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEVICE_OP_READ_REPLY >= 256) {
  2645. return;
  2646. }
  2647. #endif
  2648. mavlink_message_t msg;
  2649. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2650. uint16_t i;
  2651. mavlink_device_op_read_reply_t packet_in = {
  2652. 963497464,17,84,151,{ 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 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 }
  2653. };
  2654. mavlink_device_op_read_reply_t packet1, packet2;
  2655. memset(&packet1, 0, sizeof(packet1));
  2656. packet1.request_id = packet_in.request_id;
  2657. packet1.result = packet_in.result;
  2658. packet1.regstart = packet_in.regstart;
  2659. packet1.count = packet_in.count;
  2660. mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*128);
  2661. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2662. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2663. // cope with extensions
  2664. memset(MAVLINK_MSG_ID_DEVICE_OP_READ_REPLY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEVICE_OP_READ_REPLY_MIN_LEN);
  2665. }
  2666. #endif
  2667. memset(&packet2, 0, sizeof(packet2));
  2668. mavlink_msg_device_op_read_reply_encode(system_id, component_id, &msg, &packet1);
  2669. mavlink_msg_device_op_read_reply_decode(&msg, &packet2);
  2670. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2671. memset(&packet2, 0, sizeof(packet2));
  2672. mavlink_msg_device_op_read_reply_pack(system_id, component_id, &msg , packet1.request_id , packet1.result , packet1.regstart , packet1.count , packet1.data );
  2673. mavlink_msg_device_op_read_reply_decode(&msg, &packet2);
  2674. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2675. memset(&packet2, 0, sizeof(packet2));
  2676. mavlink_msg_device_op_read_reply_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.request_id , packet1.result , packet1.regstart , packet1.count , packet1.data );
  2677. mavlink_msg_device_op_read_reply_decode(&msg, &packet2);
  2678. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2679. memset(&packet2, 0, sizeof(packet2));
  2680. mavlink_msg_to_send_buffer(buffer, &msg);
  2681. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2682. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2683. }
  2684. mavlink_msg_device_op_read_reply_decode(last_msg, &packet2);
  2685. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2686. memset(&packet2, 0, sizeof(packet2));
  2687. mavlink_msg_device_op_read_reply_send(MAVLINK_COMM_1 , packet1.request_id , packet1.result , packet1.regstart , packet1.count , packet1.data );
  2688. mavlink_msg_device_op_read_reply_decode(last_msg, &packet2);
  2689. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2690. }
  2691. static void mavlink_test_device_op_write(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2692. {
  2693. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2694. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2695. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEVICE_OP_WRITE >= 256) {
  2696. return;
  2697. }
  2698. #endif
  2699. mavlink_message_t msg;
  2700. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2701. uint16_t i;
  2702. mavlink_device_op_write_t packet_in = {
  2703. 963497464,17,84,151,218,29,"JKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUV",216,27,{ 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, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221 }
  2704. };
  2705. mavlink_device_op_write_t packet1, packet2;
  2706. memset(&packet1, 0, sizeof(packet1));
  2707. packet1.request_id = packet_in.request_id;
  2708. packet1.target_system = packet_in.target_system;
  2709. packet1.target_component = packet_in.target_component;
  2710. packet1.bustype = packet_in.bustype;
  2711. packet1.bus = packet_in.bus;
  2712. packet1.address = packet_in.address;
  2713. packet1.regstart = packet_in.regstart;
  2714. packet1.count = packet_in.count;
  2715. mav_array_memcpy(packet1.busname, packet_in.busname, sizeof(char)*40);
  2716. mav_array_memcpy(packet1.data, packet_in.data, sizeof(uint8_t)*128);
  2717. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2718. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2719. // cope with extensions
  2720. memset(MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN);
  2721. }
  2722. #endif
  2723. memset(&packet2, 0, sizeof(packet2));
  2724. mavlink_msg_device_op_write_encode(system_id, component_id, &msg, &packet1);
  2725. mavlink_msg_device_op_write_decode(&msg, &packet2);
  2726. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2727. memset(&packet2, 0, sizeof(packet2));
  2728. mavlink_msg_device_op_write_pack(system_id, component_id, &msg , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count , packet1.data );
  2729. mavlink_msg_device_op_write_decode(&msg, &packet2);
  2730. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2731. memset(&packet2, 0, sizeof(packet2));
  2732. mavlink_msg_device_op_write_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count , packet1.data );
  2733. mavlink_msg_device_op_write_decode(&msg, &packet2);
  2734. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2735. memset(&packet2, 0, sizeof(packet2));
  2736. mavlink_msg_to_send_buffer(buffer, &msg);
  2737. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2738. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2739. }
  2740. mavlink_msg_device_op_write_decode(last_msg, &packet2);
  2741. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2742. memset(&packet2, 0, sizeof(packet2));
  2743. mavlink_msg_device_op_write_send(MAVLINK_COMM_1 , packet1.target_system , packet1.target_component , packet1.request_id , packet1.bustype , packet1.bus , packet1.address , packet1.busname , packet1.regstart , packet1.count , packet1.data );
  2744. mavlink_msg_device_op_write_decode(last_msg, &packet2);
  2745. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2746. }
  2747. static void mavlink_test_device_op_write_reply(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2748. {
  2749. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2750. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2751. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_DEVICE_OP_WRITE_REPLY >= 256) {
  2752. return;
  2753. }
  2754. #endif
  2755. mavlink_message_t msg;
  2756. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2757. uint16_t i;
  2758. mavlink_device_op_write_reply_t packet_in = {
  2759. 963497464,17
  2760. };
  2761. mavlink_device_op_write_reply_t packet1, packet2;
  2762. memset(&packet1, 0, sizeof(packet1));
  2763. packet1.request_id = packet_in.request_id;
  2764. packet1.result = packet_in.result;
  2765. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2766. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2767. // cope with extensions
  2768. memset(MAVLINK_MSG_ID_DEVICE_OP_WRITE_REPLY_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_DEVICE_OP_WRITE_REPLY_MIN_LEN);
  2769. }
  2770. #endif
  2771. memset(&packet2, 0, sizeof(packet2));
  2772. mavlink_msg_device_op_write_reply_encode(system_id, component_id, &msg, &packet1);
  2773. mavlink_msg_device_op_write_reply_decode(&msg, &packet2);
  2774. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2775. memset(&packet2, 0, sizeof(packet2));
  2776. mavlink_msg_device_op_write_reply_pack(system_id, component_id, &msg , packet1.request_id , packet1.result );
  2777. mavlink_msg_device_op_write_reply_decode(&msg, &packet2);
  2778. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2779. memset(&packet2, 0, sizeof(packet2));
  2780. mavlink_msg_device_op_write_reply_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.request_id , packet1.result );
  2781. mavlink_msg_device_op_write_reply_decode(&msg, &packet2);
  2782. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2783. memset(&packet2, 0, sizeof(packet2));
  2784. mavlink_msg_to_send_buffer(buffer, &msg);
  2785. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2786. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2787. }
  2788. mavlink_msg_device_op_write_reply_decode(last_msg, &packet2);
  2789. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2790. memset(&packet2, 0, sizeof(packet2));
  2791. mavlink_msg_device_op_write_reply_send(MAVLINK_COMM_1 , packet1.request_id , packet1.result );
  2792. mavlink_msg_device_op_write_reply_decode(last_msg, &packet2);
  2793. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2794. }
  2795. static void mavlink_test_adap_tuning(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2796. {
  2797. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2798. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2799. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ADAP_TUNING >= 256) {
  2800. return;
  2801. }
  2802. #endif
  2803. mavlink_message_t msg;
  2804. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2805. uint16_t i;
  2806. mavlink_adap_tuning_t packet_in = {
  2807. 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,149
  2808. };
  2809. mavlink_adap_tuning_t packet1, packet2;
  2810. memset(&packet1, 0, sizeof(packet1));
  2811. packet1.desired = packet_in.desired;
  2812. packet1.achieved = packet_in.achieved;
  2813. packet1.error = packet_in.error;
  2814. packet1.theta = packet_in.theta;
  2815. packet1.omega = packet_in.omega;
  2816. packet1.sigma = packet_in.sigma;
  2817. packet1.theta_dot = packet_in.theta_dot;
  2818. packet1.omega_dot = packet_in.omega_dot;
  2819. packet1.sigma_dot = packet_in.sigma_dot;
  2820. packet1.f = packet_in.f;
  2821. packet1.f_dot = packet_in.f_dot;
  2822. packet1.u = packet_in.u;
  2823. packet1.axis = packet_in.axis;
  2824. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2825. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2826. // cope with extensions
  2827. memset(MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ADAP_TUNING_MIN_LEN);
  2828. }
  2829. #endif
  2830. memset(&packet2, 0, sizeof(packet2));
  2831. mavlink_msg_adap_tuning_encode(system_id, component_id, &msg, &packet1);
  2832. mavlink_msg_adap_tuning_decode(&msg, &packet2);
  2833. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2834. memset(&packet2, 0, sizeof(packet2));
  2835. mavlink_msg_adap_tuning_pack(system_id, component_id, &msg , packet1.axis , packet1.desired , packet1.achieved , packet1.error , packet1.theta , packet1.omega , packet1.sigma , packet1.theta_dot , packet1.omega_dot , packet1.sigma_dot , packet1.f , packet1.f_dot , packet1.u );
  2836. mavlink_msg_adap_tuning_decode(&msg, &packet2);
  2837. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2838. memset(&packet2, 0, sizeof(packet2));
  2839. mavlink_msg_adap_tuning_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.axis , packet1.desired , packet1.achieved , packet1.error , packet1.theta , packet1.omega , packet1.sigma , packet1.theta_dot , packet1.omega_dot , packet1.sigma_dot , packet1.f , packet1.f_dot , packet1.u );
  2840. mavlink_msg_adap_tuning_decode(&msg, &packet2);
  2841. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2842. memset(&packet2, 0, sizeof(packet2));
  2843. mavlink_msg_to_send_buffer(buffer, &msg);
  2844. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2845. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2846. }
  2847. mavlink_msg_adap_tuning_decode(last_msg, &packet2);
  2848. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2849. memset(&packet2, 0, sizeof(packet2));
  2850. mavlink_msg_adap_tuning_send(MAVLINK_COMM_1 , packet1.axis , packet1.desired , packet1.achieved , packet1.error , packet1.theta , packet1.omega , packet1.sigma , packet1.theta_dot , packet1.omega_dot , packet1.sigma_dot , packet1.f , packet1.f_dot , packet1.u );
  2851. mavlink_msg_adap_tuning_decode(last_msg, &packet2);
  2852. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2853. }
  2854. static void mavlink_test_vision_position_delta(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2855. {
  2856. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2857. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2858. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_VISION_POSITION_DELTA >= 256) {
  2859. return;
  2860. }
  2861. #endif
  2862. mavlink_message_t msg;
  2863. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2864. uint16_t i;
  2865. mavlink_vision_position_delta_t packet_in = {
  2866. 93372036854775807ULL,93372036854776311ULL,{ 129.0, 130.0, 131.0 },{ 213.0, 214.0, 215.0 },297.0
  2867. };
  2868. mavlink_vision_position_delta_t packet1, packet2;
  2869. memset(&packet1, 0, sizeof(packet1));
  2870. packet1.time_usec = packet_in.time_usec;
  2871. packet1.time_delta_usec = packet_in.time_delta_usec;
  2872. packet1.confidence = packet_in.confidence;
  2873. mav_array_memcpy(packet1.angle_delta, packet_in.angle_delta, sizeof(float)*3);
  2874. mav_array_memcpy(packet1.position_delta, packet_in.position_delta, sizeof(float)*3);
  2875. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2876. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2877. // cope with extensions
  2878. memset(MAVLINK_MSG_ID_VISION_POSITION_DELTA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_VISION_POSITION_DELTA_MIN_LEN);
  2879. }
  2880. #endif
  2881. memset(&packet2, 0, sizeof(packet2));
  2882. mavlink_msg_vision_position_delta_encode(system_id, component_id, &msg, &packet1);
  2883. mavlink_msg_vision_position_delta_decode(&msg, &packet2);
  2884. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2885. memset(&packet2, 0, sizeof(packet2));
  2886. mavlink_msg_vision_position_delta_pack(system_id, component_id, &msg , packet1.time_usec , packet1.time_delta_usec , packet1.angle_delta , packet1.position_delta , packet1.confidence );
  2887. mavlink_msg_vision_position_delta_decode(&msg, &packet2);
  2888. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2889. memset(&packet2, 0, sizeof(packet2));
  2890. mavlink_msg_vision_position_delta_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.time_delta_usec , packet1.angle_delta , packet1.position_delta , packet1.confidence );
  2891. mavlink_msg_vision_position_delta_decode(&msg, &packet2);
  2892. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2893. memset(&packet2, 0, sizeof(packet2));
  2894. mavlink_msg_to_send_buffer(buffer, &msg);
  2895. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2896. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2897. }
  2898. mavlink_msg_vision_position_delta_decode(last_msg, &packet2);
  2899. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2900. memset(&packet2, 0, sizeof(packet2));
  2901. mavlink_msg_vision_position_delta_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.time_delta_usec , packet1.angle_delta , packet1.position_delta , packet1.confidence );
  2902. mavlink_msg_vision_position_delta_decode(last_msg, &packet2);
  2903. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2904. }
  2905. static void mavlink_test_aoa_ssa(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2906. {
  2907. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2908. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2909. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_AOA_SSA >= 256) {
  2910. return;
  2911. }
  2912. #endif
  2913. mavlink_message_t msg;
  2914. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2915. uint16_t i;
  2916. mavlink_aoa_ssa_t packet_in = {
  2917. 93372036854775807ULL,73.0,101.0
  2918. };
  2919. mavlink_aoa_ssa_t packet1, packet2;
  2920. memset(&packet1, 0, sizeof(packet1));
  2921. packet1.time_usec = packet_in.time_usec;
  2922. packet1.AOA = packet_in.AOA;
  2923. packet1.SSA = packet_in.SSA;
  2924. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2925. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2926. // cope with extensions
  2927. memset(MAVLINK_MSG_ID_AOA_SSA_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_AOA_SSA_MIN_LEN);
  2928. }
  2929. #endif
  2930. memset(&packet2, 0, sizeof(packet2));
  2931. mavlink_msg_aoa_ssa_encode(system_id, component_id, &msg, &packet1);
  2932. mavlink_msg_aoa_ssa_decode(&msg, &packet2);
  2933. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2934. memset(&packet2, 0, sizeof(packet2));
  2935. mavlink_msg_aoa_ssa_pack(system_id, component_id, &msg , packet1.time_usec , packet1.AOA , packet1.SSA );
  2936. mavlink_msg_aoa_ssa_decode(&msg, &packet2);
  2937. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2938. memset(&packet2, 0, sizeof(packet2));
  2939. mavlink_msg_aoa_ssa_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.time_usec , packet1.AOA , packet1.SSA );
  2940. mavlink_msg_aoa_ssa_decode(&msg, &packet2);
  2941. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2942. memset(&packet2, 0, sizeof(packet2));
  2943. mavlink_msg_to_send_buffer(buffer, &msg);
  2944. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2945. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2946. }
  2947. mavlink_msg_aoa_ssa_decode(last_msg, &packet2);
  2948. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2949. memset(&packet2, 0, sizeof(packet2));
  2950. mavlink_msg_aoa_ssa_send(MAVLINK_COMM_1 , packet1.time_usec , packet1.AOA , packet1.SSA );
  2951. mavlink_msg_aoa_ssa_decode(last_msg, &packet2);
  2952. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2953. }
  2954. static void mavlink_test_esc_telemetry_1_to_4(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  2955. {
  2956. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2957. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  2958. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESC_TELEMETRY_1_TO_4 >= 256) {
  2959. return;
  2960. }
  2961. #endif
  2962. mavlink_message_t msg;
  2963. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  2964. uint16_t i;
  2965. mavlink_esc_telemetry_1_to_4_t packet_in = {
  2966. { 17235, 17236, 17237, 17238 },{ 17651, 17652, 17653, 17654 },{ 18067, 18068, 18069, 18070 },{ 18483, 18484, 18485, 18486 },{ 18899, 18900, 18901, 18902 },{ 125, 126, 127, 128 }
  2967. };
  2968. mavlink_esc_telemetry_1_to_4_t packet1, packet2;
  2969. memset(&packet1, 0, sizeof(packet1));
  2970. mav_array_memcpy(packet1.voltage, packet_in.voltage, sizeof(uint16_t)*4);
  2971. mav_array_memcpy(packet1.current, packet_in.current, sizeof(uint16_t)*4);
  2972. mav_array_memcpy(packet1.totalcurrent, packet_in.totalcurrent, sizeof(uint16_t)*4);
  2973. mav_array_memcpy(packet1.rpm, packet_in.rpm, sizeof(uint16_t)*4);
  2974. mav_array_memcpy(packet1.count, packet_in.count, sizeof(uint16_t)*4);
  2975. mav_array_memcpy(packet1.temperature, packet_in.temperature, sizeof(uint8_t)*4);
  2976. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  2977. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  2978. // cope with extensions
  2979. memset(MAVLINK_MSG_ID_ESC_TELEMETRY_1_TO_4_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESC_TELEMETRY_1_TO_4_MIN_LEN);
  2980. }
  2981. #endif
  2982. memset(&packet2, 0, sizeof(packet2));
  2983. mavlink_msg_esc_telemetry_1_to_4_encode(system_id, component_id, &msg, &packet1);
  2984. mavlink_msg_esc_telemetry_1_to_4_decode(&msg, &packet2);
  2985. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2986. memset(&packet2, 0, sizeof(packet2));
  2987. mavlink_msg_esc_telemetry_1_to_4_pack(system_id, component_id, &msg , packet1.temperature , packet1.voltage , packet1.current , packet1.totalcurrent , packet1.rpm , packet1.count );
  2988. mavlink_msg_esc_telemetry_1_to_4_decode(&msg, &packet2);
  2989. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2990. memset(&packet2, 0, sizeof(packet2));
  2991. mavlink_msg_esc_telemetry_1_to_4_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.temperature , packet1.voltage , packet1.current , packet1.totalcurrent , packet1.rpm , packet1.count );
  2992. mavlink_msg_esc_telemetry_1_to_4_decode(&msg, &packet2);
  2993. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  2994. memset(&packet2, 0, sizeof(packet2));
  2995. mavlink_msg_to_send_buffer(buffer, &msg);
  2996. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  2997. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  2998. }
  2999. mavlink_msg_esc_telemetry_1_to_4_decode(last_msg, &packet2);
  3000. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3001. memset(&packet2, 0, sizeof(packet2));
  3002. mavlink_msg_esc_telemetry_1_to_4_send(MAVLINK_COMM_1 , packet1.temperature , packet1.voltage , packet1.current , packet1.totalcurrent , packet1.rpm , packet1.count );
  3003. mavlink_msg_esc_telemetry_1_to_4_decode(last_msg, &packet2);
  3004. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3005. }
  3006. static void mavlink_test_esc_telemetry_5_to_8(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  3007. {
  3008. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  3009. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  3010. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESC_TELEMETRY_5_TO_8 >= 256) {
  3011. return;
  3012. }
  3013. #endif
  3014. mavlink_message_t msg;
  3015. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  3016. uint16_t i;
  3017. mavlink_esc_telemetry_5_to_8_t packet_in = {
  3018. { 17235, 17236, 17237, 17238 },{ 17651, 17652, 17653, 17654 },{ 18067, 18068, 18069, 18070 },{ 18483, 18484, 18485, 18486 },{ 18899, 18900, 18901, 18902 },{ 125, 126, 127, 128 }
  3019. };
  3020. mavlink_esc_telemetry_5_to_8_t packet1, packet2;
  3021. memset(&packet1, 0, sizeof(packet1));
  3022. mav_array_memcpy(packet1.voltage, packet_in.voltage, sizeof(uint16_t)*4);
  3023. mav_array_memcpy(packet1.current, packet_in.current, sizeof(uint16_t)*4);
  3024. mav_array_memcpy(packet1.totalcurrent, packet_in.totalcurrent, sizeof(uint16_t)*4);
  3025. mav_array_memcpy(packet1.rpm, packet_in.rpm, sizeof(uint16_t)*4);
  3026. mav_array_memcpy(packet1.count, packet_in.count, sizeof(uint16_t)*4);
  3027. mav_array_memcpy(packet1.temperature, packet_in.temperature, sizeof(uint8_t)*4);
  3028. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  3029. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  3030. // cope with extensions
  3031. memset(MAVLINK_MSG_ID_ESC_TELEMETRY_5_TO_8_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESC_TELEMETRY_5_TO_8_MIN_LEN);
  3032. }
  3033. #endif
  3034. memset(&packet2, 0, sizeof(packet2));
  3035. mavlink_msg_esc_telemetry_5_to_8_encode(system_id, component_id, &msg, &packet1);
  3036. mavlink_msg_esc_telemetry_5_to_8_decode(&msg, &packet2);
  3037. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3038. memset(&packet2, 0, sizeof(packet2));
  3039. mavlink_msg_esc_telemetry_5_to_8_pack(system_id, component_id, &msg , packet1.temperature , packet1.voltage , packet1.current , packet1.totalcurrent , packet1.rpm , packet1.count );
  3040. mavlink_msg_esc_telemetry_5_to_8_decode(&msg, &packet2);
  3041. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3042. memset(&packet2, 0, sizeof(packet2));
  3043. mavlink_msg_esc_telemetry_5_to_8_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.temperature , packet1.voltage , packet1.current , packet1.totalcurrent , packet1.rpm , packet1.count );
  3044. mavlink_msg_esc_telemetry_5_to_8_decode(&msg, &packet2);
  3045. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3046. memset(&packet2, 0, sizeof(packet2));
  3047. mavlink_msg_to_send_buffer(buffer, &msg);
  3048. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  3049. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  3050. }
  3051. mavlink_msg_esc_telemetry_5_to_8_decode(last_msg, &packet2);
  3052. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3053. memset(&packet2, 0, sizeof(packet2));
  3054. mavlink_msg_esc_telemetry_5_to_8_send(MAVLINK_COMM_1 , packet1.temperature , packet1.voltage , packet1.current , packet1.totalcurrent , packet1.rpm , packet1.count );
  3055. mavlink_msg_esc_telemetry_5_to_8_decode(last_msg, &packet2);
  3056. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3057. }
  3058. static void mavlink_test_esc_telemetry_9_to_12(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  3059. {
  3060. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  3061. mavlink_status_t *status = mavlink_get_channel_status(MAVLINK_COMM_0);
  3062. if ((status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) && MAVLINK_MSG_ID_ESC_TELEMETRY_9_TO_12 >= 256) {
  3063. return;
  3064. }
  3065. #endif
  3066. mavlink_message_t msg;
  3067. uint8_t buffer[MAVLINK_MAX_PACKET_LEN];
  3068. uint16_t i;
  3069. mavlink_esc_telemetry_9_to_12_t packet_in = {
  3070. { 17235, 17236, 17237, 17238 },{ 17651, 17652, 17653, 17654 },{ 18067, 18068, 18069, 18070 },{ 18483, 18484, 18485, 18486 },{ 18899, 18900, 18901, 18902 },{ 125, 126, 127, 128 }
  3071. };
  3072. mavlink_esc_telemetry_9_to_12_t packet1, packet2;
  3073. memset(&packet1, 0, sizeof(packet1));
  3074. mav_array_memcpy(packet1.voltage, packet_in.voltage, sizeof(uint16_t)*4);
  3075. mav_array_memcpy(packet1.current, packet_in.current, sizeof(uint16_t)*4);
  3076. mav_array_memcpy(packet1.totalcurrent, packet_in.totalcurrent, sizeof(uint16_t)*4);
  3077. mav_array_memcpy(packet1.rpm, packet_in.rpm, sizeof(uint16_t)*4);
  3078. mav_array_memcpy(packet1.count, packet_in.count, sizeof(uint16_t)*4);
  3079. mav_array_memcpy(packet1.temperature, packet_in.temperature, sizeof(uint8_t)*4);
  3080. #ifdef MAVLINK_STATUS_FLAG_OUT_MAVLINK1
  3081. if (status->flags & MAVLINK_STATUS_FLAG_OUT_MAVLINK1) {
  3082. // cope with extensions
  3083. memset(MAVLINK_MSG_ID_ESC_TELEMETRY_9_TO_12_MIN_LEN + (char *)&packet1, 0, sizeof(packet1)-MAVLINK_MSG_ID_ESC_TELEMETRY_9_TO_12_MIN_LEN);
  3084. }
  3085. #endif
  3086. memset(&packet2, 0, sizeof(packet2));
  3087. mavlink_msg_esc_telemetry_9_to_12_encode(system_id, component_id, &msg, &packet1);
  3088. mavlink_msg_esc_telemetry_9_to_12_decode(&msg, &packet2);
  3089. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3090. memset(&packet2, 0, sizeof(packet2));
  3091. mavlink_msg_esc_telemetry_9_to_12_pack(system_id, component_id, &msg , packet1.temperature , packet1.voltage , packet1.current , packet1.totalcurrent , packet1.rpm , packet1.count );
  3092. mavlink_msg_esc_telemetry_9_to_12_decode(&msg, &packet2);
  3093. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3094. memset(&packet2, 0, sizeof(packet2));
  3095. mavlink_msg_esc_telemetry_9_to_12_pack_chan(system_id, component_id, MAVLINK_COMM_0, &msg , packet1.temperature , packet1.voltage , packet1.current , packet1.totalcurrent , packet1.rpm , packet1.count );
  3096. mavlink_msg_esc_telemetry_9_to_12_decode(&msg, &packet2);
  3097. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3098. memset(&packet2, 0, sizeof(packet2));
  3099. mavlink_msg_to_send_buffer(buffer, &msg);
  3100. for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
  3101. comm_send_ch(MAVLINK_COMM_0, buffer[i]);
  3102. }
  3103. mavlink_msg_esc_telemetry_9_to_12_decode(last_msg, &packet2);
  3104. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3105. memset(&packet2, 0, sizeof(packet2));
  3106. mavlink_msg_esc_telemetry_9_to_12_send(MAVLINK_COMM_1 , packet1.temperature , packet1.voltage , packet1.current , packet1.totalcurrent , packet1.rpm , packet1.count );
  3107. mavlink_msg_esc_telemetry_9_to_12_decode(last_msg, &packet2);
  3108. MAVLINK_ASSERT(memcmp(&packet1, &packet2, sizeof(packet1)) == 0);
  3109. }
  3110. static void mavlink_test_ardupilotmega(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
  3111. {
  3112. mavlink_test_sensor_offsets(system_id, component_id, last_msg);
  3113. mavlink_test_set_mag_offsets(system_id, component_id, last_msg);
  3114. mavlink_test_meminfo(system_id, component_id, last_msg);
  3115. mavlink_test_ap_adc(system_id, component_id, last_msg);
  3116. mavlink_test_digicam_configure(system_id, component_id, last_msg);
  3117. mavlink_test_digicam_control(system_id, component_id, last_msg);
  3118. mavlink_test_mount_configure(system_id, component_id, last_msg);
  3119. mavlink_test_mount_control(system_id, component_id, last_msg);
  3120. mavlink_test_mount_status(system_id, component_id, last_msg);
  3121. mavlink_test_fence_point(system_id, component_id, last_msg);
  3122. mavlink_test_fence_fetch_point(system_id, component_id, last_msg);
  3123. mavlink_test_ahrs(system_id, component_id, last_msg);
  3124. mavlink_test_simstate(system_id, component_id, last_msg);
  3125. mavlink_test_hwstatus(system_id, component_id, last_msg);
  3126. mavlink_test_radio(system_id, component_id, last_msg);
  3127. mavlink_test_limits_status(system_id, component_id, last_msg);
  3128. mavlink_test_wind(system_id, component_id, last_msg);
  3129. mavlink_test_data16(system_id, component_id, last_msg);
  3130. mavlink_test_data32(system_id, component_id, last_msg);
  3131. mavlink_test_data64(system_id, component_id, last_msg);
  3132. mavlink_test_data96(system_id, component_id, last_msg);
  3133. mavlink_test_rangefinder(system_id, component_id, last_msg);
  3134. mavlink_test_airspeed_autocal(system_id, component_id, last_msg);
  3135. mavlink_test_rally_point(system_id, component_id, last_msg);
  3136. mavlink_test_rally_fetch_point(system_id, component_id, last_msg);
  3137. mavlink_test_compassmot_status(system_id, component_id, last_msg);
  3138. mavlink_test_ahrs2(system_id, component_id, last_msg);
  3139. mavlink_test_camera_status(system_id, component_id, last_msg);
  3140. mavlink_test_camera_feedback(system_id, component_id, last_msg);
  3141. mavlink_test_battery2(system_id, component_id, last_msg);
  3142. mavlink_test_ahrs3(system_id, component_id, last_msg);
  3143. mavlink_test_autopilot_version_request(system_id, component_id, last_msg);
  3144. mavlink_test_remote_log_data_block(system_id, component_id, last_msg);
  3145. mavlink_test_remote_log_block_status(system_id, component_id, last_msg);
  3146. mavlink_test_led_control(system_id, component_id, last_msg);
  3147. mavlink_test_mag_cal_progress(system_id, component_id, last_msg);
  3148. mavlink_test_mag_cal_report(system_id, component_id, last_msg);
  3149. mavlink_test_ekf_status_report(system_id, component_id, last_msg);
  3150. mavlink_test_pid_tuning(system_id, component_id, last_msg);
  3151. mavlink_test_deepstall(system_id, component_id, last_msg);
  3152. mavlink_test_gimbal_report(system_id, component_id, last_msg);
  3153. mavlink_test_gimbal_control(system_id, component_id, last_msg);
  3154. mavlink_test_gimbal_torque_cmd_report(system_id, component_id, last_msg);
  3155. mavlink_test_gopro_heartbeat(system_id, component_id, last_msg);
  3156. mavlink_test_gopro_get_request(system_id, component_id, last_msg);
  3157. mavlink_test_gopro_get_response(system_id, component_id, last_msg);
  3158. mavlink_test_gopro_set_request(system_id, component_id, last_msg);
  3159. mavlink_test_gopro_set_response(system_id, component_id, last_msg);
  3160. mavlink_test_rpm(system_id, component_id, last_msg);
  3161. mavlink_test_device_op_read(system_id, component_id, last_msg);
  3162. mavlink_test_device_op_read_reply(system_id, component_id, last_msg);
  3163. mavlink_test_device_op_write(system_id, component_id, last_msg);
  3164. mavlink_test_device_op_write_reply(system_id, component_id, last_msg);
  3165. mavlink_test_adap_tuning(system_id, component_id, last_msg);
  3166. mavlink_test_vision_position_delta(system_id, component_id, last_msg);
  3167. mavlink_test_aoa_ssa(system_id, component_id, last_msg);
  3168. mavlink_test_esc_telemetry_1_to_4(system_id, component_id, last_msg);
  3169. mavlink_test_esc_telemetry_5_to_8(system_id, component_id, last_msg);
  3170. mavlink_test_esc_telemetry_9_to_12(system_id, component_id, last_msg);
  3171. }
  3172. #ifdef __cplusplus
  3173. }
  3174. #endif // __cplusplus
  3175. #endif // ARDUPILOTMEGA_TESTSUITE_H