4#define MAVLINK_MSG_ID_DEVICE_OP_WRITE 11002
7typedef struct __mavlink_device_op_write_t {
10 uint8_t target_component;
18}) mavlink_device_op_write_t;
20#define MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN 179
21#define MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN 179
22#define MAVLINK_MSG_ID_11002_LEN 179
23#define MAVLINK_MSG_ID_11002_MIN_LEN 179
25#define MAVLINK_MSG_ID_DEVICE_OP_WRITE_CRC 234
26#define MAVLINK_MSG_ID_11002_CRC 234
28#define MAVLINK_MSG_DEVICE_OP_WRITE_FIELD_BUSNAME_LEN 40
29#define MAVLINK_MSG_DEVICE_OP_WRITE_FIELD_DATA_LEN 128
31#if MAVLINK_COMMAND_24BIT
32#define MAVLINK_MESSAGE_INFO_DEVICE_OP_WRITE { \
36 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_device_op_write_t, target_system) }, \
37 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_device_op_write_t, target_component) }, \
38 { "request_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_device_op_write_t, request_id) }, \
39 { "bustype", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_device_op_write_t, bustype) }, \
40 { "bus", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_device_op_write_t, bus) }, \
41 { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_device_op_write_t, address) }, \
42 { "busname", NULL, MAVLINK_TYPE_CHAR, 40, 9, offsetof(mavlink_device_op_write_t, busname) }, \
43 { "regstart", NULL, MAVLINK_TYPE_UINT8_T, 0, 49, offsetof(mavlink_device_op_write_t, regstart) }, \
44 { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_device_op_write_t, count) }, \
45 { "data", NULL, MAVLINK_TYPE_UINT8_T, 128, 51, offsetof(mavlink_device_op_write_t, data) }, \
49#define MAVLINK_MESSAGE_INFO_DEVICE_OP_WRITE { \
52 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_device_op_write_t, target_system) }, \
53 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_device_op_write_t, target_component) }, \
54 { "request_id", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_device_op_write_t, request_id) }, \
55 { "bustype", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_device_op_write_t, bustype) }, \
56 { "bus", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_device_op_write_t, bus) }, \
57 { "address", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_device_op_write_t, address) }, \
58 { "busname", NULL, MAVLINK_TYPE_CHAR, 40, 9, offsetof(mavlink_device_op_write_t, busname) }, \
59 { "regstart", NULL, MAVLINK_TYPE_UINT8_T, 0, 49, offsetof(mavlink_device_op_write_t, regstart) }, \
60 { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_device_op_write_t, count) }, \
61 { "data", NULL, MAVLINK_TYPE_UINT8_T, 128, 51, offsetof(mavlink_device_op_write_t, data) }, \
84static inline uint16_t mavlink_msg_device_op_write_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
85 uint8_t target_system, uint8_t target_component, uint32_t request_id, uint8_t bustype, uint8_t bus, uint8_t address,
const char *busname, uint8_t regstart, uint8_t count,
const uint8_t *data)
87#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
88 char buf[MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN];
89 _mav_put_uint32_t(buf, 0, request_id);
90 _mav_put_uint8_t(buf, 4, target_system);
91 _mav_put_uint8_t(buf, 5, target_component);
92 _mav_put_uint8_t(buf, 6, bustype);
93 _mav_put_uint8_t(buf, 7, bus);
94 _mav_put_uint8_t(buf, 8, address);
95 _mav_put_uint8_t(buf, 49, regstart);
96 _mav_put_uint8_t(buf, 50, count);
97 _mav_put_char_array(buf, 9, busname, 40);
98 _mav_put_uint8_t_array(buf, 51, data, 128);
99 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN);
101 mavlink_device_op_write_t packet;
102 packet.request_id = request_id;
103 packet.target_system = target_system;
104 packet.target_component = target_component;
105 packet.bustype = bustype;
107 packet.address = address;
108 packet.regstart = regstart;
109 packet.count = count;
110 mav_array_memcpy(packet.busname, busname,
sizeof(
char)*40);
111 mav_array_memcpy(packet.data, data,
sizeof(uint8_t)*128);
112 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN);
115 msg->msgid = MAVLINK_MSG_ID_DEVICE_OP_WRITE;
116 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_CRC);
137static inline uint16_t mavlink_msg_device_op_write_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
138 mavlink_message_t* msg,
139 uint8_t target_system,uint8_t target_component,uint32_t request_id,uint8_t bustype,uint8_t bus,uint8_t address,
const char *busname,uint8_t regstart,uint8_t count,
const uint8_t *data)
141#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
142 char buf[MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN];
143 _mav_put_uint32_t(buf, 0, request_id);
144 _mav_put_uint8_t(buf, 4, target_system);
145 _mav_put_uint8_t(buf, 5, target_component);
146 _mav_put_uint8_t(buf, 6, bustype);
147 _mav_put_uint8_t(buf, 7, bus);
148 _mav_put_uint8_t(buf, 8, address);
149 _mav_put_uint8_t(buf, 49, regstart);
150 _mav_put_uint8_t(buf, 50, count);
151 _mav_put_char_array(buf, 9, busname, 40);
152 _mav_put_uint8_t_array(buf, 51, data, 128);
153 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN);
155 mavlink_device_op_write_t packet;
156 packet.request_id = request_id;
157 packet.target_system = target_system;
158 packet.target_component = target_component;
159 packet.bustype = bustype;
161 packet.address = address;
162 packet.regstart = regstart;
163 packet.count = count;
164 mav_array_memcpy(packet.busname, busname,
sizeof(
char)*40);
165 mav_array_memcpy(packet.data, data,
sizeof(uint8_t)*128);
166 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN);
169 msg->msgid = MAVLINK_MSG_ID_DEVICE_OP_WRITE;
170 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_CRC);
181static inline uint16_t mavlink_msg_device_op_write_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_device_op_write_t* device_op_write)
183 return mavlink_msg_device_op_write_pack(system_id, component_id, msg, device_op_write->target_system, device_op_write->target_component, device_op_write->request_id, device_op_write->bustype, device_op_write->bus, device_op_write->address, device_op_write->busname, device_op_write->regstart, device_op_write->count, device_op_write->data);
195static inline uint16_t mavlink_msg_device_op_write_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_device_op_write_t* device_op_write)
197 return mavlink_msg_device_op_write_pack_chan(system_id, component_id, chan, msg, device_op_write->target_system, device_op_write->target_component, device_op_write->request_id, device_op_write->bustype, device_op_write->bus, device_op_write->address, device_op_write->busname, device_op_write->regstart, device_op_write->count, device_op_write->data);
215#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
217static inline void mavlink_msg_device_op_write_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t request_id, uint8_t bustype, uint8_t bus, uint8_t address,
const char *busname, uint8_t regstart, uint8_t count,
const uint8_t *data)
219#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
220 char buf[MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN];
221 _mav_put_uint32_t(buf, 0, request_id);
222 _mav_put_uint8_t(buf, 4, target_system);
223 _mav_put_uint8_t(buf, 5, target_component);
224 _mav_put_uint8_t(buf, 6, bustype);
225 _mav_put_uint8_t(buf, 7, bus);
226 _mav_put_uint8_t(buf, 8, address);
227 _mav_put_uint8_t(buf, 49, regstart);
228 _mav_put_uint8_t(buf, 50, count);
229 _mav_put_char_array(buf, 9, busname, 40);
230 _mav_put_uint8_t_array(buf, 51, data, 128);
231 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEVICE_OP_WRITE, buf, MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_CRC);
233 mavlink_device_op_write_t packet;
234 packet.request_id = request_id;
235 packet.target_system = target_system;
236 packet.target_component = target_component;
237 packet.bustype = bustype;
239 packet.address = address;
240 packet.regstart = regstart;
241 packet.count = count;
242 mav_array_memcpy(packet.busname, busname,
sizeof(
char)*40);
243 mav_array_memcpy(packet.data, data,
sizeof(uint8_t)*128);
244 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEVICE_OP_WRITE, (
const char *)&packet, MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_CRC);
253static inline void mavlink_msg_device_op_write_send_struct(mavlink_channel_t chan,
const mavlink_device_op_write_t* device_op_write)
255#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
256 mavlink_msg_device_op_write_send(chan, device_op_write->target_system, device_op_write->target_component, device_op_write->request_id, device_op_write->bustype, device_op_write->bus, device_op_write->address, device_op_write->busname, device_op_write->regstart, device_op_write->count, device_op_write->data);
258 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEVICE_OP_WRITE, (
const char *)device_op_write, MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_CRC);
262#if MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
270static inline void mavlink_msg_device_op_write_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t request_id, uint8_t bustype, uint8_t bus, uint8_t address,
const char *busname, uint8_t regstart, uint8_t count,
const uint8_t *data)
272#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
273 char *buf = (
char *)msgbuf;
274 _mav_put_uint32_t(buf, 0, request_id);
275 _mav_put_uint8_t(buf, 4, target_system);
276 _mav_put_uint8_t(buf, 5, target_component);
277 _mav_put_uint8_t(buf, 6, bustype);
278 _mav_put_uint8_t(buf, 7, bus);
279 _mav_put_uint8_t(buf, 8, address);
280 _mav_put_uint8_t(buf, 49, regstart);
281 _mav_put_uint8_t(buf, 50, count);
282 _mav_put_char_array(buf, 9, busname, 40);
283 _mav_put_uint8_t_array(buf, 51, data, 128);
284 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEVICE_OP_WRITE, buf, MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_CRC);
286 mavlink_device_op_write_t *packet = (mavlink_device_op_write_t *)msgbuf;
287 packet->request_id = request_id;
288 packet->target_system = target_system;
289 packet->target_component = target_component;
290 packet->bustype = bustype;
292 packet->address = address;
293 packet->regstart = regstart;
294 packet->count = count;
295 mav_array_memcpy(packet->busname, busname,
sizeof(
char)*40);
296 mav_array_memcpy(packet->data, data,
sizeof(uint8_t)*128);
297 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_DEVICE_OP_WRITE, (
const char *)packet, MAVLINK_MSG_ID_DEVICE_OP_WRITE_MIN_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN, MAVLINK_MSG_ID_DEVICE_OP_WRITE_CRC);
312static inline uint8_t mavlink_msg_device_op_write_get_target_system(
const mavlink_message_t* msg)
314 return _MAV_RETURN_uint8_t(msg, 4);
322static inline uint8_t mavlink_msg_device_op_write_get_target_component(
const mavlink_message_t* msg)
324 return _MAV_RETURN_uint8_t(msg, 5);
332static inline uint32_t mavlink_msg_device_op_write_get_request_id(
const mavlink_message_t* msg)
334 return _MAV_RETURN_uint32_t(msg, 0);
342static inline uint8_t mavlink_msg_device_op_write_get_bustype(
const mavlink_message_t* msg)
344 return _MAV_RETURN_uint8_t(msg, 6);
352static inline uint8_t mavlink_msg_device_op_write_get_bus(
const mavlink_message_t* msg)
354 return _MAV_RETURN_uint8_t(msg, 7);
362static inline uint8_t mavlink_msg_device_op_write_get_address(
const mavlink_message_t* msg)
364 return _MAV_RETURN_uint8_t(msg, 8);
372static inline uint16_t mavlink_msg_device_op_write_get_busname(
const mavlink_message_t* msg,
char *busname)
374 return _MAV_RETURN_char_array(msg, busname, 40, 9);
382static inline uint8_t mavlink_msg_device_op_write_get_regstart(
const mavlink_message_t* msg)
384 return _MAV_RETURN_uint8_t(msg, 49);
392static inline uint8_t mavlink_msg_device_op_write_get_count(
const mavlink_message_t* msg)
394 return _MAV_RETURN_uint8_t(msg, 50);
402static inline uint16_t mavlink_msg_device_op_write_get_data(
const mavlink_message_t* msg, uint8_t *data)
404 return _MAV_RETURN_uint8_t_array(msg, data, 128, 51);
413static inline void mavlink_msg_device_op_write_decode(
const mavlink_message_t* msg, mavlink_device_op_write_t* device_op_write)
415#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
416 device_op_write->request_id = mavlink_msg_device_op_write_get_request_id(msg);
417 device_op_write->target_system = mavlink_msg_device_op_write_get_target_system(msg);
418 device_op_write->target_component = mavlink_msg_device_op_write_get_target_component(msg);
419 device_op_write->bustype = mavlink_msg_device_op_write_get_bustype(msg);
420 device_op_write->bus = mavlink_msg_device_op_write_get_bus(msg);
421 device_op_write->address = mavlink_msg_device_op_write_get_address(msg);
422 mavlink_msg_device_op_write_get_busname(msg, device_op_write->busname);
423 device_op_write->regstart = mavlink_msg_device_op_write_get_regstart(msg);
424 device_op_write->count = mavlink_msg_device_op_write_get_count(msg);
425 mavlink_msg_device_op_write_get_data(msg, device_op_write->data);
427 uint8_t len = msg->len < MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN? msg->len : MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN;
428 memset(device_op_write, 0, MAVLINK_MSG_ID_DEVICE_OP_WRITE_LEN);
429 memcpy(device_op_write, _MAV_PAYLOAD(msg), len);