5 #ifndef SLUGS_TESTSUITE_H
6 #define SLUGS_TESTSUITE_H
12 #ifndef MAVLINK_TEST_ALL
13 #define MAVLINK_TEST_ALL
14 static void mavlink_test_common(uint8_t, uint8_t, mavlink_message_t *last_msg);
15 static void mavlink_test_slugs(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)
19 mavlink_test_common(system_id, component_id, last_msg);
20 mavlink_test_slugs(system_id, component_id, last_msg);
24 #include "../common/testsuite.h"
27 static void mavlink_test_cpu_load(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
29 mavlink_message_t msg;
36 memset(&packet1, 0,
sizeof(packet1));
43 memset(&packet2, 0,
sizeof(packet2));
44 mavlink_msg_cpu_load_encode(system_id, component_id, &msg, &packet1);
45 mavlink_msg_cpu_load_decode(&msg, &packet2);
48 memset(&packet2, 0,
sizeof(packet2));
49 mavlink_msg_cpu_load_pack(system_id, component_id, &msg , packet1.
sensLoad , packet1.
ctrlLoad , packet1.
batVolt );
50 mavlink_msg_cpu_load_decode(&msg, &packet2);
53 memset(&packet2, 0,
sizeof(packet2));
55 mavlink_msg_cpu_load_decode(&msg, &packet2);
58 memset(&packet2, 0,
sizeof(packet2));
60 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
63 mavlink_msg_cpu_load_decode(last_msg, &packet2);
66 memset(&packet2, 0,
sizeof(packet2));
68 mavlink_msg_cpu_load_decode(last_msg, &packet2);
72 static void mavlink_test_sensor_bias(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
74 mavlink_message_t msg;
78 17.0,45.0,73.0,101.0,129.0,157.0
81 memset(&packet1, 0,
sizeof(packet1));
91 memset(&packet2, 0,
sizeof(packet2));
92 mavlink_msg_sensor_bias_encode(system_id, component_id, &msg, &packet1);
93 mavlink_msg_sensor_bias_decode(&msg, &packet2);
96 memset(&packet2, 0,
sizeof(packet2));
98 mavlink_msg_sensor_bias_decode(&msg, &packet2);
101 memset(&packet2, 0,
sizeof(packet2));
103 mavlink_msg_sensor_bias_decode(&msg, &packet2);
106 memset(&packet2, 0,
sizeof(packet2));
108 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
111 mavlink_msg_sensor_bias_decode(last_msg, &packet2);
114 memset(&packet2, 0,
sizeof(packet2));
116 mavlink_msg_sensor_bias_decode(last_msg, &packet2);
120 static void mavlink_test_diagnostic(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
122 mavlink_message_t msg;
126 17.0,45.0,73.0,17859,17963,18067
129 memset(&packet1, 0,
sizeof(packet1));
139 memset(&packet2, 0,
sizeof(packet2));
140 mavlink_msg_diagnostic_encode(system_id, component_id, &msg, &packet1);
141 mavlink_msg_diagnostic_decode(&msg, &packet2);
144 memset(&packet2, 0,
sizeof(packet2));
146 mavlink_msg_diagnostic_decode(&msg, &packet2);
149 memset(&packet2, 0,
sizeof(packet2));
151 mavlink_msg_diagnostic_decode(&msg, &packet2);
154 memset(&packet2, 0,
sizeof(packet2));
156 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
159 mavlink_msg_diagnostic_decode(last_msg, &packet2);
162 memset(&packet2, 0,
sizeof(packet2));
164 mavlink_msg_diagnostic_decode(last_msg, &packet2);
168 static void mavlink_test_slugs_navigation(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
170 mavlink_message_t msg;
174 17.0,45.0,73.0,101.0,129.0,157.0,185.0,18691,223,34
177 memset(&packet1, 0,
sizeof(packet1));
178 packet1.
u_m = packet_in.
u_m;
185 packet1.
h_c = packet_in.
h_c;
191 memset(&packet2, 0,
sizeof(packet2));
192 mavlink_msg_slugs_navigation_encode(system_id, component_id, &msg, &packet1);
193 mavlink_msg_slugs_navigation_decode(&msg, &packet2);
196 memset(&packet2, 0,
sizeof(packet2));
197 mavlink_msg_slugs_navigation_pack(system_id, component_id, &msg , packet1.
u_m , packet1.
phi_c , packet1.
theta_c , packet1.
psiDot_c , packet1.
ay_body , packet1.
totalDist , packet1.
dist2Go , packet1.
fromWP , packet1.
toWP , packet1.
h_c );
198 mavlink_msg_slugs_navigation_decode(&msg, &packet2);
201 memset(&packet2, 0,
sizeof(packet2));
202 mavlink_msg_slugs_navigation_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
u_m , packet1.
phi_c , packet1.
theta_c , packet1.
psiDot_c , packet1.
ay_body , packet1.
totalDist , packet1.
dist2Go , packet1.
fromWP , packet1.
toWP , packet1.
h_c );
203 mavlink_msg_slugs_navigation_decode(&msg, &packet2);
206 memset(&packet2, 0,
sizeof(packet2));
208 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
211 mavlink_msg_slugs_navigation_decode(last_msg, &packet2);
214 memset(&packet2, 0,
sizeof(packet2));
215 mavlink_msg_slugs_navigation_send(
MAVLINK_COMM_1 , packet1.
u_m , packet1.
phi_c , packet1.
theta_c , packet1.
psiDot_c , packet1.
ay_body , packet1.
totalDist , packet1.
dist2Go , packet1.
fromWP , packet1.
toWP , packet1.
h_c );
216 mavlink_msg_slugs_navigation_decode(last_msg, &packet2);
220 static void mavlink_test_data_log(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
222 mavlink_message_t msg;
226 17.0,45.0,73.0,101.0,129.0,157.0
229 memset(&packet1, 0,
sizeof(packet1));
239 memset(&packet2, 0,
sizeof(packet2));
240 mavlink_msg_data_log_encode(system_id, component_id, &msg, &packet1);
241 mavlink_msg_data_log_decode(&msg, &packet2);
244 memset(&packet2, 0,
sizeof(packet2));
245 mavlink_msg_data_log_pack(system_id, component_id, &msg , packet1.
fl_1 , packet1.
fl_2 , packet1.
fl_3 , packet1.
fl_4 , packet1.
fl_5 , packet1.
fl_6 );
246 mavlink_msg_data_log_decode(&msg, &packet2);
249 memset(&packet2, 0,
sizeof(packet2));
251 mavlink_msg_data_log_decode(&msg, &packet2);
254 memset(&packet2, 0,
sizeof(packet2));
256 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
259 mavlink_msg_data_log_decode(last_msg, &packet2);
262 memset(&packet2, 0,
sizeof(packet2));
264 mavlink_msg_data_log_decode(last_msg, &packet2);
268 static void mavlink_test_gps_date_time(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
270 mavlink_message_t msg;
274 5,72,139,206,17,84,151,218,29,96,163,230
277 memset(&packet1, 0,
sizeof(packet1));
280 packet1.
day = packet_in.
day;
282 packet1.
min = packet_in.
min;
283 packet1.
sec = packet_in.
sec;
293 memset(&packet2, 0,
sizeof(packet2));
294 mavlink_msg_gps_date_time_encode(system_id, component_id, &msg, &packet1);
295 mavlink_msg_gps_date_time_decode(&msg, &packet2);
298 memset(&packet2, 0,
sizeof(packet2));
299 mavlink_msg_gps_date_time_pack(system_id, component_id, &msg , packet1.
year , packet1.
month , packet1.
day , packet1.
hour , packet1.
min , packet1.
sec , packet1.
clockStat , packet1.
visSat , packet1.
useSat , packet1.
GppGl , packet1.
sigUsedMask , packet1.
percentUsed );
300 mavlink_msg_gps_date_time_decode(&msg, &packet2);
303 memset(&packet2, 0,
sizeof(packet2));
304 mavlink_msg_gps_date_time_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
year , packet1.
month , packet1.
day , packet1.
hour , packet1.
min , packet1.
sec , packet1.
clockStat , packet1.
visSat , packet1.
useSat , packet1.
GppGl , packet1.
sigUsedMask , packet1.
percentUsed );
305 mavlink_msg_gps_date_time_decode(&msg, &packet2);
308 memset(&packet2, 0,
sizeof(packet2));
310 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
313 mavlink_msg_gps_date_time_decode(last_msg, &packet2);
316 memset(&packet2, 0,
sizeof(packet2));
317 mavlink_msg_gps_date_time_send(
MAVLINK_COMM_1 , packet1.
year , packet1.
month , packet1.
day , packet1.
hour , packet1.
min , packet1.
sec , packet1.
clockStat , packet1.
visSat , packet1.
useSat , packet1.
GppGl , packet1.
sigUsedMask , packet1.
percentUsed );
318 mavlink_msg_gps_date_time_decode(last_msg, &packet2);
322 static void mavlink_test_mid_lvl_cmds(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
324 mavlink_message_t msg;
331 memset(&packet1, 0,
sizeof(packet1));
339 memset(&packet2, 0,
sizeof(packet2));
340 mavlink_msg_mid_lvl_cmds_encode(system_id, component_id, &msg, &packet1);
341 mavlink_msg_mid_lvl_cmds_decode(&msg, &packet2);
344 memset(&packet2, 0,
sizeof(packet2));
346 mavlink_msg_mid_lvl_cmds_decode(&msg, &packet2);
349 memset(&packet2, 0,
sizeof(packet2));
351 mavlink_msg_mid_lvl_cmds_decode(&msg, &packet2);
354 memset(&packet2, 0,
sizeof(packet2));
356 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
359 mavlink_msg_mid_lvl_cmds_decode(last_msg, &packet2);
362 memset(&packet2, 0,
sizeof(packet2));
364 mavlink_msg_mid_lvl_cmds_decode(last_msg, &packet2);
368 static void mavlink_test_ctrl_srfc_pt(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
370 mavlink_message_t msg;
377 memset(&packet1, 0,
sizeof(packet1));
383 memset(&packet2, 0,
sizeof(packet2));
384 mavlink_msg_ctrl_srfc_pt_encode(system_id, component_id, &msg, &packet1);
385 mavlink_msg_ctrl_srfc_pt_decode(&msg, &packet2);
388 memset(&packet2, 0,
sizeof(packet2));
389 mavlink_msg_ctrl_srfc_pt_pack(system_id, component_id, &msg , packet1.
target , packet1.
bitfieldPt );
390 mavlink_msg_ctrl_srfc_pt_decode(&msg, &packet2);
393 memset(&packet2, 0,
sizeof(packet2));
395 mavlink_msg_ctrl_srfc_pt_decode(&msg, &packet2);
398 memset(&packet2, 0,
sizeof(packet2));
400 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
403 mavlink_msg_ctrl_srfc_pt_decode(last_msg, &packet2);
406 memset(&packet2, 0,
sizeof(packet2));
408 mavlink_msg_ctrl_srfc_pt_decode(last_msg, &packet2);
412 static void mavlink_test_slugs_camera_order(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
414 mavlink_message_t msg;
421 memset(&packet1, 0,
sizeof(packet1));
423 packet1.
pan = packet_in.
pan;
430 memset(&packet2, 0,
sizeof(packet2));
431 mavlink_msg_slugs_camera_order_encode(system_id, component_id, &msg, &packet1);
432 mavlink_msg_slugs_camera_order_decode(&msg, &packet2);
435 memset(&packet2, 0,
sizeof(packet2));
436 mavlink_msg_slugs_camera_order_pack(system_id, component_id, &msg , packet1.
target , packet1.
pan , packet1.
tilt , packet1.
zoom , packet1.
moveHome );
437 mavlink_msg_slugs_camera_order_decode(&msg, &packet2);
440 memset(&packet2, 0,
sizeof(packet2));
442 mavlink_msg_slugs_camera_order_decode(&msg, &packet2);
445 memset(&packet2, 0,
sizeof(packet2));
447 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
450 mavlink_msg_slugs_camera_order_decode(last_msg, &packet2);
453 memset(&packet2, 0,
sizeof(packet2));
455 mavlink_msg_slugs_camera_order_decode(last_msg, &packet2);
459 static void mavlink_test_control_surface(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
461 mavlink_message_t msg;
468 memset(&packet1, 0,
sizeof(packet1));
476 memset(&packet2, 0,
sizeof(packet2));
477 mavlink_msg_control_surface_encode(system_id, component_id, &msg, &packet1);
478 mavlink_msg_control_surface_decode(&msg, &packet2);
481 memset(&packet2, 0,
sizeof(packet2));
483 mavlink_msg_control_surface_decode(&msg, &packet2);
486 memset(&packet2, 0,
sizeof(packet2));
488 mavlink_msg_control_surface_decode(&msg, &packet2);
491 memset(&packet2, 0,
sizeof(packet2));
493 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
496 mavlink_msg_control_surface_decode(last_msg, &packet2);
499 memset(&packet2, 0,
sizeof(packet2));
501 mavlink_msg_control_surface_decode(last_msg, &packet2);
505 static void mavlink_test_slugs_mobile_location(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
507 mavlink_message_t msg;
514 memset(&packet1, 0,
sizeof(packet1));
521 memset(&packet2, 0,
sizeof(packet2));
522 mavlink_msg_slugs_mobile_location_encode(system_id, component_id, &msg, &packet1);
523 mavlink_msg_slugs_mobile_location_decode(&msg, &packet2);
526 memset(&packet2, 0,
sizeof(packet2));
527 mavlink_msg_slugs_mobile_location_pack(system_id, component_id, &msg , packet1.
target , packet1.
latitude , packet1.
longitude );
528 mavlink_msg_slugs_mobile_location_decode(&msg, &packet2);
531 memset(&packet2, 0,
sizeof(packet2));
533 mavlink_msg_slugs_mobile_location_decode(&msg, &packet2);
536 memset(&packet2, 0,
sizeof(packet2));
538 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
541 mavlink_msg_slugs_mobile_location_decode(last_msg, &packet2);
544 memset(&packet2, 0,
sizeof(packet2));
546 mavlink_msg_slugs_mobile_location_decode(last_msg, &packet2);
550 static void mavlink_test_slugs_configuration_camera(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
552 mavlink_message_t msg;
559 memset(&packet1, 0,
sizeof(packet1));
566 memset(&packet2, 0,
sizeof(packet2));
567 mavlink_msg_slugs_configuration_camera_encode(system_id, component_id, &msg, &packet1);
568 mavlink_msg_slugs_configuration_camera_decode(&msg, &packet2);
571 memset(&packet2, 0,
sizeof(packet2));
572 mavlink_msg_slugs_configuration_camera_pack(system_id, component_id, &msg , packet1.
target , packet1.
idOrder , packet1.
order );
573 mavlink_msg_slugs_configuration_camera_decode(&msg, &packet2);
576 memset(&packet2, 0,
sizeof(packet2));
578 mavlink_msg_slugs_configuration_camera_decode(&msg, &packet2);
581 memset(&packet2, 0,
sizeof(packet2));
583 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
586 mavlink_msg_slugs_configuration_camera_decode(last_msg, &packet2);
589 memset(&packet2, 0,
sizeof(packet2));
591 mavlink_msg_slugs_configuration_camera_decode(last_msg, &packet2);
595 static void mavlink_test_isr_location(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
597 mavlink_message_t msg;
601 17.0,45.0,73.0,41,108,175,242
604 memset(&packet1, 0,
sizeof(packet1));
615 memset(&packet2, 0,
sizeof(packet2));
616 mavlink_msg_isr_location_encode(system_id, component_id, &msg, &packet1);
617 mavlink_msg_isr_location_decode(&msg, &packet2);
620 memset(&packet2, 0,
sizeof(packet2));
622 mavlink_msg_isr_location_decode(&msg, &packet2);
625 memset(&packet2, 0,
sizeof(packet2));
626 mavlink_msg_isr_location_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
target , packet1.
latitude , packet1.
longitude , packet1.
height , packet1.
option1 , packet1.
option2 , packet1.
option3 );
627 mavlink_msg_isr_location_decode(&msg, &packet2);
630 memset(&packet2, 0,
sizeof(packet2));
632 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
635 mavlink_msg_isr_location_decode(last_msg, &packet2);
638 memset(&packet2, 0,
sizeof(packet2));
640 mavlink_msg_isr_location_decode(last_msg, &packet2);
644 static void mavlink_test_volt_sensor(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
646 mavlink_message_t msg;
653 memset(&packet1, 0,
sizeof(packet1));
660 memset(&packet2, 0,
sizeof(packet2));
661 mavlink_msg_volt_sensor_encode(system_id, component_id, &msg, &packet1);
662 mavlink_msg_volt_sensor_decode(&msg, &packet2);
665 memset(&packet2, 0,
sizeof(packet2));
666 mavlink_msg_volt_sensor_pack(system_id, component_id, &msg , packet1.
r2Type , packet1.
voltage , packet1.
reading2 );
667 mavlink_msg_volt_sensor_decode(&msg, &packet2);
670 memset(&packet2, 0,
sizeof(packet2));
672 mavlink_msg_volt_sensor_decode(&msg, &packet2);
675 memset(&packet2, 0,
sizeof(packet2));
677 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
680 mavlink_msg_volt_sensor_decode(last_msg, &packet2);
683 memset(&packet2, 0,
sizeof(packet2));
685 mavlink_msg_volt_sensor_decode(last_msg, &packet2);
689 static void mavlink_test_ptz_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
691 mavlink_message_t msg;
698 memset(&packet1, 0,
sizeof(packet1));
699 packet1.
pan = packet_in.
pan;
705 memset(&packet2, 0,
sizeof(packet2));
706 mavlink_msg_ptz_status_encode(system_id, component_id, &msg, &packet1);
707 mavlink_msg_ptz_status_decode(&msg, &packet2);
710 memset(&packet2, 0,
sizeof(packet2));
711 mavlink_msg_ptz_status_pack(system_id, component_id, &msg , packet1.
zoom , packet1.
pan , packet1.
tilt );
712 mavlink_msg_ptz_status_decode(&msg, &packet2);
715 memset(&packet2, 0,
sizeof(packet2));
716 mavlink_msg_ptz_status_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
zoom , packet1.
pan , packet1.
tilt );
717 mavlink_msg_ptz_status_decode(&msg, &packet2);
720 memset(&packet2, 0,
sizeof(packet2));
722 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
725 mavlink_msg_ptz_status_decode(last_msg, &packet2);
728 memset(&packet2, 0,
sizeof(packet2));
730 mavlink_msg_ptz_status_decode(last_msg, &packet2);
734 static void mavlink_test_uav_status(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
736 mavlink_message_t msg;
740 17.0,45.0,73.0,101.0,129.0,65
743 memset(&packet1, 0,
sizeof(packet1));
753 memset(&packet2, 0,
sizeof(packet2));
754 mavlink_msg_uav_status_encode(system_id, component_id, &msg, &packet1);
755 mavlink_msg_uav_status_decode(&msg, &packet2);
758 memset(&packet2, 0,
sizeof(packet2));
760 mavlink_msg_uav_status_decode(&msg, &packet2);
763 memset(&packet2, 0,
sizeof(packet2));
765 mavlink_msg_uav_status_decode(&msg, &packet2);
768 memset(&packet2, 0,
sizeof(packet2));
770 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
773 mavlink_msg_uav_status_decode(last_msg, &packet2);
776 memset(&packet2, 0,
sizeof(packet2));
778 mavlink_msg_uav_status_decode(last_msg, &packet2);
782 static void mavlink_test_status_gps(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
784 mavlink_message_t msg;
788 17.0,17443,151,218,29,96,163
791 memset(&packet1, 0,
sizeof(packet1));
802 memset(&packet2, 0,
sizeof(packet2));
803 mavlink_msg_status_gps_encode(system_id, component_id, &msg, &packet1);
804 mavlink_msg_status_gps_decode(&msg, &packet2);
807 memset(&packet2, 0,
sizeof(packet2));
809 mavlink_msg_status_gps_decode(&msg, &packet2);
812 memset(&packet2, 0,
sizeof(packet2));
813 mavlink_msg_status_gps_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
csFails , packet1.
gpsQuality , packet1.
msgsType , packet1.
posStatus , packet1.
magVar , packet1.
magDir , packet1.
modeInd );
814 mavlink_msg_status_gps_decode(&msg, &packet2);
817 memset(&packet2, 0,
sizeof(packet2));
819 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
822 mavlink_msg_status_gps_decode(last_msg, &packet2);
825 memset(&packet2, 0,
sizeof(packet2));
827 mavlink_msg_status_gps_decode(last_msg, &packet2);
831 static void mavlink_test_novatel_diag(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
833 mavlink_message_t msg;
837 963497464,45.0,17651,163,230,41,108
840 memset(&packet1, 0,
sizeof(packet1));
851 memset(&packet2, 0,
sizeof(packet2));
852 mavlink_msg_novatel_diag_encode(system_id, component_id, &msg, &packet1);
853 mavlink_msg_novatel_diag_decode(&msg, &packet2);
856 memset(&packet2, 0,
sizeof(packet2));
858 mavlink_msg_novatel_diag_decode(&msg, &packet2);
861 memset(&packet2, 0,
sizeof(packet2));
862 mavlink_msg_novatel_diag_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
timeStatus , packet1.
receiverStatus , packet1.
solStatus , packet1.
posType , packet1.
velType , packet1.
posSolAge , packet1.
csFails );
863 mavlink_msg_novatel_diag_decode(&msg, &packet2);
866 memset(&packet2, 0,
sizeof(packet2));
868 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
871 mavlink_msg_novatel_diag_decode(last_msg, &packet2);
874 memset(&packet2, 0,
sizeof(packet2));
876 mavlink_msg_novatel_diag_decode(last_msg, &packet2);
880 static void mavlink_test_sensor_diag(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
882 mavlink_message_t msg;
889 memset(&packet1, 0,
sizeof(packet1));
897 memset(&packet2, 0,
sizeof(packet2));
898 mavlink_msg_sensor_diag_encode(system_id, component_id, &msg, &packet1);
899 mavlink_msg_sensor_diag_decode(&msg, &packet2);
902 memset(&packet2, 0,
sizeof(packet2));
903 mavlink_msg_sensor_diag_pack(system_id, component_id, &msg , packet1.
float1 , packet1.
float2 , packet1.
int1 , packet1.
char1 );
904 mavlink_msg_sensor_diag_decode(&msg, &packet2);
907 memset(&packet2, 0,
sizeof(packet2));
909 mavlink_msg_sensor_diag_decode(&msg, &packet2);
912 memset(&packet2, 0,
sizeof(packet2));
914 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
917 mavlink_msg_sensor_diag_decode(last_msg, &packet2);
920 memset(&packet2, 0,
sizeof(packet2));
922 mavlink_msg_sensor_diag_decode(last_msg, &packet2);
926 static void mavlink_test_boot(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
928 mavlink_message_t msg;
935 memset(&packet1, 0,
sizeof(packet1));
940 memset(&packet2, 0,
sizeof(packet2));
941 mavlink_msg_boot_encode(system_id, component_id, &msg, &packet1);
942 mavlink_msg_boot_decode(&msg, &packet2);
945 memset(&packet2, 0,
sizeof(packet2));
946 mavlink_msg_boot_pack(system_id, component_id, &msg , packet1.
version );
947 mavlink_msg_boot_decode(&msg, &packet2);
950 memset(&packet2, 0,
sizeof(packet2));
952 mavlink_msg_boot_decode(&msg, &packet2);
955 memset(&packet2, 0,
sizeof(packet2));
957 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
960 mavlink_msg_boot_decode(last_msg, &packet2);
963 memset(&packet2, 0,
sizeof(packet2));
965 mavlink_msg_boot_decode(last_msg, &packet2);
969 static void mavlink_test_slugs(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
971 mavlink_test_cpu_load(system_id, component_id, last_msg);
972 mavlink_test_sensor_bias(system_id, component_id, last_msg);
973 mavlink_test_diagnostic(system_id, component_id, last_msg);
974 mavlink_test_slugs_navigation(system_id, component_id, last_msg);
975 mavlink_test_data_log(system_id, component_id, last_msg);
976 mavlink_test_gps_date_time(system_id, component_id, last_msg);
977 mavlink_test_mid_lvl_cmds(system_id, component_id, last_msg);
978 mavlink_test_ctrl_srfc_pt(system_id, component_id, last_msg);
979 mavlink_test_slugs_camera_order(system_id, component_id, last_msg);
980 mavlink_test_control_surface(system_id, component_id, last_msg);
981 mavlink_test_slugs_mobile_location(system_id, component_id, last_msg);
982 mavlink_test_slugs_configuration_camera(system_id, component_id, last_msg);
983 mavlink_test_isr_location(system_id, component_id, last_msg);
984 mavlink_test_volt_sensor(system_id, component_id, last_msg);
985 mavlink_test_ptz_status(system_id, component_id, last_msg);
986 mavlink_test_uav_status(system_id, component_id, last_msg);
987 mavlink_test_status_gps(system_id, component_id, last_msg);
988 mavlink_test_novatel_diag(system_id, component_id, last_msg);
989 mavlink_test_sensor_diag(system_id, component_id, last_msg);
990 mavlink_test_boot(system_id, component_id, last_msg);
995 #endif // __cplusplus
996 #endif // SLUGS_TESTSUITE_H
Definition: mavlink_types.h:180
float ayBias
Accelerometer Y bias (m/s)
Definition: mavlink_msg_sensor_bias.h:8
uint16_t csFails
Times the CRC has failed since boot.
Definition: mavlink_msg_novatel_diag.h:9
float mControl
Pending.
Definition: mavlink_msg_control_surface.h:7
Definition: mavlink_msg_ctrl_srfc_pt.h:5
Definition: mavlink_types.h:179
int8_t moveHome
Orders the camera mount to move home. The other fields are ignored when this field is set...
Definition: mavlink_msg_slugs_camera_order.h:11
float fl_5
Log value 5.
Definition: mavlink_msg_data_log.h:11
uint8_t month
Month reported by Gps.
Definition: mavlink_msg_gps_date_time.h:8
uint8_t velType
velocity type. See table 43 page 196
Definition: mavlink_msg_novatel_diag.h:13
Definition: mavlink_msg_slugs_navigation.h:5
uint16_t csFails
Number of times checksum has failed.
Definition: mavlink_msg_status_gps.h:8
float ay_body
Y component of the body acceleration.
Definition: mavlink_msg_slugs_navigation.h:11
Definition: mavlink_msg_sensor_diag.h:5
Definition: mavlink_msg_volt_sensor.h:5
float longitude
ISR Longitude.
Definition: mavlink_msg_isr_location.h:8
uint8_t msgsType
Indicates if GN, GL or GP messages are being received.
Definition: mavlink_msg_status_gps.h:10
float axBias
Accelerometer X bias (m/s)
Definition: mavlink_msg_sensor_bias.h:7
float course
Course UAV.
Definition: mavlink_msg_uav_status.h:11
uint8_t target
The system setting the commands.
Definition: mavlink_msg_control_surface.h:9
float phi_c
Commanded Roll.
Definition: mavlink_msg_slugs_navigation.h:8
uint8_t sec
Sec reported by Gps.
Definition: mavlink_msg_gps_date_time.h:12
uint8_t zoom
The actual Zoom Value.
Definition: mavlink_msg_ptz_status.h:9
float psiDot_c
Commanded Turn rate.
Definition: mavlink_msg_slugs_navigation.h:10
Definition: mavlink_msg_uav_status.h:5
uint16_t h_c
Commanded altitude in 0.1 m.
Definition: mavlink_msg_slugs_navigation.h:14
int16_t diagSh3
Diagnostic short 3.
Definition: mavlink_msg_diagnostic.h:12
int16_t int1
Int 16 field 1.
Definition: mavlink_msg_sensor_diag.h:9
Definition: mavlink_msg_ptz_status.h:5
uint8_t sensLoad
Sensor DSC Load.
Definition: mavlink_msg_cpu_load.h:8
Definition: mavlink_msg_mid_lvl_cmds.h:5
uint8_t visSat
Visible satellites reported by Gps.
Definition: mavlink_msg_gps_date_time.h:14
uint8_t target
The ID system reporting the action.
Definition: mavlink_msg_uav_status.h:12
float float2
Float field 2.
Definition: mavlink_msg_sensor_diag.h:8
uint8_t timeStatus
The Time Status. See Table 8 page 27 Novatel OEMStar Manual.
Definition: mavlink_msg_novatel_diag.h:10
uint8_t ctrlLoad
Control DSC Load.
Definition: mavlink_msg_cpu_load.h:9
float bControl
Order to origin.
Definition: mavlink_msg_control_surface.h:8
float dist2Go
Remaining distance to Run on this leg of Navigation.
Definition: mavlink_msg_slugs_navigation.h:13
Definition: mavlink_msg_status_gps.h:5
Definition: mavlink_msg_sensor_bias.h:5
float u_m
Measured Airspeed prior to the nav filter in m/s.
Definition: mavlink_msg_slugs_navigation.h:7
float latitude
Latitude UAV.
Definition: mavlink_msg_uav_status.h:7
uint8_t idSurface
ID control surface send 0: throttle 1: aileron 2: elevator 3: rudder.
Definition: mavlink_msg_control_surface.h:10
uint8_t idOrder
ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight.
Definition: mavlink_msg_slugs_configuration_camera.h:8
uint8_t GppGl
GPS+GLONASS satellites in Solution.
Definition: mavlink_msg_gps_date_time.h:16
float magVar
Magnetic variation, degrees.
Definition: mavlink_msg_status_gps.h:7
int16_t pan
The Pan value in 10ths of degree.
Definition: mavlink_msg_ptz_status.h:7
uint8_t day
Day reported by Gps.
Definition: mavlink_msg_gps_date_time.h:9
uint8_t hour
Hour reported by Gps.
Definition: mavlink_msg_gps_date_time.h:10
int8_t zoom
Order the zoom values 0 to 10.
Definition: mavlink_msg_slugs_camera_order.h:10
uint16_t reading2
Depends on the value of r2Type (0) Current consumption in uS of PWM, 20 uS = 90Amp (1) Distance in cm...
Definition: mavlink_msg_volt_sensor.h:8
float fl_3
Log value 3.
Definition: mavlink_msg_data_log.h:9
Definition: mavlink_msg_slugs_camera_order.h:5
uint8_t target
The system setting the commands.
Definition: mavlink_msg_mid_lvl_cmds.h:10
uint8_t target
The system reporting the action.
Definition: mavlink_msg_slugs_camera_order.h:7
uint8_t posType
position type. See table 43 page 196
Definition: mavlink_msg_novatel_diag.h:12
uint16_t bitfieldPt
Bitfield containing the passthrough configuration, see CONTROL_SURFACE_FLAG ENUM. ...
Definition: mavlink_msg_ctrl_srfc_pt.h:7
uint8_t option3
Option 3.
Definition: mavlink_msg_isr_location.h:13
uint8_t min
Min reported by Gps.
Definition: mavlink_msg_gps_date_time.h:11
int8_t char1
Int 8 field 1.
Definition: mavlink_msg_sensor_diag.h:10
float hCommand
Commanded Altitude in meters.
Definition: mavlink_msg_mid_lvl_cmds.h:7
Definition: mavlink_msg_cpu_load.h:5
int16_t tilt
The Tilt value in 10ths of degree.
Definition: mavlink_msg_ptz_status.h:8
uint16_t voltage
Voltage in uS of PWM. 0 uS = 0V, 20 uS = 21.5V.
Definition: mavlink_msg_volt_sensor.h:7
int8_t tilt
Order the mount to tilt: -1 down, 0 No tilt motion, +1 up.
Definition: mavlink_msg_slugs_camera_order.h:9
#define MAVLINK_ASSERT(x)
Definition: protocol.h:26
float fl_6
Log value 6.
Definition: mavlink_msg_data_log.h:12
uint32_t version
The onboard software version.
Definition: mavlink_msg_boot.h:7
float rCommand
Commanded Turnrate in rad/s.
Definition: mavlink_msg_mid_lvl_cmds.h:9
#define MAVLINK_MAX_PACKET_LEN
Maximum packet length.
Definition: mavlink_types.h:33
float diagFl3
Diagnostic float 3.
Definition: mavlink_msg_diagnostic.h:9
float azBias
Accelerometer Z bias (m/s)
Definition: mavlink_msg_sensor_bias.h:9
Definition: mavlink_msg_boot.h:5
float gxBias
Gyro X bias (rad/s)
Definition: mavlink_msg_sensor_bias.h:10
uint32_t receiverStatus
Status Bitfield. See table 69 page 350 Novatel OEMstar Manual.
Definition: mavlink_msg_novatel_diag.h:7
int16_t diagSh2
Diagnostic short 2.
Definition: mavlink_msg_diagnostic.h:11
float totalDist
Total Distance to Run on this leg of Navigation.
Definition: mavlink_msg_slugs_navigation.h:12
Definition: mavlink_msg_diagnostic.h:5
float gyBias
Gyro Y bias (rad/s)
Definition: mavlink_msg_sensor_bias.h:11
float diagFl2
Diagnostic float 2.
Definition: mavlink_msg_diagnostic.h:8
float height
ISR Height.
Definition: mavlink_msg_isr_location.h:9
float latitude
ISR Latitude.
Definition: mavlink_msg_isr_location.h:7
float fl_1
Log value 1.
Definition: mavlink_msg_data_log.h:7
uint8_t year
Year reported by Gps.
Definition: mavlink_msg_gps_date_time.h:7
float gzBias
Gyro Z bias (rad/s)
Definition: mavlink_msg_sensor_bias.h:12
uint8_t order
1: up/on 2: down/off 3: auto/reset/no action
Definition: mavlink_msg_slugs_configuration_camera.h:9
int16_t diagSh1
Diagnostic short 1.
Definition: mavlink_msg_diagnostic.h:10
float fl_4
Log value 4.
Definition: mavlink_msg_data_log.h:10
uint8_t useSat
Used satellites in Solution.
Definition: mavlink_msg_gps_date_time.h:15
uint16_t batVolt
Battery Voltage in millivolts.
Definition: mavlink_msg_cpu_load.h:7
Definition: mavlink_msg_control_surface.h:5
float longitude
Longitude UAV.
Definition: mavlink_msg_uav_status.h:8
uint8_t target
The system reporting the action.
Definition: mavlink_msg_isr_location.h:10
uint8_t sigUsedMask
GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)
Definition: mavlink_msg_gps_date_time.h:17
uint8_t r2Type
It is the value of reading 2: 0 - Current, 1 - Foreward Sonar, 2 - Back Sonar, 3 - RPM...
Definition: mavlink_msg_volt_sensor.h:9
Definition: mavlink_msg_isr_location.h:5
uint8_t clockStat
Clock Status. See table 47 page 211 OEMStar Manual.
Definition: mavlink_msg_gps_date_time.h:13
float fl_2
Log value 2.
Definition: mavlink_msg_data_log.h:8
uint8_t posStatus
A = data valid, V = data invalid.
Definition: mavlink_msg_status_gps.h:11
uint8_t target
The system setting the commands.
Definition: mavlink_msg_ctrl_srfc_pt.h:8
float latitude
Mobile Latitude.
Definition: mavlink_msg_slugs_mobile_location.h:7
Definition: mavlink_msg_data_log.h:5
float float1
Float field 1.
Definition: mavlink_msg_sensor_diag.h:7
MAVLINK_HELPER uint16_t mavlink_msg_to_send_buffer(uint8_t *buffer, const mavlink_message_t *msg)
Pack a message to send it over a serial byte stream.
Definition: mavlink_helpers.h:174
uint8_t option2
Option 2.
Definition: mavlink_msg_isr_location.h:12
Definition: mavlink_msg_gps_date_time.h:5
float longitude
Mobile Longitude.
Definition: mavlink_msg_slugs_mobile_location.h:8
float diagFl1
Diagnostic float 1.
Definition: mavlink_msg_diagnostic.h:7
float speed
Speed UAV.
Definition: mavlink_msg_uav_status.h:10
float altitude
Altitude UAV.
Definition: mavlink_msg_uav_status.h:9
int8_t magDir
Magnetic variation direction E/W. Easterly variation (E) subtracts from True course and Westerly vari...
Definition: mavlink_msg_status_gps.h:12
uint8_t toWP
Destination WP.
Definition: mavlink_msg_slugs_navigation.h:16
Definition: mavlink_msg_novatel_diag.h:5
float posSolAge
Age of the position solution in seconds.
Definition: mavlink_msg_novatel_diag.h:8
uint8_t gpsQuality
The quality indicator, 0=fix not available or invalid, 1=GPS fix, 2=C/A differential GPS...
Definition: mavlink_msg_status_gps.h:9
uint8_t fromWP
Origin WP.
Definition: mavlink_msg_slugs_navigation.h:15
uint8_t option1
Option 1.
Definition: mavlink_msg_isr_location.h:11
float uCommand
Commanded Airspeed in m/s.
Definition: mavlink_msg_mid_lvl_cmds.h:8
float theta_c
Commanded Pitch.
Definition: mavlink_msg_slugs_navigation.h:9
int8_t pan
Order the mount to pan: -1 left, 0 No pan motion, +1 right.
Definition: mavlink_msg_slugs_camera_order.h:8
Definition: mavlink_msg_slugs_mobile_location.h:5
uint8_t target
The system reporting the action.
Definition: mavlink_msg_slugs_mobile_location.h:9
Definition: mavlink_msg_slugs_configuration_camera.h:5
uint8_t target
The system setting the commands.
Definition: mavlink_msg_slugs_configuration_camera.h:7
uint8_t solStatus
solution Status. See table 44 page 197
Definition: mavlink_msg_novatel_diag.h:11
uint8_t modeInd
Positioning system mode indicator. A - Autonomous;D-Differential; E-Estimated (dead reckoning) mode;M...
Definition: mavlink_msg_status_gps.h:13
uint8_t percentUsed
Percent used GPS.
Definition: mavlink_msg_gps_date_time.h:18