Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_gimbal_device_information.h
blob2f0c86bdc970c2eb9f2c40fe3f376fe349aaa52a
1 #pragma once
2 // MESSAGE GIMBAL_DEVICE_INFORMATION PACKING
4 #define MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION 283
7 typedef struct __mavlink_gimbal_device_information_t {
8 uint64_t uid; /*< UID of gimbal hardware (0 if unknown).*/
9 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
10 uint32_t firmware_version; /*< Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).*/
11 uint32_t hardware_version; /*< Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).*/
12 float roll_min; /*< [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)*/
13 float roll_max; /*< [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)*/
14 float pitch_min; /*< [rad] Minimum hardware pitch angle (positive: up, negative: down)*/
15 float pitch_max; /*< [rad] Maximum hardware pitch angle (positive: up, negative: down)*/
16 float yaw_min; /*< [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left)*/
17 float yaw_max; /*< [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left)*/
18 uint16_t cap_flags; /*< Bitmap of gimbal capability flags.*/
19 uint16_t custom_cap_flags; /*< Bitmap for use for gimbal-specific capability flags.*/
20 char vendor_name[32]; /*< Name of the gimbal vendor.*/
21 char model_name[32]; /*< Name of the gimbal model.*/
22 char custom_name[32]; /*< Custom name of the gimbal given to it by the user.*/
23 } mavlink_gimbal_device_information_t;
25 #define MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN 144
26 #define MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN 144
27 #define MAVLINK_MSG_ID_283_LEN 144
28 #define MAVLINK_MSG_ID_283_MIN_LEN 144
30 #define MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC 74
31 #define MAVLINK_MSG_ID_283_CRC 74
33 #define MAVLINK_MSG_GIMBAL_DEVICE_INFORMATION_FIELD_VENDOR_NAME_LEN 32
34 #define MAVLINK_MSG_GIMBAL_DEVICE_INFORMATION_FIELD_MODEL_NAME_LEN 32
35 #define MAVLINK_MSG_GIMBAL_DEVICE_INFORMATION_FIELD_CUSTOM_NAME_LEN 32
37 #if MAVLINK_COMMAND_24BIT
38 #define MAVLINK_MESSAGE_INFO_GIMBAL_DEVICE_INFORMATION { \
39 283, \
40 "GIMBAL_DEVICE_INFORMATION", \
41 15, \
42 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gimbal_device_information_t, time_boot_ms) }, \
43 { "vendor_name", NULL, MAVLINK_TYPE_CHAR, 32, 48, offsetof(mavlink_gimbal_device_information_t, vendor_name) }, \
44 { "model_name", NULL, MAVLINK_TYPE_CHAR, 32, 80, offsetof(mavlink_gimbal_device_information_t, model_name) }, \
45 { "custom_name", NULL, MAVLINK_TYPE_CHAR, 32, 112, offsetof(mavlink_gimbal_device_information_t, custom_name) }, \
46 { "firmware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_gimbal_device_information_t, firmware_version) }, \
47 { "hardware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_gimbal_device_information_t, hardware_version) }, \
48 { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gimbal_device_information_t, uid) }, \
49 { "cap_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 44, offsetof(mavlink_gimbal_device_information_t, cap_flags) }, \
50 { "custom_cap_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 46, offsetof(mavlink_gimbal_device_information_t, custom_cap_flags) }, \
51 { "roll_min", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_device_information_t, roll_min) }, \
52 { "roll_max", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_device_information_t, roll_max) }, \
53 { "pitch_min", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_device_information_t, pitch_min) }, \
54 { "pitch_max", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gimbal_device_information_t, pitch_max) }, \
55 { "yaw_min", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gimbal_device_information_t, yaw_min) }, \
56 { "yaw_max", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gimbal_device_information_t, yaw_max) }, \
57 } \
59 #else
60 #define MAVLINK_MESSAGE_INFO_GIMBAL_DEVICE_INFORMATION { \
61 "GIMBAL_DEVICE_INFORMATION", \
62 15, \
63 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gimbal_device_information_t, time_boot_ms) }, \
64 { "vendor_name", NULL, MAVLINK_TYPE_CHAR, 32, 48, offsetof(mavlink_gimbal_device_information_t, vendor_name) }, \
65 { "model_name", NULL, MAVLINK_TYPE_CHAR, 32, 80, offsetof(mavlink_gimbal_device_information_t, model_name) }, \
66 { "custom_name", NULL, MAVLINK_TYPE_CHAR, 32, 112, offsetof(mavlink_gimbal_device_information_t, custom_name) }, \
67 { "firmware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_gimbal_device_information_t, firmware_version) }, \
68 { "hardware_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_gimbal_device_information_t, hardware_version) }, \
69 { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gimbal_device_information_t, uid) }, \
70 { "cap_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 44, offsetof(mavlink_gimbal_device_information_t, cap_flags) }, \
71 { "custom_cap_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 46, offsetof(mavlink_gimbal_device_information_t, custom_cap_flags) }, \
72 { "roll_min", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gimbal_device_information_t, roll_min) }, \
73 { "roll_max", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gimbal_device_information_t, roll_max) }, \
74 { "pitch_min", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gimbal_device_information_t, pitch_min) }, \
75 { "pitch_max", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gimbal_device_information_t, pitch_max) }, \
76 { "yaw_min", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gimbal_device_information_t, yaw_min) }, \
77 { "yaw_max", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gimbal_device_information_t, yaw_max) }, \
78 } \
80 #endif
82 /**
83 * @brief Pack a gimbal_device_information message
84 * @param system_id ID of this system
85 * @param component_id ID of this component (e.g. 200 for IMU)
86 * @param msg The MAVLink message to compress the data into
88 * @param time_boot_ms [ms] Timestamp (time since system boot).
89 * @param vendor_name Name of the gimbal vendor.
90 * @param model_name Name of the gimbal model.
91 * @param custom_name Custom name of the gimbal given to it by the user.
92 * @param firmware_version Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
93 * @param hardware_version Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
94 * @param uid UID of gimbal hardware (0 if unknown).
95 * @param cap_flags Bitmap of gimbal capability flags.
96 * @param custom_cap_flags Bitmap for use for gimbal-specific capability flags.
97 * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
98 * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
99 * @param pitch_min [rad] Minimum hardware pitch angle (positive: up, negative: down)
100 * @param pitch_max [rad] Maximum hardware pitch angle (positive: up, negative: down)
101 * @param yaw_min [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left)
102 * @param yaw_max [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left)
103 * @return length of the message in bytes (excluding serial stream start sign)
105 static inline uint16_t mavlink_msg_gimbal_device_information_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
106 uint32_t time_boot_ms, const char *vendor_name, const char *model_name, const char *custom_name, uint32_t firmware_version, uint32_t hardware_version, uint64_t uid, uint16_t cap_flags, uint16_t custom_cap_flags, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max)
108 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
109 char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN];
110 _mav_put_uint64_t(buf, 0, uid);
111 _mav_put_uint32_t(buf, 8, time_boot_ms);
112 _mav_put_uint32_t(buf, 12, firmware_version);
113 _mav_put_uint32_t(buf, 16, hardware_version);
114 _mav_put_float(buf, 20, roll_min);
115 _mav_put_float(buf, 24, roll_max);
116 _mav_put_float(buf, 28, pitch_min);
117 _mav_put_float(buf, 32, pitch_max);
118 _mav_put_float(buf, 36, yaw_min);
119 _mav_put_float(buf, 40, yaw_max);
120 _mav_put_uint16_t(buf, 44, cap_flags);
121 _mav_put_uint16_t(buf, 46, custom_cap_flags);
122 _mav_put_char_array(buf, 48, vendor_name, 32);
123 _mav_put_char_array(buf, 80, model_name, 32);
124 _mav_put_char_array(buf, 112, custom_name, 32);
125 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
126 #else
127 mavlink_gimbal_device_information_t packet;
128 packet.uid = uid;
129 packet.time_boot_ms = time_boot_ms;
130 packet.firmware_version = firmware_version;
131 packet.hardware_version = hardware_version;
132 packet.roll_min = roll_min;
133 packet.roll_max = roll_max;
134 packet.pitch_min = pitch_min;
135 packet.pitch_max = pitch_max;
136 packet.yaw_min = yaw_min;
137 packet.yaw_max = yaw_max;
138 packet.cap_flags = cap_flags;
139 packet.custom_cap_flags = custom_cap_flags;
140 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
141 mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
142 mav_array_memcpy(packet.custom_name, custom_name, sizeof(char)*32);
143 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
144 #endif
146 msg->msgid = MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION;
147 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
151 * @brief Pack a gimbal_device_information message on a channel
152 * @param system_id ID of this system
153 * @param component_id ID of this component (e.g. 200 for IMU)
154 * @param chan The MAVLink channel this message will be sent over
155 * @param msg The MAVLink message to compress the data into
156 * @param time_boot_ms [ms] Timestamp (time since system boot).
157 * @param vendor_name Name of the gimbal vendor.
158 * @param model_name Name of the gimbal model.
159 * @param custom_name Custom name of the gimbal given to it by the user.
160 * @param firmware_version Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
161 * @param hardware_version Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
162 * @param uid UID of gimbal hardware (0 if unknown).
163 * @param cap_flags Bitmap of gimbal capability flags.
164 * @param custom_cap_flags Bitmap for use for gimbal-specific capability flags.
165 * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
166 * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
167 * @param pitch_min [rad] Minimum hardware pitch angle (positive: up, negative: down)
168 * @param pitch_max [rad] Maximum hardware pitch angle (positive: up, negative: down)
169 * @param yaw_min [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left)
170 * @param yaw_max [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left)
171 * @return length of the message in bytes (excluding serial stream start sign)
173 static inline uint16_t mavlink_msg_gimbal_device_information_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
174 mavlink_message_t* msg,
175 uint32_t time_boot_ms,const char *vendor_name,const char *model_name,const char *custom_name,uint32_t firmware_version,uint32_t hardware_version,uint64_t uid,uint16_t cap_flags,uint16_t custom_cap_flags,float roll_min,float roll_max,float pitch_min,float pitch_max,float yaw_min,float yaw_max)
177 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
178 char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN];
179 _mav_put_uint64_t(buf, 0, uid);
180 _mav_put_uint32_t(buf, 8, time_boot_ms);
181 _mav_put_uint32_t(buf, 12, firmware_version);
182 _mav_put_uint32_t(buf, 16, hardware_version);
183 _mav_put_float(buf, 20, roll_min);
184 _mav_put_float(buf, 24, roll_max);
185 _mav_put_float(buf, 28, pitch_min);
186 _mav_put_float(buf, 32, pitch_max);
187 _mav_put_float(buf, 36, yaw_min);
188 _mav_put_float(buf, 40, yaw_max);
189 _mav_put_uint16_t(buf, 44, cap_flags);
190 _mav_put_uint16_t(buf, 46, custom_cap_flags);
191 _mav_put_char_array(buf, 48, vendor_name, 32);
192 _mav_put_char_array(buf, 80, model_name, 32);
193 _mav_put_char_array(buf, 112, custom_name, 32);
194 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
195 #else
196 mavlink_gimbal_device_information_t packet;
197 packet.uid = uid;
198 packet.time_boot_ms = time_boot_ms;
199 packet.firmware_version = firmware_version;
200 packet.hardware_version = hardware_version;
201 packet.roll_min = roll_min;
202 packet.roll_max = roll_max;
203 packet.pitch_min = pitch_min;
204 packet.pitch_max = pitch_max;
205 packet.yaw_min = yaw_min;
206 packet.yaw_max = yaw_max;
207 packet.cap_flags = cap_flags;
208 packet.custom_cap_flags = custom_cap_flags;
209 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
210 mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
211 mav_array_memcpy(packet.custom_name, custom_name, sizeof(char)*32);
212 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
213 #endif
215 msg->msgid = MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION;
216 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
220 * @brief Encode a gimbal_device_information struct
222 * @param system_id ID of this system
223 * @param component_id ID of this component (e.g. 200 for IMU)
224 * @param msg The MAVLink message to compress the data into
225 * @param gimbal_device_information C-struct to read the message contents from
227 static inline uint16_t mavlink_msg_gimbal_device_information_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_device_information_t* gimbal_device_information)
229 return mavlink_msg_gimbal_device_information_pack(system_id, component_id, msg, gimbal_device_information->time_boot_ms, gimbal_device_information->vendor_name, gimbal_device_information->model_name, gimbal_device_information->custom_name, gimbal_device_information->firmware_version, gimbal_device_information->hardware_version, gimbal_device_information->uid, gimbal_device_information->cap_flags, gimbal_device_information->custom_cap_flags, gimbal_device_information->roll_min, gimbal_device_information->roll_max, gimbal_device_information->pitch_min, gimbal_device_information->pitch_max, gimbal_device_information->yaw_min, gimbal_device_information->yaw_max);
233 * @brief Encode a gimbal_device_information struct on a channel
235 * @param system_id ID of this system
236 * @param component_id ID of this component (e.g. 200 for IMU)
237 * @param chan The MAVLink channel this message will be sent over
238 * @param msg The MAVLink message to compress the data into
239 * @param gimbal_device_information C-struct to read the message contents from
241 static inline uint16_t mavlink_msg_gimbal_device_information_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_device_information_t* gimbal_device_information)
243 return mavlink_msg_gimbal_device_information_pack_chan(system_id, component_id, chan, msg, gimbal_device_information->time_boot_ms, gimbal_device_information->vendor_name, gimbal_device_information->model_name, gimbal_device_information->custom_name, gimbal_device_information->firmware_version, gimbal_device_information->hardware_version, gimbal_device_information->uid, gimbal_device_information->cap_flags, gimbal_device_information->custom_cap_flags, gimbal_device_information->roll_min, gimbal_device_information->roll_max, gimbal_device_information->pitch_min, gimbal_device_information->pitch_max, gimbal_device_information->yaw_min, gimbal_device_information->yaw_max);
247 * @brief Send a gimbal_device_information message
248 * @param chan MAVLink channel to send the message
250 * @param time_boot_ms [ms] Timestamp (time since system boot).
251 * @param vendor_name Name of the gimbal vendor.
252 * @param model_name Name of the gimbal model.
253 * @param custom_name Custom name of the gimbal given to it by the user.
254 * @param firmware_version Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
255 * @param hardware_version Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
256 * @param uid UID of gimbal hardware (0 if unknown).
257 * @param cap_flags Bitmap of gimbal capability flags.
258 * @param custom_cap_flags Bitmap for use for gimbal-specific capability flags.
259 * @param roll_min [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
260 * @param roll_max [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
261 * @param pitch_min [rad] Minimum hardware pitch angle (positive: up, negative: down)
262 * @param pitch_max [rad] Maximum hardware pitch angle (positive: up, negative: down)
263 * @param yaw_min [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left)
264 * @param yaw_max [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left)
266 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
268 static inline void mavlink_msg_gimbal_device_information_send(mavlink_channel_t chan, uint32_t time_boot_ms, const char *vendor_name, const char *model_name, const char *custom_name, uint32_t firmware_version, uint32_t hardware_version, uint64_t uid, uint16_t cap_flags, uint16_t custom_cap_flags, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max)
270 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
271 char buf[MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN];
272 _mav_put_uint64_t(buf, 0, uid);
273 _mav_put_uint32_t(buf, 8, time_boot_ms);
274 _mav_put_uint32_t(buf, 12, firmware_version);
275 _mav_put_uint32_t(buf, 16, hardware_version);
276 _mav_put_float(buf, 20, roll_min);
277 _mav_put_float(buf, 24, roll_max);
278 _mav_put_float(buf, 28, pitch_min);
279 _mav_put_float(buf, 32, pitch_max);
280 _mav_put_float(buf, 36, yaw_min);
281 _mav_put_float(buf, 40, yaw_max);
282 _mav_put_uint16_t(buf, 44, cap_flags);
283 _mav_put_uint16_t(buf, 46, custom_cap_flags);
284 _mav_put_char_array(buf, 48, vendor_name, 32);
285 _mav_put_char_array(buf, 80, model_name, 32);
286 _mav_put_char_array(buf, 112, custom_name, 32);
287 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
288 #else
289 mavlink_gimbal_device_information_t packet;
290 packet.uid = uid;
291 packet.time_boot_ms = time_boot_ms;
292 packet.firmware_version = firmware_version;
293 packet.hardware_version = hardware_version;
294 packet.roll_min = roll_min;
295 packet.roll_max = roll_max;
296 packet.pitch_min = pitch_min;
297 packet.pitch_max = pitch_max;
298 packet.yaw_min = yaw_min;
299 packet.yaw_max = yaw_max;
300 packet.cap_flags = cap_flags;
301 packet.custom_cap_flags = custom_cap_flags;
302 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
303 mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
304 mav_array_memcpy(packet.custom_name, custom_name, sizeof(char)*32);
305 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
306 #endif
310 * @brief Send a gimbal_device_information message
311 * @param chan MAVLink channel to send the message
312 * @param struct The MAVLink struct to serialize
314 static inline void mavlink_msg_gimbal_device_information_send_struct(mavlink_channel_t chan, const mavlink_gimbal_device_information_t* gimbal_device_information)
316 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
317 mavlink_msg_gimbal_device_information_send(chan, gimbal_device_information->time_boot_ms, gimbal_device_information->vendor_name, gimbal_device_information->model_name, gimbal_device_information->custom_name, gimbal_device_information->firmware_version, gimbal_device_information->hardware_version, gimbal_device_information->uid, gimbal_device_information->cap_flags, gimbal_device_information->custom_cap_flags, gimbal_device_information->roll_min, gimbal_device_information->roll_max, gimbal_device_information->pitch_min, gimbal_device_information->pitch_max, gimbal_device_information->yaw_min, gimbal_device_information->yaw_max);
318 #else
319 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, (const char *)gimbal_device_information, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
320 #endif
323 #if MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
325 This varient of _send() can be used to save stack space by re-using
326 memory from the receive buffer. The caller provides a
327 mavlink_message_t which is the size of a full mavlink message. This
328 is usually the receive buffer for the channel, and allows a reply to an
329 incoming message with minimum stack space usage.
331 static inline void mavlink_msg_gimbal_device_information_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, const char *vendor_name, const char *model_name, const char *custom_name, uint32_t firmware_version, uint32_t hardware_version, uint64_t uid, uint16_t cap_flags, uint16_t custom_cap_flags, float roll_min, float roll_max, float pitch_min, float pitch_max, float yaw_min, float yaw_max)
333 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
334 char *buf = (char *)msgbuf;
335 _mav_put_uint64_t(buf, 0, uid);
336 _mav_put_uint32_t(buf, 8, time_boot_ms);
337 _mav_put_uint32_t(buf, 12, firmware_version);
338 _mav_put_uint32_t(buf, 16, hardware_version);
339 _mav_put_float(buf, 20, roll_min);
340 _mav_put_float(buf, 24, roll_max);
341 _mav_put_float(buf, 28, pitch_min);
342 _mav_put_float(buf, 32, pitch_max);
343 _mav_put_float(buf, 36, yaw_min);
344 _mav_put_float(buf, 40, yaw_max);
345 _mav_put_uint16_t(buf, 44, cap_flags);
346 _mav_put_uint16_t(buf, 46, custom_cap_flags);
347 _mav_put_char_array(buf, 48, vendor_name, 32);
348 _mav_put_char_array(buf, 80, model_name, 32);
349 _mav_put_char_array(buf, 112, custom_name, 32);
350 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, buf, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
351 #else
352 mavlink_gimbal_device_information_t *packet = (mavlink_gimbal_device_information_t *)msgbuf;
353 packet->uid = uid;
354 packet->time_boot_ms = time_boot_ms;
355 packet->firmware_version = firmware_version;
356 packet->hardware_version = hardware_version;
357 packet->roll_min = roll_min;
358 packet->roll_max = roll_max;
359 packet->pitch_min = pitch_min;
360 packet->pitch_max = pitch_max;
361 packet->yaw_min = yaw_min;
362 packet->yaw_max = yaw_max;
363 packet->cap_flags = cap_flags;
364 packet->custom_cap_flags = custom_cap_flags;
365 mav_array_memcpy(packet->vendor_name, vendor_name, sizeof(char)*32);
366 mav_array_memcpy(packet->model_name, model_name, sizeof(char)*32);
367 mav_array_memcpy(packet->custom_name, custom_name, sizeof(char)*32);
368 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_CRC);
369 #endif
371 #endif
373 #endif
375 // MESSAGE GIMBAL_DEVICE_INFORMATION UNPACKING
379 * @brief Get field time_boot_ms from gimbal_device_information message
381 * @return [ms] Timestamp (time since system boot).
383 static inline uint32_t mavlink_msg_gimbal_device_information_get_time_boot_ms(const mavlink_message_t* msg)
385 return _MAV_RETURN_uint32_t(msg, 8);
389 * @brief Get field vendor_name from gimbal_device_information message
391 * @return Name of the gimbal vendor.
393 static inline uint16_t mavlink_msg_gimbal_device_information_get_vendor_name(const mavlink_message_t* msg, char *vendor_name)
395 return _MAV_RETURN_char_array(msg, vendor_name, 32, 48);
399 * @brief Get field model_name from gimbal_device_information message
401 * @return Name of the gimbal model.
403 static inline uint16_t mavlink_msg_gimbal_device_information_get_model_name(const mavlink_message_t* msg, char *model_name)
405 return _MAV_RETURN_char_array(msg, model_name, 32, 80);
409 * @brief Get field custom_name from gimbal_device_information message
411 * @return Custom name of the gimbal given to it by the user.
413 static inline uint16_t mavlink_msg_gimbal_device_information_get_custom_name(const mavlink_message_t* msg, char *custom_name)
415 return _MAV_RETURN_char_array(msg, custom_name, 32, 112);
419 * @brief Get field firmware_version from gimbal_device_information message
421 * @return Version of the gimbal firmware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
423 static inline uint32_t mavlink_msg_gimbal_device_information_get_firmware_version(const mavlink_message_t* msg)
425 return _MAV_RETURN_uint32_t(msg, 12);
429 * @brief Get field hardware_version from gimbal_device_information message
431 * @return Version of the gimbal hardware, encoded as: (Dev & 0xff) << 24 | (Patch & 0xff) << 16 | (Minor & 0xff) << 8 | (Major & 0xff).
433 static inline uint32_t mavlink_msg_gimbal_device_information_get_hardware_version(const mavlink_message_t* msg)
435 return _MAV_RETURN_uint32_t(msg, 16);
439 * @brief Get field uid from gimbal_device_information message
441 * @return UID of gimbal hardware (0 if unknown).
443 static inline uint64_t mavlink_msg_gimbal_device_information_get_uid(const mavlink_message_t* msg)
445 return _MAV_RETURN_uint64_t(msg, 0);
449 * @brief Get field cap_flags from gimbal_device_information message
451 * @return Bitmap of gimbal capability flags.
453 static inline uint16_t mavlink_msg_gimbal_device_information_get_cap_flags(const mavlink_message_t* msg)
455 return _MAV_RETURN_uint16_t(msg, 44);
459 * @brief Get field custom_cap_flags from gimbal_device_information message
461 * @return Bitmap for use for gimbal-specific capability flags.
463 static inline uint16_t mavlink_msg_gimbal_device_information_get_custom_cap_flags(const mavlink_message_t* msg)
465 return _MAV_RETURN_uint16_t(msg, 46);
469 * @brief Get field roll_min from gimbal_device_information message
471 * @return [rad] Minimum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
473 static inline float mavlink_msg_gimbal_device_information_get_roll_min(const mavlink_message_t* msg)
475 return _MAV_RETURN_float(msg, 20);
479 * @brief Get field roll_max from gimbal_device_information message
481 * @return [rad] Maximum hardware roll angle (positive: rolling to the right, negative: rolling to the left)
483 static inline float mavlink_msg_gimbal_device_information_get_roll_max(const mavlink_message_t* msg)
485 return _MAV_RETURN_float(msg, 24);
489 * @brief Get field pitch_min from gimbal_device_information message
491 * @return [rad] Minimum hardware pitch angle (positive: up, negative: down)
493 static inline float mavlink_msg_gimbal_device_information_get_pitch_min(const mavlink_message_t* msg)
495 return _MAV_RETURN_float(msg, 28);
499 * @brief Get field pitch_max from gimbal_device_information message
501 * @return [rad] Maximum hardware pitch angle (positive: up, negative: down)
503 static inline float mavlink_msg_gimbal_device_information_get_pitch_max(const mavlink_message_t* msg)
505 return _MAV_RETURN_float(msg, 32);
509 * @brief Get field yaw_min from gimbal_device_information message
511 * @return [rad] Minimum hardware yaw angle (positive: to the right, negative: to the left)
513 static inline float mavlink_msg_gimbal_device_information_get_yaw_min(const mavlink_message_t* msg)
515 return _MAV_RETURN_float(msg, 36);
519 * @brief Get field yaw_max from gimbal_device_information message
521 * @return [rad] Maximum hardware yaw angle (positive: to the right, negative: to the left)
523 static inline float mavlink_msg_gimbal_device_information_get_yaw_max(const mavlink_message_t* msg)
525 return _MAV_RETURN_float(msg, 40);
529 * @brief Decode a gimbal_device_information message into a struct
531 * @param msg The message to decode
532 * @param gimbal_device_information C-struct to decode the message contents into
534 static inline void mavlink_msg_gimbal_device_information_decode(const mavlink_message_t* msg, mavlink_gimbal_device_information_t* gimbal_device_information)
536 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
537 gimbal_device_information->uid = mavlink_msg_gimbal_device_information_get_uid(msg);
538 gimbal_device_information->time_boot_ms = mavlink_msg_gimbal_device_information_get_time_boot_ms(msg);
539 gimbal_device_information->firmware_version = mavlink_msg_gimbal_device_information_get_firmware_version(msg);
540 gimbal_device_information->hardware_version = mavlink_msg_gimbal_device_information_get_hardware_version(msg);
541 gimbal_device_information->roll_min = mavlink_msg_gimbal_device_information_get_roll_min(msg);
542 gimbal_device_information->roll_max = mavlink_msg_gimbal_device_information_get_roll_max(msg);
543 gimbal_device_information->pitch_min = mavlink_msg_gimbal_device_information_get_pitch_min(msg);
544 gimbal_device_information->pitch_max = mavlink_msg_gimbal_device_information_get_pitch_max(msg);
545 gimbal_device_information->yaw_min = mavlink_msg_gimbal_device_information_get_yaw_min(msg);
546 gimbal_device_information->yaw_max = mavlink_msg_gimbal_device_information_get_yaw_max(msg);
547 gimbal_device_information->cap_flags = mavlink_msg_gimbal_device_information_get_cap_flags(msg);
548 gimbal_device_information->custom_cap_flags = mavlink_msg_gimbal_device_information_get_custom_cap_flags(msg);
549 mavlink_msg_gimbal_device_information_get_vendor_name(msg, gimbal_device_information->vendor_name);
550 mavlink_msg_gimbal_device_information_get_model_name(msg, gimbal_device_information->model_name);
551 mavlink_msg_gimbal_device_information_get_custom_name(msg, gimbal_device_information->custom_name);
552 #else
553 uint8_t len = msg->len < MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN? msg->len : MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN;
554 memset(gimbal_device_information, 0, MAVLINK_MSG_ID_GIMBAL_DEVICE_INFORMATION_LEN);
555 memcpy(gimbal_device_information, _MAV_PAYLOAD(msg), len);
556 #endif