4#define MAVLINK_MSG_ID_ESC_STATUS 291
13} mavlink_esc_status_t;
15#define MAVLINK_MSG_ID_ESC_STATUS_LEN 57
16#define MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN 57
17#define MAVLINK_MSG_ID_291_LEN 57
18#define MAVLINK_MSG_ID_291_MIN_LEN 57
20#define MAVLINK_MSG_ID_ESC_STATUS_CRC 10
21#define MAVLINK_MSG_ID_291_CRC 10
23#define MAVLINK_MSG_ESC_STATUS_FIELD_RPM_LEN 4
24#define MAVLINK_MSG_ESC_STATUS_FIELD_VOLTAGE_LEN 4
25#define MAVLINK_MSG_ESC_STATUS_FIELD_CURRENT_LEN 4
27#if MAVLINK_COMMAND_24BIT
28#define MAVLINK_MESSAGE_INFO_ESC_STATUS {
32 { { "index", NULL, MAVLINK_TYPE_UINT8_T, 0
, 56
, offsetof(mavlink_esc_status_t, index) },
33 { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0
, 0
, offsetof(mavlink_esc_status_t, time_usec) },
34 { "rpm", NULL, MAVLINK_TYPE_INT32_T, 4
, 8
, offsetof(mavlink_esc_status_t, rpm) },
35 { "voltage", NULL, MAVLINK_TYPE_FLOAT, 4
, 24
, offsetof(mavlink_esc_status_t, voltage) },
36 { "current", NULL, MAVLINK_TYPE_FLOAT, 4
, 40
, offsetof(mavlink_esc_status_t, current) },
38}
40#define MAVLINK_MESSAGE_INFO_ESC_STATUS {
43 { { "index", NULL, MAVLINK_TYPE_UINT8_T, 0
, 56
, offsetof(mavlink_esc_status_t, index) },
44 { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0
, 0
, offsetof(mavlink_esc_status_t, time_usec) },
45 { "rpm", NULL, MAVLINK_TYPE_INT32_T, 4
, 8
, offsetof(mavlink_esc_status_t, rpm) },
46 { "voltage", NULL, MAVLINK_TYPE_FLOAT, 4
, 24
, offsetof(mavlink_esc_status_t, voltage) },
47 { "current", NULL, MAVLINK_TYPE_FLOAT, 4
, 40
, offsetof(mavlink_esc_status_t, current) },
49}
53
54
55
56
57
58
59
60
61
62
63
64
66static inline uint16_t mavlink_msg_esc_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
67 uint8_t index, uint64_t time_usec,
const int32_t *rpm,
const float *voltage,
const float *current)
69#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
71 _mav_put_uint64_t(buf, 0, time_usec);
72 _mav_put_uint8_t(buf, 56, index);
73 _mav_put_int32_t_array(buf, 8, rpm, 4);
74 _mav_put_float_array(buf, 24, voltage, 4);
75 _mav_put_float_array(buf, 40, current, 4);
78 mavlink_esc_status_t packet;
79 packet.time_usec = time_usec;
81 mav_array_memcpy(packet.rpm, rpm,
sizeof(int32_t)*4);
82 mav_array_memcpy(packet.voltage, voltage,
sizeof(
float)*4);
83 mav_array_memcpy(packet.current, current,
sizeof(
float)*4);
84 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESC_STATUS_LEN);
92
93
94
95
96
97
98
99
100
101
102
103
104
105static inline uint16_t mavlink_msg_esc_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
106 uint8_t index, uint64_t time_usec,
const int32_t *rpm,
const float *voltage,
const float *current)
108#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
110 _mav_put_uint64_t(buf, 0, time_usec);
111 _mav_put_uint8_t(buf, 56, index);
112 _mav_put_int32_t_array(buf, 8, rpm, 4);
113 _mav_put_float_array(buf, 24, voltage, 4);
114 _mav_put_float_array(buf, 40, current, 4);
117 mavlink_esc_status_t packet;
118 packet.time_usec = time_usec;
119 packet.index = index;
120 mav_array_memcpy(packet.rpm, rpm,
sizeof(int32_t)*4);
121 mav_array_memcpy(packet.voltage, voltage,
sizeof(
float)*4);
122 mav_array_memcpy(packet.current, current,
sizeof(
float)*4);
123 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESC_STATUS_LEN);
128 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESC_STATUS_LEN, MAVLINK_MSG_ID_ESC_STATUS_CRC);
135
136
137
138
139
140
141
142
143
144
145
146
148static inline uint16_t mavlink_msg_esc_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
149 mavlink_message_t* msg,
150 uint8_t index,uint64_t time_usec,
const int32_t *rpm,
const float *voltage,
const float *current)
152#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
154 _mav_put_uint64_t(buf, 0, time_usec);
155 _mav_put_uint8_t(buf, 56, index);
156 _mav_put_int32_t_array(buf, 8, rpm, 4);
157 _mav_put_float_array(buf, 24, voltage, 4);
158 _mav_put_float_array(buf, 40, current, 4);
161 mavlink_esc_status_t packet;
162 packet.time_usec = time_usec;
163 packet.index = index;
164 mav_array_memcpy(packet.rpm, rpm,
sizeof(int32_t)*4);
165 mav_array_memcpy(packet.voltage, voltage,
sizeof(
float)*4);
166 mav_array_memcpy(packet.current, current,
sizeof(
float)*4);
167 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ESC_STATUS_LEN);
175
176
177
178
179
180
181
183static inline uint16_t mavlink_msg_esc_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_esc_status_t* esc_status)
185 return mavlink_msg_esc_status_pack(system_id, component_id, msg, esc_status->index, esc_status->time_usec, esc_status->rpm, esc_status->voltage, esc_status->current);
189
190
191
192
193
194
195
196
198static inline uint16_t mavlink_msg_esc_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_esc_status_t* esc_status)
200 return mavlink_msg_esc_status_pack_chan(system_id, component_id, chan, msg, esc_status->index, esc_status->time_usec, esc_status->rpm, esc_status->voltage, esc_status->current);
204
205
206
207
208
209
210
211
212static inline uint16_t mavlink_msg_esc_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_esc_status_t* esc_status)
214 return mavlink_msg_esc_status_pack_status(system_id, component_id, _status, msg, esc_status->index, esc_status->time_usec, esc_status->rpm, esc_status->voltage, esc_status->current);
218
219
220
221
222
223
224
225
226
227#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
230static inline void mavlink_msg_esc_status_send(mavlink_channel_t chan, uint8_t index, uint64_t time_usec,
const int32_t *rpm,
const float *voltage,
const float *current)
232#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
233 char buf[MAVLINK_MSG_ID_ESC_STATUS_LEN];
234 _mav_put_uint64_t(buf, 0, time_usec);
235 _mav_put_uint8_t(buf, 56, index);
236 _mav_put_int32_t_array(buf, 8, rpm, 4);
237 _mav_put_float_array(buf, 24, voltage, 4);
238 _mav_put_float_array(buf, 40, current, 4);
239 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESC_STATUS, buf, MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESC_STATUS_LEN, MAVLINK_MSG_ID_ESC_STATUS_CRC);
241 mavlink_esc_status_t packet;
242 packet.time_usec = time_usec;
243 packet.index = index;
244 mav_array_memcpy(packet.rpm, rpm,
sizeof(int32_t)*4);
245 mav_array_memcpy(packet.voltage, voltage,
sizeof(
float)*4);
246 mav_array_memcpy(packet.current, current,
sizeof(
float)*4);
247 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESC_STATUS, (
const char *)&packet, MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESC_STATUS_LEN, MAVLINK_MSG_ID_ESC_STATUS_CRC);
252
253
254
255
257static inline void mavlink_msg_esc_status_send_struct(mavlink_channel_t chan,
const mavlink_esc_status_t* esc_status)
259#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
260 mavlink_msg_esc_status_send(chan, esc_status->index, esc_status->time_usec, esc_status->rpm, esc_status->voltage, esc_status->current);
262 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESC_STATUS, (
const char *)esc_status, MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESC_STATUS_LEN, MAVLINK_MSG_ID_ESC_STATUS_CRC);
266#if MAVLINK_MSG_ID_ESC_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
268
269
270
271
272
273
275static inline void mavlink_msg_esc_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t index, uint64_t time_usec,
const int32_t *rpm,
const float *voltage,
const float *current)
277#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
278 char *buf = (
char *)msgbuf;
279 _mav_put_uint64_t(buf, 0, time_usec);
280 _mav_put_uint8_t(buf, 56, index);
281 _mav_put_int32_t_array(buf, 8, rpm, 4);
282 _mav_put_float_array(buf, 24, voltage, 4);
283 _mav_put_float_array(buf, 40, current, 4);
284 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESC_STATUS, buf, MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESC_STATUS_LEN, MAVLINK_MSG_ID_ESC_STATUS_CRC);
286 mavlink_esc_status_t *packet = (mavlink_esc_status_t *)msgbuf;
287 packet->time_usec = time_usec;
288 packet->index = index;
289 mav_array_memcpy(packet->rpm, rpm,
sizeof(int32_t)*4);
290 mav_array_memcpy(packet->voltage, voltage,
sizeof(
float)*4);
291 mav_array_memcpy(packet->current, current,
sizeof(
float)*4);
292 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ESC_STATUS, (
const char *)packet, MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN, MAVLINK_MSG_ID_ESC_STATUS_LEN, MAVLINK_MSG_ID_ESC_STATUS_CRC);
303
304
305
306
308static inline uint8_t mavlink_msg_esc_status_get_index(
const mavlink_message_t* msg)
310 return _MAV_RETURN_uint8_t(msg, 56);
314
315
316
317
319static inline uint64_t mavlink_msg_esc_status_get_time_usec(
const mavlink_message_t* msg)
321 return _MAV_RETURN_uint64_t(msg, 0);
325
326
327
328
330static inline uint16_t mavlink_msg_esc_status_get_rpm(
const mavlink_message_t* msg, int32_t *rpm)
332 return _MAV_RETURN_int32_t_array(msg, rpm, 4, 8);
336
337
338
339
341static inline uint16_t mavlink_msg_esc_status_get_voltage(
const mavlink_message_t* msg,
float *voltage)
343 return _MAV_RETURN_float_array(msg, voltage, 4, 24);
347
348
349
350
352static inline uint16_t mavlink_msg_esc_status_get_current(
const mavlink_message_t* msg,
float *current)
354 return _MAV_RETURN_float_array(msg, current, 4, 40);
358
359
360
361
362
364static inline void mavlink_msg_esc_status_decode(
const mavlink_message_t* msg, mavlink_esc_status_t* esc_status)
366#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
367 esc_status->time_usec = mavlink_msg_esc_status_get_time_usec(msg);
368 mavlink_msg_esc_status_get_rpm(msg, esc_status->rpm);
369 mavlink_msg_esc_status_get_voltage(msg, esc_status->voltage);
370 mavlink_msg_esc_status_get_current(msg, esc_status->current);
371 esc_status->index = mavlink_msg_esc_status_get_index(msg);
373 uint8_t len = msg->len < MAVLINK_MSG_ID_ESC_STATUS_LEN? msg->len : MAVLINK_MSG_ID_ESC_STATUS_LEN;
374 memset(esc_status, 0, MAVLINK_MSG_ID_ESC_STATUS_LEN);
375 memcpy(esc_status, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_ESC_STATUS_LEN
Definition: mavlink_msg_esc_status.h:15
#define MAVLINK_MSG_ID_ESC_STATUS_CRC
Definition: mavlink_msg_esc_status.h:20
#define MAVLINK_MSG_ID_ESC_STATUS
Definition: mavlink_msg_esc_status.h:4
#define MAVLINK_MSG_ID_ESC_STATUS_MIN_LEN
Definition: mavlink_msg_esc_status.h:16
Definition: mavlink_msg_esc_status.h:7
uint64_t time_usec
Definition: mavlink_msg_esc_status.h:8
float voltage[4]
Definition: mavlink_msg_esc_status.h:10
float current[4]
Definition: mavlink_msg_esc_status.h:11
uint8_t index
Definition: mavlink_msg_esc_status.h:12