5 #ifndef AUTOQUAD_TESTSUITE_H
6 #define AUTOQUAD_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_autoquad(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_autoquad(system_id, component_id, last_msg);
24 #include "../common/testsuite.h"
27 static void mavlink_test_aq_telemetry_f(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
29 mavlink_message_t msg;
33 17.0,45.0,73.0,101.0,129.0,157.0,185.0,213.0,241.0,269.0,297.0,325.0,353.0,381.0,409.0,437.0,465.0,493.0,521.0,549.0,21395
36 memset(&packet1, 0,
sizeof(packet1));
61 memset(&packet2, 0,
sizeof(packet2));
62 mavlink_msg_aq_telemetry_f_encode(system_id, component_id, &msg, &packet1);
63 mavlink_msg_aq_telemetry_f_decode(&msg, &packet2);
66 memset(&packet2, 0,
sizeof(packet2));
67 mavlink_msg_aq_telemetry_f_pack(system_id, component_id, &msg , packet1.
Index , packet1.
value1 , packet1.
value2 , packet1.
value3 , packet1.
value4 , packet1.
value5 , packet1.
value6 , packet1.
value7 , packet1.
value8 , packet1.
value9 , packet1.
value10 , packet1.
value11 , packet1.
value12 , packet1.
value13 , packet1.
value14 , packet1.
value15 , packet1.
value16 , packet1.
value17 , packet1.
value18 , packet1.
value19 , packet1.
value20 );
68 mavlink_msg_aq_telemetry_f_decode(&msg, &packet2);
71 memset(&packet2, 0,
sizeof(packet2));
72 mavlink_msg_aq_telemetry_f_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
Index , packet1.
value1 , packet1.
value2 , packet1.
value3 , packet1.
value4 , packet1.
value5 , packet1.
value6 , packet1.
value7 , packet1.
value8 , packet1.
value9 , packet1.
value10 , packet1.
value11 , packet1.
value12 , packet1.
value13 , packet1.
value14 , packet1.
value15 , packet1.
value16 , packet1.
value17 , packet1.
value18 , packet1.
value19 , packet1.
value20 );
73 mavlink_msg_aq_telemetry_f_decode(&msg, &packet2);
76 memset(&packet2, 0,
sizeof(packet2));
78 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
81 mavlink_msg_aq_telemetry_f_decode(last_msg, &packet2);
84 memset(&packet2, 0,
sizeof(packet2));
85 mavlink_msg_aq_telemetry_f_send(
MAVLINK_COMM_1 , packet1.
Index , packet1.
value1 , packet1.
value2 , packet1.
value3 , packet1.
value4 , packet1.
value5 , packet1.
value6 , packet1.
value7 , packet1.
value8 , packet1.
value9 , packet1.
value10 , packet1.
value11 , packet1.
value12 , packet1.
value13 , packet1.
value14 , packet1.
value15 , packet1.
value16 , packet1.
value17 , packet1.
value18 , packet1.
value19 , packet1.
value20 );
86 mavlink_msg_aq_telemetry_f_decode(last_msg, &packet2);
90 static void mavlink_test_aq_esc_telemetry(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
92 mavlink_message_t msg;
96 963497464,{ 963497672, 963497673, 963497674, 963497675 },{ 963498504, 963498505, 963498506, 963498507 },{ 19107, 19108, 19109, 19110 },137,204,15,{ 82, 83, 84, 85 },{ 94, 95, 96, 97 }
99 memset(&packet1, 0,
sizeof(packet1));
101 packet1.
seq = packet_in.
seq;
105 mav_array_memcpy(packet1.
data0, packet_in.
data0,
sizeof(uint32_t)*4);
106 mav_array_memcpy(packet1.
data1, packet_in.
data1,
sizeof(uint32_t)*4);
108 mav_array_memcpy(packet1.
escid, packet_in.
escid,
sizeof(uint8_t)*4);
112 memset(&packet2, 0,
sizeof(packet2));
113 mavlink_msg_aq_esc_telemetry_encode(system_id, component_id, &msg, &packet1);
114 mavlink_msg_aq_esc_telemetry_decode(&msg, &packet2);
117 memset(&packet2, 0,
sizeof(packet2));
118 mavlink_msg_aq_esc_telemetry_pack(system_id, component_id, &msg , packet1.
time_boot_ms , packet1.
seq , packet1.
num_motors , packet1.
num_in_seq , packet1.
escid , packet1.
status_age , packet1.
data_version , packet1.
data0 , packet1.
data1 );
119 mavlink_msg_aq_esc_telemetry_decode(&msg, &packet2);
122 memset(&packet2, 0,
sizeof(packet2));
123 mavlink_msg_aq_esc_telemetry_pack_chan(system_id, component_id,
MAVLINK_COMM_0, &msg , packet1.
time_boot_ms , packet1.
seq , packet1.
num_motors , packet1.
num_in_seq , packet1.
escid , packet1.
status_age , packet1.
data_version , packet1.
data0 , packet1.
data1 );
124 mavlink_msg_aq_esc_telemetry_decode(&msg, &packet2);
127 memset(&packet2, 0,
sizeof(packet2));
129 for (i=0; i<mavlink_msg_get_send_buffer_length(&msg); i++) {
132 mavlink_msg_aq_esc_telemetry_decode(last_msg, &packet2);
135 memset(&packet2, 0,
sizeof(packet2));
137 mavlink_msg_aq_esc_telemetry_decode(last_msg, &packet2);
141 static void mavlink_test_autoquad(uint8_t system_id, uint8_t component_id, mavlink_message_t *last_msg)
143 mavlink_test_aq_telemetry_f(system_id, component_id, last_msg);
144 mavlink_test_aq_esc_telemetry(system_id, component_id, last_msg);
149 #endif // __cplusplus
150 #endif // AUTOQUAD_TESTSUITE_H
Definition: mavlink_types.h:180
Definition: mavlink_types.h:179
float value3
value3
Definition: mavlink_msg_aq_telemetry_f.h:9
float value19
value19
Definition: mavlink_msg_aq_telemetry_f.h:25
float value14
value14
Definition: mavlink_msg_aq_telemetry_f.h:20
uint8_t seq
Sequence number of message (first set of 4 motors is #1, next 4 is #2, etc).
Definition: mavlink_msg_aq_esc_telemetry.h:11
float value9
value9
Definition: mavlink_msg_aq_telemetry_f.h:15
uint8_t data_version[4]
Version of data structure (determines contents).
Definition: mavlink_msg_aq_esc_telemetry.h:15
float value8
value8
Definition: mavlink_msg_aq_telemetry_f.h:14
uint8_t escid[4]
ESC/Motor ID.
Definition: mavlink_msg_aq_esc_telemetry.h:14
float value1
value1
Definition: mavlink_msg_aq_telemetry_f.h:7
float value12
value12
Definition: mavlink_msg_aq_telemetry_f.h:18
float value17
value17
Definition: mavlink_msg_aq_telemetry_f.h:23
float value16
value16
Definition: mavlink_msg_aq_telemetry_f.h:22
float value10
value10
Definition: mavlink_msg_aq_telemetry_f.h:16
Definition: mavlink_msg_aq_esc_telemetry.h:5
#define MAVLINK_ASSERT(x)
Definition: protocol.h:26
uint32_t time_boot_ms
Timestamp of the component clock since boot time in ms.
Definition: mavlink_msg_aq_esc_telemetry.h:7
#define MAVLINK_MAX_PACKET_LEN
Maximum packet length.
Definition: mavlink_types.h:33
float value2
value2
Definition: mavlink_msg_aq_telemetry_f.h:8
float value15
value15
Definition: mavlink_msg_aq_telemetry_f.h:21
uint16_t Index
Index of message.
Definition: mavlink_msg_aq_telemetry_f.h:27
uint32_t data1[4]
Data bits 33-64 for each ESC.
Definition: mavlink_msg_aq_esc_telemetry.h:9
uint16_t status_age[4]
Age of each ESC telemetry reading in ms compared to boot time. A value of 0xFFFF means timeout/no dat...
Definition: mavlink_msg_aq_esc_telemetry.h:10
float value20
value20
Definition: mavlink_msg_aq_telemetry_f.h:26
float value5
value5
Definition: mavlink_msg_aq_telemetry_f.h:11
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
float value18
value18
Definition: mavlink_msg_aq_telemetry_f.h:24
uint32_t data0[4]
Data bits 1-32 for each ESC.
Definition: mavlink_msg_aq_esc_telemetry.h:8
float value7
value7
Definition: mavlink_msg_aq_telemetry_f.h:13
float value13
value13
Definition: mavlink_msg_aq_telemetry_f.h:19
float value11
value11
Definition: mavlink_msg_aq_telemetry_f.h:17
Definition: mavlink_msg_aq_telemetry_f.h:5
uint8_t num_in_seq
Number of active ESCs in this sequence (1 through this many array members will be populated with data...
Definition: mavlink_msg_aq_esc_telemetry.h:13
float value4
value4
Definition: mavlink_msg_aq_telemetry_f.h:10
float value6
value6
Definition: mavlink_msg_aq_telemetry_f.h:12
uint8_t num_motors
Total number of active ESCs/motors on the system.
Definition: mavlink_msg_aq_esc_telemetry.h:12