1 // MESSAGE LOG_REQUEST_LIST PACKING
3 #define MAVLINK_MSG_ID_LOG_REQUEST_LIST 117
5 typedef struct __mavlink_log_request_list_t
7 uint16_t start
; ///< First log id (0 for first available)
8 uint16_t end
; ///< Last log id (0xffff for last available)
9 uint8_t target_system
; ///< System ID
10 uint8_t target_component
; ///< Component ID
11 } mavlink_log_request_list_t
;
13 #define MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN 6
14 #define MAVLINK_MSG_ID_117_LEN 6
16 #define MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC 128
17 #define MAVLINK_MSG_ID_117_CRC 128
21 #define MAVLINK_MESSAGE_INFO_LOG_REQUEST_LIST { \
24 { { "start", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_log_request_list_t, start) }, \
25 { "end", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_log_request_list_t, end) }, \
26 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_log_request_list_t, target_system) }, \
27 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_log_request_list_t, target_component) }, \
33 * @brief Pack a log_request_list message
34 * @param system_id ID of this system
35 * @param component_id ID of this component (e.g. 200 for IMU)
36 * @param msg The MAVLink message to compress the data into
38 * @param target_system System ID
39 * @param target_component Component ID
40 * @param start First log id (0 for first available)
41 * @param end Last log id (0xffff for last available)
42 * @return length of the message in bytes (excluding serial stream start sign)
44 static inline uint16_t mavlink_msg_log_request_list_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
45 uint8_t target_system
, uint8_t target_component
, uint16_t start
, uint16_t end
)
47 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
48 char buf
[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
];
49 _mav_put_uint16_t(buf
, 0, start
);
50 _mav_put_uint16_t(buf
, 2, end
);
51 _mav_put_uint8_t(buf
, 4, target_system
);
52 _mav_put_uint8_t(buf
, 5, target_component
);
54 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
56 mavlink_log_request_list_t packet
;
59 packet
.target_system
= target_system
;
60 packet
.target_component
= target_component
;
62 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
65 msg
->msgid
= MAVLINK_MSG_ID_LOG_REQUEST_LIST
;
67 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC
);
69 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
74 * @brief Pack a log_request_list message on a channel
75 * @param system_id ID of this system
76 * @param component_id ID of this component (e.g. 200 for IMU)
77 * @param chan The MAVLink channel this message will be sent over
78 * @param msg The MAVLink message to compress the data into
79 * @param target_system System ID
80 * @param target_component Component ID
81 * @param start First log id (0 for first available)
82 * @param end Last log id (0xffff for last available)
83 * @return length of the message in bytes (excluding serial stream start sign)
85 static inline uint16_t mavlink_msg_log_request_list_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
86 mavlink_message_t
* msg
,
87 uint8_t target_system
,uint8_t target_component
,uint16_t start
,uint16_t end
)
89 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
90 char buf
[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
];
91 _mav_put_uint16_t(buf
, 0, start
);
92 _mav_put_uint16_t(buf
, 2, end
);
93 _mav_put_uint8_t(buf
, 4, target_system
);
94 _mav_put_uint8_t(buf
, 5, target_component
);
96 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
98 mavlink_log_request_list_t packet
;
101 packet
.target_system
= target_system
;
102 packet
.target_component
= target_component
;
104 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
107 msg
->msgid
= MAVLINK_MSG_ID_LOG_REQUEST_LIST
;
108 #if MAVLINK_CRC_EXTRA
109 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC
);
111 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
116 * @brief Encode a log_request_list struct
118 * @param system_id ID of this system
119 * @param component_id ID of this component (e.g. 200 for IMU)
120 * @param msg The MAVLink message to compress the data into
121 * @param log_request_list C-struct to read the message contents from
123 static inline uint16_t mavlink_msg_log_request_list_encode(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
, const mavlink_log_request_list_t
* log_request_list
)
125 return mavlink_msg_log_request_list_pack(system_id
, component_id
, msg
, log_request_list
->target_system
, log_request_list
->target_component
, log_request_list
->start
, log_request_list
->end
);
129 * @brief Encode a log_request_list struct on a channel
131 * @param system_id ID of this system
132 * @param component_id ID of this component (e.g. 200 for IMU)
133 * @param chan The MAVLink channel this message will be sent over
134 * @param msg The MAVLink message to compress the data into
135 * @param log_request_list C-struct to read the message contents from
137 static inline uint16_t mavlink_msg_log_request_list_encode_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
, mavlink_message_t
* msg
, const mavlink_log_request_list_t
* log_request_list
)
139 return mavlink_msg_log_request_list_pack_chan(system_id
, component_id
, chan
, msg
, log_request_list
->target_system
, log_request_list
->target_component
, log_request_list
->start
, log_request_list
->end
);
143 * @brief Send a log_request_list message
144 * @param chan MAVLink channel to send the message
146 * @param target_system System ID
147 * @param target_component Component ID
148 * @param start First log id (0 for first available)
149 * @param end Last log id (0xffff for last available)
151 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
153 static inline void mavlink_msg_log_request_list_send(mavlink_channel_t chan
, uint8_t target_system
, uint8_t target_component
, uint16_t start
, uint16_t end
)
155 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
156 char buf
[MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
];
157 _mav_put_uint16_t(buf
, 0, start
);
158 _mav_put_uint16_t(buf
, 2, end
);
159 _mav_put_uint8_t(buf
, 4, target_system
);
160 _mav_put_uint8_t(buf
, 5, target_component
);
162 #if MAVLINK_CRC_EXTRA
163 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST
, buf
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC
);
165 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST
, buf
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
168 mavlink_log_request_list_t packet
;
169 packet
.start
= start
;
171 packet
.target_system
= target_system
;
172 packet
.target_component
= target_component
;
174 #if MAVLINK_CRC_EXTRA
175 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST
, (const char *)&packet
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC
);
177 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST
, (const char *)&packet
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
182 #if MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
184 This varient of _send() can be used to save stack space by re-using
185 memory from the receive buffer. The caller provides a
186 mavlink_message_t which is the size of a full mavlink message. This
187 is usually the receive buffer for the channel, and allows a reply to an
188 incoming message with minimum stack space usage.
190 static inline void mavlink_msg_log_request_list_send_buf(mavlink_message_t
*msgbuf
, mavlink_channel_t chan
, uint8_t target_system
, uint8_t target_component
, uint16_t start
, uint16_t end
)
192 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
193 char *buf
= (char *)msgbuf
;
194 _mav_put_uint16_t(buf
, 0, start
);
195 _mav_put_uint16_t(buf
, 2, end
);
196 _mav_put_uint8_t(buf
, 4, target_system
);
197 _mav_put_uint8_t(buf
, 5, target_component
);
199 #if MAVLINK_CRC_EXTRA
200 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST
, buf
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC
);
202 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST
, buf
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
205 mavlink_log_request_list_t
*packet
= (mavlink_log_request_list_t
*)msgbuf
;
206 packet
->start
= start
;
208 packet
->target_system
= target_system
;
209 packet
->target_component
= target_component
;
211 #if MAVLINK_CRC_EXTRA
212 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST
, (const char *)packet
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_CRC
);
214 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_LOG_REQUEST_LIST
, (const char *)packet
, MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);
222 // MESSAGE LOG_REQUEST_LIST UNPACKING
226 * @brief Get field target_system from log_request_list message
230 static inline uint8_t mavlink_msg_log_request_list_get_target_system(const mavlink_message_t
* msg
)
232 return _MAV_RETURN_uint8_t(msg
, 4);
236 * @brief Get field target_component from log_request_list message
238 * @return Component ID
240 static inline uint8_t mavlink_msg_log_request_list_get_target_component(const mavlink_message_t
* msg
)
242 return _MAV_RETURN_uint8_t(msg
, 5);
246 * @brief Get field start from log_request_list message
248 * @return First log id (0 for first available)
250 static inline uint16_t mavlink_msg_log_request_list_get_start(const mavlink_message_t
* msg
)
252 return _MAV_RETURN_uint16_t(msg
, 0);
256 * @brief Get field end from log_request_list message
258 * @return Last log id (0xffff for last available)
260 static inline uint16_t mavlink_msg_log_request_list_get_end(const mavlink_message_t
* msg
)
262 return _MAV_RETURN_uint16_t(msg
, 2);
266 * @brief Decode a log_request_list message into a struct
268 * @param msg The message to decode
269 * @param log_request_list C-struct to decode the message contents into
271 static inline void mavlink_msg_log_request_list_decode(const mavlink_message_t
* msg
, mavlink_log_request_list_t
* log_request_list
)
273 #if MAVLINK_NEED_BYTE_SWAP
274 log_request_list
->start
= mavlink_msg_log_request_list_get_start(msg
);
275 log_request_list
->end
= mavlink_msg_log_request_list_get_end(msg
);
276 log_request_list
->target_system
= mavlink_msg_log_request_list_get_target_system(msg
);
277 log_request_list
->target_component
= mavlink_msg_log_request_list_get_target_component(msg
);
279 memcpy(log_request_list
, _MAV_PAYLOAD(msg
), MAVLINK_MSG_ID_LOG_REQUEST_LIST_LEN
);