4#define MAVLINK_MSG_ID_BUTTON_CHANGE 257
11} mavlink_button_change_t;
13#define MAVLINK_MSG_ID_BUTTON_CHANGE_LEN 9
14#define MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN 9
15#define MAVLINK_MSG_ID_257_LEN 9
16#define MAVLINK_MSG_ID_257_MIN_LEN 9
18#define MAVLINK_MSG_ID_BUTTON_CHANGE_CRC 131
19#define MAVLINK_MSG_ID_257_CRC 131
23#if MAVLINK_COMMAND_24BIT
24#define MAVLINK_MESSAGE_INFO_BUTTON_CHANGE {
28 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_button_change_t, time_boot_ms) },
29 { "last_change_ms", NULL, MAVLINK_TYPE_UINT32_T, 0
, 4
, offsetof(mavlink_button_change_t, last_change_ms) },
30 { "state", NULL, MAVLINK_TYPE_UINT8_T, 0
, 8
, offsetof(mavlink_button_change_t, state) },
32}
34#define MAVLINK_MESSAGE_INFO_BUTTON_CHANGE {
37 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_button_change_t, time_boot_ms) },
38 { "last_change_ms", NULL, MAVLINK_TYPE_UINT32_T, 0
, 4
, offsetof(mavlink_button_change_t, last_change_ms) },
39 { "state", NULL, MAVLINK_TYPE_UINT8_T, 0
, 8
, offsetof(mavlink_button_change_t, state) },
41}
45
46
47
48
49
50
51
52
53
54
55static inline uint16_t mavlink_msg_button_change_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
56 uint32_t time_boot_ms, uint32_t last_change_ms, uint8_t state)
58#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
60 _mav_put_uint32_t(buf, 0, time_boot_ms);
61 _mav_put_uint32_t(buf, 4, last_change_ms);
62 _mav_put_uint8_t(buf, 8, state);
66 mavlink_button_change_t packet;
67 packet.time_boot_ms = time_boot_ms;
68 packet.last_change_ms = last_change_ms;
71 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN);
79
80
81
82
83
84
85
86
87
88
89
90static inline uint16_t mavlink_msg_button_change_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
91 uint32_t time_boot_ms, uint32_t last_change_ms, uint8_t state)
93#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95 _mav_put_uint32_t(buf, 0, time_boot_ms);
96 _mav_put_uint32_t(buf, 4, last_change_ms);
97 _mav_put_uint8_t(buf, 8, state);
101 mavlink_button_change_t packet;
102 packet.time_boot_ms = time_boot_ms;
103 packet.last_change_ms = last_change_ms;
104 packet.state = state;
106 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN);
111 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
118
119
120
121
122
123
124
125
126
127
128static inline uint16_t mavlink_msg_button_change_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
129 mavlink_message_t* msg,
130 uint32_t time_boot_ms,uint32_t last_change_ms,uint8_t state)
132#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
134 _mav_put_uint32_t(buf, 0, time_boot_ms);
135 _mav_put_uint32_t(buf, 4, last_change_ms);
136 _mav_put_uint8_t(buf, 8, state);
140 mavlink_button_change_t packet;
141 packet.time_boot_ms = time_boot_ms;
142 packet.last_change_ms = last_change_ms;
143 packet.state = state;
145 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN);
153
154
155
156
157
158
159
160static inline uint16_t mavlink_msg_button_change_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_button_change_t* button_change)
162 return mavlink_msg_button_change_pack(system_id, component_id, msg, button_change->time_boot_ms, button_change->last_change_ms, button_change->state);
166
167
168
169
170
171
172
173
174static inline uint16_t mavlink_msg_button_change_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_button_change_t* button_change)
176 return mavlink_msg_button_change_pack_chan(system_id, component_id, chan, msg, button_change->time_boot_ms, button_change->last_change_ms, button_change->state);
180
181
182
183
184
185
186
187
188static inline uint16_t mavlink_msg_button_change_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_button_change_t* button_change)
190 return mavlink_msg_button_change_pack_status(system_id, component_id, _status, msg, button_change->time_boot_ms, button_change->last_change_ms, button_change->state);
194
195
196
197
198
199
200
201#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
203static inline void mavlink_msg_button_change_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t last_change_ms, uint8_t state)
205#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
206 char buf[MAVLINK_MSG_ID_BUTTON_CHANGE_LEN];
207 _mav_put_uint32_t(buf, 0, time_boot_ms);
208 _mav_put_uint32_t(buf, 4, last_change_ms);
209 _mav_put_uint8_t(buf, 8, state);
211 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, buf, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
213 mavlink_button_change_t packet;
214 packet.time_boot_ms = time_boot_ms;
215 packet.last_change_ms = last_change_ms;
216 packet.state = state;
218 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, (
const char *)&packet, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
223
224
225
226
227static inline void mavlink_msg_button_change_send_struct(mavlink_channel_t chan,
const mavlink_button_change_t* button_change)
229#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
230 mavlink_msg_button_change_send(chan, button_change->time_boot_ms, button_change->last_change_ms, button_change->state);
232 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, (
const char *)button_change, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
236#if MAVLINK_MSG_ID_BUTTON_CHANGE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
238
239
240
241
242
243
244static inline void mavlink_msg_button_change_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t last_change_ms, uint8_t state)
246#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
247 char *buf = (
char *)msgbuf;
248 _mav_put_uint32_t(buf, 0, time_boot_ms);
249 _mav_put_uint32_t(buf, 4, last_change_ms);
250 _mav_put_uint8_t(buf, 8, state);
252 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, buf, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
254 mavlink_button_change_t *packet = (mavlink_button_change_t *)msgbuf;
255 packet->time_boot_ms = time_boot_ms;
256 packet->last_change_ms = last_change_ms;
257 packet->state = state;
259 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_BUTTON_CHANGE, (
const char *)packet, MAVLINK_MSG_ID_BUTTON_CHANGE_MIN_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN, MAVLINK_MSG_ID_BUTTON_CHANGE_CRC);
270
271
272
273
274static inline uint32_t mavlink_msg_button_change_get_time_boot_ms(
const mavlink_message_t* msg)
276 return _MAV_RETURN_uint32_t(msg, 0);
280
281
282
283
284static inline uint32_t mavlink_msg_button_change_get_last_change_ms(
const mavlink_message_t* msg)
286 return _MAV_RETURN_uint32_t(msg, 4);
290
291
292
293
294static inline uint8_t mavlink_msg_button_change_get_state(
const mavlink_message_t* msg)
296 return _MAV_RETURN_uint8_t(msg, 8);
300
301
302
303
304
305static inline void mavlink_msg_button_change_decode(
const mavlink_message_t* msg, mavlink_button_change_t* button_change)
307#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
308 button_change->time_boot_ms = mavlink_msg_button_change_get_time_boot_ms(msg);
309 button_change->last_change_ms = mavlink_msg_button_change_get_last_change_ms(msg);
310 button_change->state = mavlink_msg_button_change_get_state(msg);
312 uint8_t len = msg->len < MAVLINK_MSG_ID_BUTTON_CHANGE_LEN? msg->len : MAVLINK_MSG_ID_BUTTON_CHANGE_LEN;
313 memset(button_change, 0, MAVLINK_MSG_ID_BUTTON_CHANGE_LEN);
314 memcpy(button_change, _MAV_PAYLOAD(msg), len);