RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_slugs_configuration_camera.h
1#pragma once
2// MESSAGE SLUGS_CONFIGURATION_CAMERA PACKING
3
4#define MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA 188
5
6MAVPACKED(
7typedef struct __mavlink_slugs_configuration_camera_t {
8 uint8_t target; /*< The system setting the commands*/
9 uint8_t idOrder; /*< ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight*/
10 uint8_t order; /*< 1: up/on 2: down/off 3: auto/reset/no action*/
11}) mavlink_slugs_configuration_camera_t;
12
13#define MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN 3
14#define MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN 3
15#define MAVLINK_MSG_ID_188_LEN 3
16#define MAVLINK_MSG_ID_188_MIN_LEN 3
17
18#define MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC 5
19#define MAVLINK_MSG_ID_188_CRC 5
20
21
22
23#if MAVLINK_COMMAND_24BIT
24#define MAVLINK_MESSAGE_INFO_SLUGS_CONFIGURATION_CAMERA { \
25 188, \
26 "SLUGS_CONFIGURATION_CAMERA", \
27 3, \
28 { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_slugs_configuration_camera_t, target) }, \
29 { "idOrder", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_slugs_configuration_camera_t, idOrder) }, \
30 { "order", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_slugs_configuration_camera_t, order) }, \
31 } \
32}
33#else
34#define MAVLINK_MESSAGE_INFO_SLUGS_CONFIGURATION_CAMERA { \
35 "SLUGS_CONFIGURATION_CAMERA", \
36 3, \
37 { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_slugs_configuration_camera_t, target) }, \
38 { "idOrder", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_slugs_configuration_camera_t, idOrder) }, \
39 { "order", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_slugs_configuration_camera_t, order) }, \
40 } \
41}
42#endif
43
44/**
45 * @brief Pack a slugs_configuration_camera message
46 * @param system_id ID of this system
47 * @param component_id ID of this component (e.g. 200 for IMU)
48 * @param msg The MAVLink message to compress the data into
49 *
50 * @param target The system setting the commands
51 * @param idOrder ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight
52 * @param order 1: up/on 2: down/off 3: auto/reset/no action
53 * @return length of the message in bytes (excluding serial stream start sign)
54 */
55static inline uint16_t mavlink_msg_slugs_configuration_camera_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
56 uint8_t target, uint8_t idOrder, uint8_t order)
57{
58#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
59 char buf[MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN];
60 _mav_put_uint8_t(buf, 0, target);
61 _mav_put_uint8_t(buf, 1, idOrder);
62 _mav_put_uint8_t(buf, 2, order);
63
64 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
65#else
66 mavlink_slugs_configuration_camera_t packet;
67 packet.target = target;
68 packet.idOrder = idOrder;
69 packet.order = order;
70
71 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
72#endif
73
74 msg->msgid = MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA;
75 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
76}
77
78/**
79 * @brief Pack a slugs_configuration_camera message on a channel
80 * @param system_id ID of this system
81 * @param component_id ID of this component (e.g. 200 for IMU)
82 * @param chan The MAVLink channel this message will be sent over
83 * @param msg The MAVLink message to compress the data into
84 * @param target The system setting the commands
85 * @param idOrder ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight
86 * @param order 1: up/on 2: down/off 3: auto/reset/no action
87 * @return length of the message in bytes (excluding serial stream start sign)
88 */
89static inline uint16_t mavlink_msg_slugs_configuration_camera_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
90 mavlink_message_t* msg,
91 uint8_t target,uint8_t idOrder,uint8_t order)
92{
93#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
94 char buf[MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN];
95 _mav_put_uint8_t(buf, 0, target);
96 _mav_put_uint8_t(buf, 1, idOrder);
97 _mav_put_uint8_t(buf, 2, order);
98
99 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
100#else
101 mavlink_slugs_configuration_camera_t packet;
102 packet.target = target;
103 packet.idOrder = idOrder;
104 packet.order = order;
105
106 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
107#endif
108
109 msg->msgid = MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA;
110 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
111}
112
113/**
114 * @brief Encode a slugs_configuration_camera struct
115 *
116 * @param system_id ID of this system
117 * @param component_id ID of this component (e.g. 200 for IMU)
118 * @param msg The MAVLink message to compress the data into
119 * @param slugs_configuration_camera C-struct to read the message contents from
120 */
121static inline uint16_t mavlink_msg_slugs_configuration_camera_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_slugs_configuration_camera_t* slugs_configuration_camera)
122{
123 return mavlink_msg_slugs_configuration_camera_pack(system_id, component_id, msg, slugs_configuration_camera->target, slugs_configuration_camera->idOrder, slugs_configuration_camera->order);
124}
125
126/**
127 * @brief Encode a slugs_configuration_camera struct on a channel
128 *
129 * @param system_id ID of this system
130 * @param component_id ID of this component (e.g. 200 for IMU)
131 * @param chan The MAVLink channel this message will be sent over
132 * @param msg The MAVLink message to compress the data into
133 * @param slugs_configuration_camera C-struct to read the message contents from
134 */
135static inline uint16_t mavlink_msg_slugs_configuration_camera_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_slugs_configuration_camera_t* slugs_configuration_camera)
136{
137 return mavlink_msg_slugs_configuration_camera_pack_chan(system_id, component_id, chan, msg, slugs_configuration_camera->target, slugs_configuration_camera->idOrder, slugs_configuration_camera->order);
138}
139
140/**
141 * @brief Send a slugs_configuration_camera message
142 * @param chan MAVLink channel to send the message
143 *
144 * @param target The system setting the commands
145 * @param idOrder ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight
146 * @param order 1: up/on 2: down/off 3: auto/reset/no action
147 */
148#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
149
150static inline void mavlink_msg_slugs_configuration_camera_send(mavlink_channel_t chan, uint8_t target, uint8_t idOrder, uint8_t order)
151{
152#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
153 char buf[MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN];
154 _mav_put_uint8_t(buf, 0, target);
155 _mav_put_uint8_t(buf, 1, idOrder);
156 _mav_put_uint8_t(buf, 2, order);
157
158 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, buf, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
159#else
160 mavlink_slugs_configuration_camera_t packet;
161 packet.target = target;
162 packet.idOrder = idOrder;
163 packet.order = order;
164
165 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, (const char *)&packet, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
166#endif
167}
168
169/**
170 * @brief Send a slugs_configuration_camera message
171 * @param chan MAVLink channel to send the message
172 * @param struct The MAVLink struct to serialize
173 */
174static inline void mavlink_msg_slugs_configuration_camera_send_struct(mavlink_channel_t chan, const mavlink_slugs_configuration_camera_t* slugs_configuration_camera)
175{
176#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
177 mavlink_msg_slugs_configuration_camera_send(chan, slugs_configuration_camera->target, slugs_configuration_camera->idOrder, slugs_configuration_camera->order);
178#else
179 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, (const char *)slugs_configuration_camera, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
180#endif
181}
182
183#if MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
184/*
185 This varient of _send() can be used to save stack space by re-using
186 memory from the receive buffer. The caller provides a
187 mavlink_message_t which is the size of a full mavlink message. This
188 is usually the receive buffer for the channel, and allows a reply to an
189 incoming message with minimum stack space usage.
190 */
191static inline void mavlink_msg_slugs_configuration_camera_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, uint8_t idOrder, uint8_t order)
192{
193#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
194 char *buf = (char *)msgbuf;
195 _mav_put_uint8_t(buf, 0, target);
196 _mav_put_uint8_t(buf, 1, idOrder);
197 _mav_put_uint8_t(buf, 2, order);
198
199 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, buf, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
200#else
201 mavlink_slugs_configuration_camera_t *packet = (mavlink_slugs_configuration_camera_t *)msgbuf;
202 packet->target = target;
203 packet->idOrder = idOrder;
204 packet->order = order;
205
206 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA, (const char *)packet, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_MIN_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_CRC);
207#endif
208}
209#endif
210
211#endif
212
213// MESSAGE SLUGS_CONFIGURATION_CAMERA UNPACKING
214
215
216/**
217 * @brief Get field target from slugs_configuration_camera message
218 *
219 * @return The system setting the commands
220 */
221static inline uint8_t mavlink_msg_slugs_configuration_camera_get_target(const mavlink_message_t* msg)
222{
223 return _MAV_RETURN_uint8_t(msg, 0);
224}
225
226/**
227 * @brief Get field idOrder from slugs_configuration_camera message
228 *
229 * @return ID 0: brightness 1: aperture 2: iris 3: ICR 4: backlight
230 */
231static inline uint8_t mavlink_msg_slugs_configuration_camera_get_idOrder(const mavlink_message_t* msg)
232{
233 return _MAV_RETURN_uint8_t(msg, 1);
234}
235
236/**
237 * @brief Get field order from slugs_configuration_camera message
238 *
239 * @return 1: up/on 2: down/off 3: auto/reset/no action
240 */
241static inline uint8_t mavlink_msg_slugs_configuration_camera_get_order(const mavlink_message_t* msg)
242{
243 return _MAV_RETURN_uint8_t(msg, 2);
244}
245
246/**
247 * @brief Decode a slugs_configuration_camera message into a struct
248 *
249 * @param msg The message to decode
250 * @param slugs_configuration_camera C-struct to decode the message contents into
251 */
252static inline void mavlink_msg_slugs_configuration_camera_decode(const mavlink_message_t* msg, mavlink_slugs_configuration_camera_t* slugs_configuration_camera)
253{
254#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
255 slugs_configuration_camera->target = mavlink_msg_slugs_configuration_camera_get_target(msg);
256 slugs_configuration_camera->idOrder = mavlink_msg_slugs_configuration_camera_get_idOrder(msg);
257 slugs_configuration_camera->order = mavlink_msg_slugs_configuration_camera_get_order(msg);
258#else
259 uint8_t len = msg->len < MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN? msg->len : MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN;
260 memset(slugs_configuration_camera, 0, MAVLINK_MSG_ID_SLUGS_CONFIGURATION_CAMERA_LEN);
261 memcpy(slugs_configuration_camera, _MAV_PAYLOAD(msg), len);
262#endif
263}