Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1702 | - | 1 | // MESSAGE MISSION_REQUEST_PARTIAL_LIST PACKING |
2 | |||
3 | #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST 37 |
||
4 | |||
5 | typedef struct __mavlink_mission_request_partial_list_t |
||
6 | { |
||
7 | int16_t start_index; ///< Start index, 0 by default |
||
8 | int16_t end_index; ///< End index, -1 by default (-1: send list to end). Else a valid index of the list |
||
9 | uint8_t target_system; ///< System ID |
||
10 | uint8_t target_component; ///< Component ID |
||
11 | } mavlink_mission_request_partial_list_t; |
||
12 | |||
13 | #define MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST_LEN 6 |
||
14 | #define MAVLINK_MSG_ID_37_LEN 6 |
||
15 | |||
16 | |||
17 | |||
18 | #define MAVLINK_MESSAGE_INFO_MISSION_REQUEST_PARTIAL_LIST { \ |
||
19 | "MISSION_REQUEST_PARTIAL_LIST", \ |
||
20 | 4, \ |
||
21 | { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_request_partial_list_t, start_index) }, \ |
||
22 | { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_request_partial_list_t, end_index) }, \ |
||
23 | { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_request_partial_list_t, target_system) }, \ |
||
24 | { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_request_partial_list_t, target_component) }, \ |
||
25 | } \ |
||
26 | } |
||
27 | |||
28 | |||
29 | /** |
||
30 | * @brief Pack a mission_request_partial_list message |
||
31 | * @param system_id ID of this system |
||
32 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
33 | * @param msg The MAVLink message to compress the data into |
||
34 | * |
||
35 | * @param target_system System ID |
||
36 | * @param target_component Component ID |
||
37 | * @param start_index Start index, 0 by default |
||
38 | * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list |
||
39 | * @return length of the message in bytes (excluding serial stream start sign) |
||
40 | */ |
||
41 | static inline uint16_t mavlink_msg_mission_request_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
||
42 | uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) |
||
43 | { |
||
44 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
45 | char buf[6]; |
||
46 | _mav_put_int16_t(buf, 0, start_index); |
||
47 | _mav_put_int16_t(buf, 2, end_index); |
||
48 | _mav_put_uint8_t(buf, 4, target_system); |
||
49 | _mav_put_uint8_t(buf, 5, target_component); |
||
50 | |||
51 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); |
||
52 | #else |
||
53 | mavlink_mission_request_partial_list_t packet; |
||
54 | packet.start_index = start_index; |
||
55 | packet.end_index = end_index; |
||
56 | packet.target_system = target_system; |
||
57 | packet.target_component = target_component; |
||
58 | |||
59 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); |
||
60 | #endif |
||
61 | |||
62 | msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; |
||
63 | return mavlink_finalize_message(msg, system_id, component_id, 6, 212); |
||
64 | } |
||
65 | |||
66 | /** |
||
67 | * @brief Pack a mission_request_partial_list message on a channel |
||
68 | * @param system_id ID of this system |
||
69 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
70 | * @param chan The MAVLink channel this message was sent over |
||
71 | * @param msg The MAVLink message to compress the data into |
||
72 | * @param target_system System ID |
||
73 | * @param target_component Component ID |
||
74 | * @param start_index Start index, 0 by default |
||
75 | * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list |
||
76 | * @return length of the message in bytes (excluding serial stream start sign) |
||
77 | */ |
||
78 | static inline uint16_t mavlink_msg_mission_request_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
||
79 | mavlink_message_t* msg, |
||
80 | uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index) |
||
81 | { |
||
82 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
83 | char buf[6]; |
||
84 | _mav_put_int16_t(buf, 0, start_index); |
||
85 | _mav_put_int16_t(buf, 2, end_index); |
||
86 | _mav_put_uint8_t(buf, 4, target_system); |
||
87 | _mav_put_uint8_t(buf, 5, target_component); |
||
88 | |||
89 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 6); |
||
90 | #else |
||
91 | mavlink_mission_request_partial_list_t packet; |
||
92 | packet.start_index = start_index; |
||
93 | packet.end_index = end_index; |
||
94 | packet.target_system = target_system; |
||
95 | packet.target_component = target_component; |
||
96 | |||
97 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 6); |
||
98 | #endif |
||
99 | |||
100 | msg->msgid = MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST; |
||
101 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 6, 212); |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * @brief Encode a mission_request_partial_list struct into a message |
||
106 | * |
||
107 | * @param system_id ID of this system |
||
108 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
109 | * @param msg The MAVLink message to compress the data into |
||
110 | * @param mission_request_partial_list C-struct to read the message contents from |
||
111 | */ |
||
112 | static inline uint16_t mavlink_msg_mission_request_partial_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_request_partial_list_t* mission_request_partial_list) |
||
113 | { |
||
114 | return mavlink_msg_mission_request_partial_list_pack(system_id, component_id, msg, mission_request_partial_list->target_system, mission_request_partial_list->target_component, mission_request_partial_list->start_index, mission_request_partial_list->end_index); |
||
115 | } |
||
116 | |||
117 | /** |
||
118 | * @brief Send a mission_request_partial_list message |
||
119 | * @param chan MAVLink channel to send the message |
||
120 | * |
||
121 | * @param target_system System ID |
||
122 | * @param target_component Component ID |
||
123 | * @param start_index Start index, 0 by default |
||
124 | * @param end_index End index, -1 by default (-1: send list to end). Else a valid index of the list |
||
125 | */ |
||
126 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
||
127 | |||
128 | static inline void mavlink_msg_mission_request_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index) |
||
129 | { |
||
130 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
131 | char buf[6]; |
||
132 | _mav_put_int16_t(buf, 0, start_index); |
||
133 | _mav_put_int16_t(buf, 2, end_index); |
||
134 | _mav_put_uint8_t(buf, 4, target_system); |
||
135 | _mav_put_uint8_t(buf, 5, target_component); |
||
136 | |||
137 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, buf, 6, 212); |
||
138 | #else |
||
139 | mavlink_mission_request_partial_list_t packet; |
||
140 | packet.start_index = start_index; |
||
141 | packet.end_index = end_index; |
||
142 | packet.target_system = target_system; |
||
143 | packet.target_component = target_component; |
||
144 | |||
145 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_REQUEST_PARTIAL_LIST, (const char *)&packet, 6, 212); |
||
146 | #endif |
||
147 | } |
||
148 | |||
149 | #endif |
||
150 | |||
151 | // MESSAGE MISSION_REQUEST_PARTIAL_LIST UNPACKING |
||
152 | |||
153 | |||
154 | /** |
||
155 | * @brief Get field target_system from mission_request_partial_list message |
||
156 | * |
||
157 | * @return System ID |
||
158 | */ |
||
159 | static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_system(const mavlink_message_t* msg) |
||
160 | { |
||
161 | return _MAV_RETURN_uint8_t(msg, 4); |
||
162 | } |
||
163 | |||
164 | /** |
||
165 | * @brief Get field target_component from mission_request_partial_list message |
||
166 | * |
||
167 | * @return Component ID |
||
168 | */ |
||
169 | static inline uint8_t mavlink_msg_mission_request_partial_list_get_target_component(const mavlink_message_t* msg) |
||
170 | { |
||
171 | return _MAV_RETURN_uint8_t(msg, 5); |
||
172 | } |
||
173 | |||
174 | /** |
||
175 | * @brief Get field start_index from mission_request_partial_list message |
||
176 | * |
||
177 | * @return Start index, 0 by default |
||
178 | */ |
||
179 | static inline int16_t mavlink_msg_mission_request_partial_list_get_start_index(const mavlink_message_t* msg) |
||
180 | { |
||
181 | return _MAV_RETURN_int16_t(msg, 0); |
||
182 | } |
||
183 | |||
184 | /** |
||
185 | * @brief Get field end_index from mission_request_partial_list message |
||
186 | * |
||
187 | * @return End index, -1 by default (-1: send list to end). Else a valid index of the list |
||
188 | */ |
||
189 | static inline int16_t mavlink_msg_mission_request_partial_list_get_end_index(const mavlink_message_t* msg) |
||
190 | { |
||
191 | return _MAV_RETURN_int16_t(msg, 2); |
||
192 | } |
||
193 | |||
194 | /** |
||
195 | * @brief Decode a mission_request_partial_list message into a struct |
||
196 | * |
||
197 | * @param msg The message to decode |
||
198 | * @param mission_request_partial_list C-struct to decode the message contents into |
||
199 | */ |
||
200 | static inline void mavlink_msg_mission_request_partial_list_decode(const mavlink_message_t* msg, mavlink_mission_request_partial_list_t* mission_request_partial_list) |
||
201 | { |
||
202 | #if MAVLINK_NEED_BYTE_SWAP |
||
203 | mission_request_partial_list->start_index = mavlink_msg_mission_request_partial_list_get_start_index(msg); |
||
204 | mission_request_partial_list->end_index = mavlink_msg_mission_request_partial_list_get_end_index(msg); |
||
205 | mission_request_partial_list->target_system = mavlink_msg_mission_request_partial_list_get_target_system(msg); |
||
206 | mission_request_partial_list->target_component = mavlink_msg_mission_request_partial_list_get_target_component(msg); |
||
207 | #else |
||
208 | memcpy(mission_request_partial_list, _MAV_PAYLOAD(msg), 6); |
||
209 | #endif |
||
210 | } |