NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_gimbal_set_home_offsets.h
Go to the documentation of this file.
1 // MESSAGE GIMBAL_SET_HOME_OFFSETS PACKING
2 
3 #define MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS 204
4 
6 {
7  uint8_t target_system;
8  uint8_t target_component;
10 
11 #define MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_LEN 2
12 #define MAVLINK_MSG_ID_204_LEN 2
13 
14 #define MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_CRC 54
15 #define MAVLINK_MSG_ID_204_CRC 54
16 
17 
18 
19 #define MAVLINK_MESSAGE_INFO_GIMBAL_SET_HOME_OFFSETS { \
20  "GIMBAL_SET_HOME_OFFSETS", \
21  2, \
22  { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gimbal_set_home_offsets_t, target_system) }, \
23  { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gimbal_set_home_offsets_t, target_component) }, \
24  } \
25 }
26 
27 
38 static inline uint16_t mavlink_msg_gimbal_set_home_offsets_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
39  uint8_t target_system, uint8_t target_component)
40 {
41 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
43  _mav_put_uint8_t(buf, 0, target_system);
44  _mav_put_uint8_t(buf, 1, target_component);
45 
47 #else
49  packet.target_system = target_system;
50  packet.target_component = target_component;
51 
53 #endif
54 
56 #if MAVLINK_CRC_EXTRA
58 #else
59  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_LEN);
60 #endif
61 }
62 
73 static inline uint16_t mavlink_msg_gimbal_set_home_offsets_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
74  mavlink_message_t* msg,
75  uint8_t target_system,uint8_t target_component)
76 {
77 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
79  _mav_put_uint8_t(buf, 0, target_system);
80  _mav_put_uint8_t(buf, 1, target_component);
81 
83 #else
85  packet.target_system = target_system;
86  packet.target_component = target_component;
87 
89 #endif
90 
92 #if MAVLINK_CRC_EXTRA
94 #else
95  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_LEN);
96 #endif
97 }
98 
107 static inline uint16_t mavlink_msg_gimbal_set_home_offsets_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_set_home_offsets_t* gimbal_set_home_offsets)
108 {
109  return mavlink_msg_gimbal_set_home_offsets_pack(system_id, component_id, msg, gimbal_set_home_offsets->target_system, gimbal_set_home_offsets->target_component);
110 }
111 
121 static inline uint16_t mavlink_msg_gimbal_set_home_offsets_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_set_home_offsets_t* gimbal_set_home_offsets)
122 {
123  return mavlink_msg_gimbal_set_home_offsets_pack_chan(system_id, component_id, chan, msg, gimbal_set_home_offsets->target_system, gimbal_set_home_offsets->target_component);
124 }
125 
133 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
134 
135 static inline void mavlink_msg_gimbal_set_home_offsets_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
136 {
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
139  _mav_put_uint8_t(buf, 0, target_system);
140  _mav_put_uint8_t(buf, 1, target_component);
141 
142 #if MAVLINK_CRC_EXTRA
144 #else
145  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS, buf, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_LEN);
146 #endif
147 #else
149  packet.target_system = target_system;
150  packet.target_component = target_component;
151 
152 #if MAVLINK_CRC_EXTRA
154 #else
155  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_LEN);
156 #endif
157 #endif
158 }
159 
160 #if MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
161 /*
162  This varient of _send() can be used to save stack space by re-using
163  memory from the receive buffer. The caller provides a
164  mavlink_message_t which is the size of a full mavlink message. This
165  is usually the receive buffer for the channel, and allows a reply to an
166  incoming message with minimum stack space usage.
167  */
168 static inline void mavlink_msg_gimbal_set_home_offsets_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
169 {
170 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171  char *buf = (char *)msgbuf;
172  _mav_put_uint8_t(buf, 0, target_system);
173  _mav_put_uint8_t(buf, 1, target_component);
174 
175 #if MAVLINK_CRC_EXTRA
177 #else
178  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS, buf, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_LEN);
179 #endif
180 #else
182  packet->target_system = target_system;
183  packet->target_component = target_component;
184 
185 #if MAVLINK_CRC_EXTRA
187 #else
188  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_LEN);
189 #endif
190 #endif
191 }
192 #endif
193 
194 #endif
195 
196 // MESSAGE GIMBAL_SET_HOME_OFFSETS UNPACKING
197 
198 
204 static inline uint8_t mavlink_msg_gimbal_set_home_offsets_get_target_system(const mavlink_message_t* msg)
205 {
206  return _MAV_RETURN_uint8_t(msg, 0);
207 }
208 
214 static inline uint8_t mavlink_msg_gimbal_set_home_offsets_get_target_component(const mavlink_message_t* msg)
215 {
216  return _MAV_RETURN_uint8_t(msg, 1);
217 }
218 
225 static inline void mavlink_msg_gimbal_set_home_offsets_decode(const mavlink_message_t* msg, mavlink_gimbal_set_home_offsets_t* gimbal_set_home_offsets)
226 {
227 #if MAVLINK_NEED_BYTE_SWAP
228  gimbal_set_home_offsets->target_system = mavlink_msg_gimbal_set_home_offsets_get_target_system(msg);
229  gimbal_set_home_offsets->target_component = mavlink_msg_gimbal_set_home_offsets_get_target_component(msg);
230 #else
231  memcpy(gimbal_set_home_offsets, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GIMBAL_SET_HOME_OFFSETS_LEN);
232 #endif
233 }
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134