mavlink_msg_message_interval.h
Go to the documentation of this file.
1 // MESSAGE MESSAGE_INTERVAL PACKING
2 
3 #define MAVLINK_MSG_ID_MESSAGE_INTERVAL 244
4 
6 {
7  int32_t interval_us; /*< The interval between two messages, in microseconds. A value of -1 indicates this stream is disabled, 0 indicates it is not available, > 0 indicates the interval at which it is sent.*/
8  uint16_t message_id; /*< The ID of the requested MAVLink message. v1.0 is limited to 254 messages.*/
10 
11 #define MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN 6
12 #define MAVLINK_MSG_ID_244_LEN 6
13 
14 #define MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC 95
15 #define MAVLINK_MSG_ID_244_CRC 95
16 
17 
18 
19 #define MAVLINK_MESSAGE_INFO_MESSAGE_INTERVAL { \
20  "MESSAGE_INTERVAL", \
21  2, \
22  { { "interval_us", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_message_interval_t, interval_us) }, \
23  { "message_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_message_interval_t, message_id) }, \
24  } \
25 }
26 
27 
38 static inline uint16_t mavlink_msg_message_interval_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
39  uint16_t message_id, int32_t interval_us)
40 {
41 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
43  _mav_put_int32_t(buf, 0, interval_us);
44  _mav_put_uint16_t(buf, 4, message_id);
45 
47 #else
49  packet.interval_us = interval_us;
50  packet.message_id = message_id;
51 
53 #endif
54 
56 #if MAVLINK_CRC_EXTRA
58 #else
59  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
60 #endif
61 }
62 
73 static inline uint16_t mavlink_msg_message_interval_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
74  mavlink_message_t* msg,
75  uint16_t message_id,int32_t interval_us)
76 {
77 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
79  _mav_put_int32_t(buf, 0, interval_us);
80  _mav_put_uint16_t(buf, 4, message_id);
81 
83 #else
85  packet.interval_us = interval_us;
86  packet.message_id = message_id;
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_MESSAGE_INTERVAL_LEN);
96 #endif
97 }
98 
107 static inline uint16_t mavlink_msg_message_interval_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_message_interval_t* message_interval)
108 {
109  return mavlink_msg_message_interval_pack(system_id, component_id, msg, message_interval->message_id, message_interval->interval_us);
110 }
111 
121 static inline uint16_t mavlink_msg_message_interval_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_message_interval_t* message_interval)
122 {
123  return mavlink_msg_message_interval_pack_chan(system_id, component_id, chan, msg, message_interval->message_id, message_interval->interval_us);
124 }
125 
133 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
134 
135 static inline void mavlink_msg_message_interval_send(mavlink_channel_t chan, uint16_t message_id, int32_t interval_us)
136 {
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
139  _mav_put_int32_t(buf, 0, interval_us);
140  _mav_put_uint16_t(buf, 4, message_id);
141 
142 #if MAVLINK_CRC_EXTRA
144 #else
145  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
146 #endif
147 #else
149  packet.interval_us = interval_us;
150  packet.message_id = message_id;
151 
152 #if MAVLINK_CRC_EXTRA
153  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)&packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
154 #else
155  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)&packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
156 #endif
157 #endif
158 }
159 
160 #if MAVLINK_MSG_ID_MESSAGE_INTERVAL_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_message_interval_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t message_id, int32_t interval_us)
169 {
170 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171  char *buf = (char *)msgbuf;
172  _mav_put_int32_t(buf, 0, interval_us);
173  _mav_put_uint16_t(buf, 4, message_id);
174 
175 #if MAVLINK_CRC_EXTRA
177 #else
178  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, buf, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
179 #endif
180 #else
182  packet->interval_us = interval_us;
183  packet->message_id = message_id;
184 
185 #if MAVLINK_CRC_EXTRA
186  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN, MAVLINK_MSG_ID_MESSAGE_INTERVAL_CRC);
187 #else
188  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MESSAGE_INTERVAL, (const char *)packet, MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
189 #endif
190 #endif
191 }
192 #endif
193 
194 #endif
195 
196 // MESSAGE MESSAGE_INTERVAL UNPACKING
197 
198 
204 static inline uint16_t mavlink_msg_message_interval_get_message_id(const mavlink_message_t* msg)
205 {
206  return _MAV_RETURN_uint16_t(msg, 4);
207 }
208 
214 static inline int32_t mavlink_msg_message_interval_get_interval_us(const mavlink_message_t* msg)
215 {
216  return _MAV_RETURN_int32_t(msg, 0);
217 }
218 
225 static inline void mavlink_msg_message_interval_decode(const mavlink_message_t* msg, mavlink_message_interval_t* message_interval)
226 {
227 #if MAVLINK_NEED_BYTE_SWAP
230 #else
231  memcpy(message_interval, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MESSAGE_INTERVAL_LEN);
232 #endif
233 }
#define _mav_put_int32_t(buf, wire_offset, b)
Definition: protocol.h:148
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:145


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:18