4#define MAVLINK_MSG_ID_MID_LVL_CMDS 180
7typedef struct __mavlink_mid_lvl_cmds_t {
12}) mavlink_mid_lvl_cmds_t;
14#define MAVLINK_MSG_ID_MID_LVL_CMDS_LEN 13
15#define MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN 13
16#define MAVLINK_MSG_ID_180_LEN 13
17#define MAVLINK_MSG_ID_180_MIN_LEN 13
19#define MAVLINK_MSG_ID_MID_LVL_CMDS_CRC 146
20#define MAVLINK_MSG_ID_180_CRC 146
24#if MAVLINK_COMMAND_24BIT
25#define MAVLINK_MESSAGE_INFO_MID_LVL_CMDS { \
29 { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mid_lvl_cmds_t, target) }, \
30 { "hCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mid_lvl_cmds_t, hCommand) }, \
31 { "uCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mid_lvl_cmds_t, uCommand) }, \
32 { "rCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mid_lvl_cmds_t, rCommand) }, \
36#define MAVLINK_MESSAGE_INFO_MID_LVL_CMDS { \
39 { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_mid_lvl_cmds_t, target) }, \
40 { "hCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_mid_lvl_cmds_t, hCommand) }, \
41 { "uCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_mid_lvl_cmds_t, uCommand) }, \
42 { "rCommand", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_mid_lvl_cmds_t, rCommand) }, \
59static inline uint16_t mavlink_msg_mid_lvl_cmds_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
60 uint8_t target,
float hCommand,
float uCommand,
float rCommand)
62#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
63 char buf[MAVLINK_MSG_ID_MID_LVL_CMDS_LEN];
64 _mav_put_float(buf, 0, hCommand);
65 _mav_put_float(buf, 4, uCommand);
66 _mav_put_float(buf, 8, rCommand);
67 _mav_put_uint8_t(buf, 12, target);
69 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
71 mavlink_mid_lvl_cmds_t packet;
72 packet.hCommand = hCommand;
73 packet.uCommand = uCommand;
74 packet.rCommand = rCommand;
75 packet.target = target;
77 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
80 msg->msgid = MAVLINK_MSG_ID_MID_LVL_CMDS;
81 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
96static inline uint16_t mavlink_msg_mid_lvl_cmds_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
97 mavlink_message_t* msg,
98 uint8_t target,
float hCommand,
float uCommand,
float rCommand)
100#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
101 char buf[MAVLINK_MSG_ID_MID_LVL_CMDS_LEN];
102 _mav_put_float(buf, 0, hCommand);
103 _mav_put_float(buf, 4, uCommand);
104 _mav_put_float(buf, 8, rCommand);
105 _mav_put_uint8_t(buf, 12, target);
107 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
109 mavlink_mid_lvl_cmds_t packet;
110 packet.hCommand = hCommand;
111 packet.uCommand = uCommand;
112 packet.rCommand = rCommand;
113 packet.target = target;
115 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
118 msg->msgid = MAVLINK_MSG_ID_MID_LVL_CMDS;
119 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
130static inline uint16_t mavlink_msg_mid_lvl_cmds_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
132 return mavlink_msg_mid_lvl_cmds_pack(system_id, component_id, msg, mid_lvl_cmds->target, mid_lvl_cmds->hCommand, mid_lvl_cmds->uCommand, mid_lvl_cmds->rCommand);
144static inline uint16_t mavlink_msg_mid_lvl_cmds_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
146 return mavlink_msg_mid_lvl_cmds_pack_chan(system_id, component_id, chan, msg, mid_lvl_cmds->target, mid_lvl_cmds->hCommand, mid_lvl_cmds->uCommand, mid_lvl_cmds->rCommand);
158#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
160static inline void mavlink_msg_mid_lvl_cmds_send(mavlink_channel_t chan, uint8_t target,
float hCommand,
float uCommand,
float rCommand)
162#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
163 char buf[MAVLINK_MSG_ID_MID_LVL_CMDS_LEN];
164 _mav_put_float(buf, 0, hCommand);
165 _mav_put_float(buf, 4, uCommand);
166 _mav_put_float(buf, 8, rCommand);
167 _mav_put_uint8_t(buf, 12, target);
169 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, buf, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
171 mavlink_mid_lvl_cmds_t packet;
172 packet.hCommand = hCommand;
173 packet.uCommand = uCommand;
174 packet.rCommand = rCommand;
175 packet.target = target;
177 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, (
const char *)&packet, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
186static inline void mavlink_msg_mid_lvl_cmds_send_struct(mavlink_channel_t chan,
const mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
188#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
189 mavlink_msg_mid_lvl_cmds_send(chan, mid_lvl_cmds->target, mid_lvl_cmds->hCommand, mid_lvl_cmds->uCommand, mid_lvl_cmds->rCommand);
191 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, (
const char *)mid_lvl_cmds, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
195#if MAVLINK_MSG_ID_MID_LVL_CMDS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
203static inline void mavlink_msg_mid_lvl_cmds_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target,
float hCommand,
float uCommand,
float rCommand)
205#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
206 char *buf = (
char *)msgbuf;
207 _mav_put_float(buf, 0, hCommand);
208 _mav_put_float(buf, 4, uCommand);
209 _mav_put_float(buf, 8, rCommand);
210 _mav_put_uint8_t(buf, 12, target);
212 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, buf, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
214 mavlink_mid_lvl_cmds_t *packet = (mavlink_mid_lvl_cmds_t *)msgbuf;
215 packet->hCommand = hCommand;
216 packet->uCommand = uCommand;
217 packet->rCommand = rCommand;
218 packet->target = target;
220 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MID_LVL_CMDS, (
const char *)packet, MAVLINK_MSG_ID_MID_LVL_CMDS_MIN_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN, MAVLINK_MSG_ID_MID_LVL_CMDS_CRC);
235static inline uint8_t mavlink_msg_mid_lvl_cmds_get_target(
const mavlink_message_t* msg)
237 return _MAV_RETURN_uint8_t(msg, 12);
245static inline float mavlink_msg_mid_lvl_cmds_get_hCommand(
const mavlink_message_t* msg)
247 return _MAV_RETURN_float(msg, 0);
255static inline float mavlink_msg_mid_lvl_cmds_get_uCommand(
const mavlink_message_t* msg)
257 return _MAV_RETURN_float(msg, 4);
265static inline float mavlink_msg_mid_lvl_cmds_get_rCommand(
const mavlink_message_t* msg)
267 return _MAV_RETURN_float(msg, 8);
276static inline void mavlink_msg_mid_lvl_cmds_decode(
const mavlink_message_t* msg, mavlink_mid_lvl_cmds_t* mid_lvl_cmds)
278#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
279 mid_lvl_cmds->hCommand = mavlink_msg_mid_lvl_cmds_get_hCommand(msg);
280 mid_lvl_cmds->uCommand = mavlink_msg_mid_lvl_cmds_get_uCommand(msg);
281 mid_lvl_cmds->rCommand = mavlink_msg_mid_lvl_cmds_get_rCommand(msg);
282 mid_lvl_cmds->target = mavlink_msg_mid_lvl_cmds_get_target(msg);
284 uint8_t len = msg->len < MAVLINK_MSG_ID_MID_LVL_CMDS_LEN? msg->len : MAVLINK_MSG_ID_MID_LVL_CMDS_LEN;
285 memset(mid_lvl_cmds, 0, MAVLINK_MSG_ID_MID_LVL_CMDS_LEN);
286 memcpy(mid_lvl_cmds, _MAV_PAYLOAD(msg), len);