3 #define MAVLINK_MSG_ID_SERIAL_CONTROL 126
15 #define MAVLINK_MSG_ID_SERIAL_CONTROL_LEN 79
16 #define MAVLINK_MSG_ID_126_LEN 79
18 #define MAVLINK_MSG_ID_SERIAL_CONTROL_CRC 220
19 #define MAVLINK_MSG_ID_126_CRC 220
21 #define MAVLINK_MSG_SERIAL_CONTROL_FIELD_DATA_LEN 70
23 #define MAVLINK_MESSAGE_INFO_SERIAL_CONTROL { \
26 { { "baudrate", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_serial_control_t, baudrate) }, \
27 { "timeout", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_serial_control_t, timeout) }, \
28 { "device", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_serial_control_t, device) }, \
29 { "flags", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_serial_control_t, flags) }, \
30 { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_serial_control_t, count) }, \
31 { "data", NULL, MAVLINK_TYPE_UINT8_T, 70, 9, offsetof(mavlink_serial_control_t, data) }, \
50 static inline uint16_t mavlink_msg_serial_control_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
51 uint8_t
device, uint8_t
flags, uint16_t timeout, uint32_t baudrate, uint8_t count,
const uint8_t *
data)
53 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
60 _mav_put_uint8_t_array(buf, 9, data, 70);
69 mav_array_memcpy(packet.
data, data,
sizeof(uint8_t)*70);
95 static inline uint16_t mavlink_msg_serial_control_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
96 mavlink_message_t* msg,
97 uint8_t
device,uint8_t
flags,uint16_t timeout,uint32_t baudrate,uint8_t count,
const uint8_t *
data)
99 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
106 _mav_put_uint8_t_array(buf, 9, data, 70);
114 packet.
count = count;
115 mav_array_memcpy(packet.
data, data,
sizeof(uint8_t)*70);
120 #if MAVLINK_CRC_EXTRA
135 static inline uint16_t mavlink_msg_serial_control_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_serial_control_t* serial_control)
137 return mavlink_msg_serial_control_pack(system_id, component_id, msg, serial_control->
device, serial_control->
flags, serial_control->
timeout, serial_control->
baudrate, serial_control->
count, serial_control->
data);
149 static inline uint16_t mavlink_msg_serial_control_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_serial_control_t* serial_control)
151 return mavlink_msg_serial_control_pack_chan(system_id, component_id, chan, msg, serial_control->
device, serial_control->
flags, serial_control->
timeout, serial_control->
baudrate, serial_control->
count, serial_control->
data);
165 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
167 static inline void mavlink_msg_serial_control_send(
mavlink_channel_t chan, uint8_t device, uint8_t flags, uint16_t timeout, uint32_t baudrate, uint8_t count,
const uint8_t *data)
169 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
176 _mav_put_uint8_t_array(buf, 9, data, 70);
177 #if MAVLINK_CRC_EXTRA
188 packet.
count = count;
189 mav_array_memcpy(packet.
data, data,
sizeof(uint8_t)*70);
190 #if MAVLINK_CRC_EXTRA
198 #if MAVLINK_MSG_ID_SERIAL_CONTROL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
206 static inline void mavlink_msg_serial_control_send_buf(mavlink_message_t *msgbuf,
mavlink_channel_t chan, uint8_t device, uint8_t flags, uint16_t timeout, uint32_t baudrate, uint8_t count,
const uint8_t *data)
208 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
209 char *buf = (
char *)msgbuf;
215 _mav_put_uint8_t_array(buf, 9, data, 70);
216 #if MAVLINK_CRC_EXTRA
227 packet->
count = count;
228 mav_array_memcpy(packet->
data, data,
sizeof(uint8_t)*70);
229 #if MAVLINK_CRC_EXTRA
248 static inline uint8_t mavlink_msg_serial_control_get_device(
const mavlink_message_t* msg)
258 static inline uint8_t mavlink_msg_serial_control_get_flags(
const mavlink_message_t* msg)
268 static inline uint16_t mavlink_msg_serial_control_get_timeout(
const mavlink_message_t* msg)
270 return _MAV_RETURN_uint16_t(msg, 4);
278 static inline uint32_t mavlink_msg_serial_control_get_baudrate(
const mavlink_message_t* msg)
280 return _MAV_RETURN_uint32_t(msg, 0);
288 static inline uint8_t mavlink_msg_serial_control_get_count(
const mavlink_message_t* msg)
298 static inline uint16_t mavlink_msg_serial_control_get_data(
const mavlink_message_t* msg, uint8_t *data)
300 return _MAV_RETURN_uint8_t_array(msg, data, 70, 9);
309 static inline void mavlink_msg_serial_control_decode(
const mavlink_message_t* msg,
mavlink_serial_control_t* serial_control)
311 #if MAVLINK_NEED_BYTE_SWAP
312 serial_control->
baudrate = mavlink_msg_serial_control_get_baudrate(msg);
313 serial_control->
timeout = mavlink_msg_serial_control_get_timeout(msg);
314 serial_control->
device = mavlink_msg_serial_control_get_device(msg);
315 serial_control->
flags = mavlink_msg_serial_control_get_flags(msg);
316 serial_control->
count = mavlink_msg_serial_control_get_count(msg);
317 mavlink_msg_serial_control_get_data(msg, serial_control->
data);
#define MAVLINK_MSG_ID_SERIAL_CONTROL_LEN
Definition: mavlink_msg_serial_control.h:15
uint8_t data[70]
serial data
Definition: mavlink_msg_serial_control.h:12
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
uint8_t flags
See SERIAL_CONTROL_FLAG enum.
Definition: mavlink_msg_serial_control.h:10
MAVLINK_HELPER uint16_t mavlink_finalize_message(mavlink_message_t *msg, uint8_t system_id, uint8_t component_id, uint8_t length)
Finalize a MAVLink message with MAVLINK_COMM_0 as default channel.
Definition: mavlink_helpers.h:105
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134
struct __mavlink_serial_control_t mavlink_serial_control_t
#define _MAV_PAYLOAD_NON_CONST(msg)
Definition: mavlink_types.h:172
uint8_t device
See SERIAL_CONTROL_DEV enum.
Definition: mavlink_msg_serial_control.h:9
uint8_t count
how many bytes in this transfer
Definition: mavlink_msg_serial_control.h:11
uint32_t baudrate
Baudrate of transfer. Zero means no change.
Definition: mavlink_msg_serial_control.h:7
mavlink_channel_t
Definition: mavlink_types.h:178
uint16_t timeout
Timeout for reply data in milliseconds.
Definition: mavlink_msg_serial_control.h:8
uint8_t device
Definition: blackbox.h:85
#define _MAV_PAYLOAD(msg)
Definition: mavlink_types.h:171
uint16_t flags
Definition: ledstrip.h:11
#define MAVLINK_MSG_ID_SERIAL_CONTROL
Definition: mavlink_msg_serial_control.h:3
#define MAVLINK_MSG_ID_SERIAL_CONTROL_CRC
Definition: mavlink_msg_serial_control.h:18
Definition: mavlink_msg_serial_control.h:5
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139
MAVLINK_HELPER uint16_t mavlink_finalize_message_chan(mavlink_message_t *msg, uint8_t system_id, uint8_t component_id, uint8_t chan, uint8_t length)
Finalize a MAVLink message with channel assignment.
Definition: mavlink_helpers.h:71
uint16_t data
Definition: config.c:91
#define _mav_put_uint32_t(buf, wire_offset, b)
Definition: protocol.h:141