Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_param_map_rc.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE PARAM_MAP_RC PACKING
3
4#define MAVLINK_MSG_ID_PARAM_MAP_RC 50
5
6
8 float param_value0; /*< Initial parameter value*/
9 float scale; /*< Scale, maps the RC range [-1, 1] to a parameter value*/
10 float param_value_min; /*< Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)*/
11 float param_value_max; /*< Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)*/
12 int16_t param_index; /*< Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.*/
13 uint8_t target_system; /*< System ID*/
14 uint8_t target_component; /*< Component ID*/
15 char param_id[16]; /*< Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string*/
16 uint8_t parameter_rc_channel_index; /*< Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC.*/
17} mavlink_param_map_rc_t;
18
19#define MAVLINK_MSG_ID_PARAM_MAP_RC_LEN 37
20#define MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN 37
21#define MAVLINK_MSG_ID_50_LEN 37
22#define MAVLINK_MSG_ID_50_MIN_LEN 37
23
24#define MAVLINK_MSG_ID_PARAM_MAP_RC_CRC 78
25#define MAVLINK_MSG_ID_50_CRC 78
26
27#define MAVLINK_MSG_PARAM_MAP_RC_FIELD_PARAM_ID_LEN 16
28
29#if MAVLINK_COMMAND_24BIT
30#define MAVLINK_MESSAGE_INFO_PARAM_MAP_RC {
31 50,
32 "PARAM_MAP_RC",
33 9,
34 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_param_map_rc_t, target_system) },
35 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_param_map_rc_t, target_component) },
36 { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 20, offsetof(mavlink_param_map_rc_t, param_id) },
37 { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_param_map_rc_t, param_index) },
38 { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) },
39 { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) },
40 { "scale", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_param_map_rc_t, scale) },
41 { "param_value_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_param_map_rc_t, param_value_min) },
42 { "param_value_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_param_map_rc_t, param_value_max) },
43 } \
44}
45#else
46#define MAVLINK_MESSAGE_INFO_PARAM_MAP_RC {
47 "PARAM_MAP_RC",
48 9,
49 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 18, offsetof(mavlink_param_map_rc_t, target_system) },
50 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 19, offsetof(mavlink_param_map_rc_t, target_component) },
51 { "param_id", NULL, MAVLINK_TYPE_CHAR, 16, 20, offsetof(mavlink_param_map_rc_t, param_id) },
52 { "param_index", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_param_map_rc_t, param_index) },
53 { "parameter_rc_channel_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 36, offsetof(mavlink_param_map_rc_t, parameter_rc_channel_index) },
54 { "param_value0", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_param_map_rc_t, param_value0) },
55 { "scale", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_param_map_rc_t, scale) },
56 { "param_value_min", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_param_map_rc_t, param_value_min) },
57 { "param_value_max", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_param_map_rc_t, param_value_max) },
58 } \
59}
60#endif
61
62/**
63 * @brief Pack a param_map_rc message
64 * @param system_id ID of this system
65 * @param component_id ID of this component (e.g. 200 for IMU)
66 * @param msg The MAVLink message to compress the data into
67 *
68 * @param target_system System ID
69 * @param target_component Component ID
70 * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
71 * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.
72 * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC.
73 * @param param_value0 Initial parameter value
74 * @param scale Scale, maps the RC range [-1, 1] to a parameter value
75 * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)
76 * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)
77 * @return length of the message in bytes (excluding serial stream start sign)
78 */
79static inline uint16_t mavlink_msg_param_map_rc_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
80 uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max)
81{
82#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
84 _mav_put_float(buf, 0, param_value0);
85 _mav_put_float(buf, 4, scale);
86 _mav_put_float(buf, 8, param_value_min);
87 _mav_put_float(buf, 12, param_value_max);
88 _mav_put_int16_t(buf, 16, param_index);
89 _mav_put_uint8_t(buf, 18, target_system);
90 _mav_put_uint8_t(buf, 19, target_component);
91 _mav_put_uint8_t(buf, 36, parameter_rc_channel_index);
92 _mav_put_char_array(buf, 20, param_id, 16);
93 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
94#else
95 mavlink_param_map_rc_t packet;
96 packet.param_value0 = param_value0;
97 packet.scale = scale;
98 packet.param_value_min = param_value_min;
99 packet.param_value_max = param_value_max;
100 packet.param_index = param_index;
101 packet.target_system = target_system;
102 packet.target_component = target_component;
103 packet.parameter_rc_channel_index = parameter_rc_channel_index;
104 mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
105 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
106#endif
107
108 msg->msgid = MAVLINK_MSG_ID_PARAM_MAP_RC;
109 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
110}
111
112/**
113 * @brief Pack a param_map_rc message
114 * @param system_id ID of this system
115 * @param component_id ID of this component (e.g. 200 for IMU)
116 * @param status MAVLink status structure
117 * @param msg The MAVLink message to compress the data into
118 *
119 * @param target_system System ID
120 * @param target_component Component ID
121 * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
122 * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.
123 * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC.
124 * @param param_value0 Initial parameter value
125 * @param scale Scale, maps the RC range [-1, 1] to a parameter value
126 * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)
127 * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)
128 * @return length of the message in bytes (excluding serial stream start sign)
129 */
130static inline uint16_t mavlink_msg_param_map_rc_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
131 uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max)
132{
133#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
135 _mav_put_float(buf, 0, param_value0);
136 _mav_put_float(buf, 4, scale);
137 _mav_put_float(buf, 8, param_value_min);
138 _mav_put_float(buf, 12, param_value_max);
139 _mav_put_int16_t(buf, 16, param_index);
140 _mav_put_uint8_t(buf, 18, target_system);
141 _mav_put_uint8_t(buf, 19, target_component);
142 _mav_put_uint8_t(buf, 36, parameter_rc_channel_index);
143 _mav_put_char_array(buf, 20, param_id, 16);
144 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
145#else
146 mavlink_param_map_rc_t packet;
147 packet.param_value0 = param_value0;
148 packet.scale = scale;
149 packet.param_value_min = param_value_min;
150 packet.param_value_max = param_value_max;
151 packet.param_index = param_index;
152 packet.target_system = target_system;
153 packet.target_component = target_component;
154 packet.parameter_rc_channel_index = parameter_rc_channel_index;
155 mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
156 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
157#endif
158
159 msg->msgid = MAVLINK_MSG_ID_PARAM_MAP_RC;
160#if MAVLINK_CRC_EXTRA
161 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
162#else
163 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
164#endif
165}
166
167/**
168 * @brief Pack a param_map_rc message on a channel
169 * @param system_id ID of this system
170 * @param component_id ID of this component (e.g. 200 for IMU)
171 * @param chan The MAVLink channel this message will be sent over
172 * @param msg The MAVLink message to compress the data into
173 * @param target_system System ID
174 * @param target_component Component ID
175 * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
176 * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.
177 * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC.
178 * @param param_value0 Initial parameter value
179 * @param scale Scale, maps the RC range [-1, 1] to a parameter value
180 * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)
181 * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)
182 * @return length of the message in bytes (excluding serial stream start sign)
183 */
184static inline uint16_t mavlink_msg_param_map_rc_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
185 mavlink_message_t* msg,
186 uint8_t target_system,uint8_t target_component,const char *param_id,int16_t param_index,uint8_t parameter_rc_channel_index,float param_value0,float scale,float param_value_min,float param_value_max)
187{
188#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
190 _mav_put_float(buf, 0, param_value0);
191 _mav_put_float(buf, 4, scale);
192 _mav_put_float(buf, 8, param_value_min);
193 _mav_put_float(buf, 12, param_value_max);
194 _mav_put_int16_t(buf, 16, param_index);
195 _mav_put_uint8_t(buf, 18, target_system);
196 _mav_put_uint8_t(buf, 19, target_component);
197 _mav_put_uint8_t(buf, 36, parameter_rc_channel_index);
198 _mav_put_char_array(buf, 20, param_id, 16);
199 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
200#else
201 mavlink_param_map_rc_t packet;
202 packet.param_value0 = param_value0;
203 packet.scale = scale;
204 packet.param_value_min = param_value_min;
205 packet.param_value_max = param_value_max;
206 packet.param_index = param_index;
207 packet.target_system = target_system;
208 packet.target_component = target_component;
209 packet.parameter_rc_channel_index = parameter_rc_channel_index;
210 mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
211 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
212#endif
213
214 msg->msgid = MAVLINK_MSG_ID_PARAM_MAP_RC;
215 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
216}
217
218/**
219 * @brief Encode a param_map_rc struct
220 *
221 * @param system_id ID of this system
222 * @param component_id ID of this component (e.g. 200 for IMU)
223 * @param msg The MAVLink message to compress the data into
224 * @param param_map_rc C-struct to read the message contents from
225 */
226static inline uint16_t mavlink_msg_param_map_rc_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_param_map_rc_t* param_map_rc)
227{
228 return mavlink_msg_param_map_rc_pack(system_id, component_id, msg, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max);
229}
230
231/**
232 * @brief Encode a param_map_rc struct on a channel
233 *
234 * @param system_id ID of this system
235 * @param component_id ID of this component (e.g. 200 for IMU)
236 * @param chan The MAVLink channel this message will be sent over
237 * @param msg The MAVLink message to compress the data into
238 * @param param_map_rc C-struct to read the message contents from
239 */
240static inline uint16_t mavlink_msg_param_map_rc_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_param_map_rc_t* param_map_rc)
241{
242 return mavlink_msg_param_map_rc_pack_chan(system_id, component_id, chan, msg, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max);
243}
244
245/**
246 * @brief Encode a param_map_rc struct with provided status structure
247 *
248 * @param system_id ID of this system
249 * @param component_id ID of this component (e.g. 200 for IMU)
250 * @param status MAVLink status structure
251 * @param msg The MAVLink message to compress the data into
252 * @param param_map_rc C-struct to read the message contents from
253 */
254static inline uint16_t mavlink_msg_param_map_rc_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_param_map_rc_t* param_map_rc)
255{
256 return mavlink_msg_param_map_rc_pack_status(system_id, component_id, _status, msg, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max);
257}
258
259/**
260 * @brief Send a param_map_rc message
261 * @param chan MAVLink channel to send the message
262 *
263 * @param target_system System ID
264 * @param target_component Component ID
265 * @param param_id Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
266 * @param param_index Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.
267 * @param parameter_rc_channel_index Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC.
268 * @param param_value0 Initial parameter value
269 * @param scale Scale, maps the RC range [-1, 1] to a parameter value
270 * @param param_value_min Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)
271 * @param param_value_max Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)
272 */
273#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
274
275static inline void mavlink_msg_param_map_rc_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max)
276{
277#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
278 char buf[MAVLINK_MSG_ID_PARAM_MAP_RC_LEN];
279 _mav_put_float(buf, 0, param_value0);
280 _mav_put_float(buf, 4, scale);
281 _mav_put_float(buf, 8, param_value_min);
282 _mav_put_float(buf, 12, param_value_max);
283 _mav_put_int16_t(buf, 16, param_index);
284 _mav_put_uint8_t(buf, 18, target_system);
285 _mav_put_uint8_t(buf, 19, target_component);
286 _mav_put_uint8_t(buf, 36, parameter_rc_channel_index);
287 _mav_put_char_array(buf, 20, param_id, 16);
288 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
289#else
290 mavlink_param_map_rc_t packet;
291 packet.param_value0 = param_value0;
292 packet.scale = scale;
293 packet.param_value_min = param_value_min;
294 packet.param_value_max = param_value_max;
295 packet.param_index = param_index;
296 packet.target_system = target_system;
297 packet.target_component = target_component;
298 packet.parameter_rc_channel_index = parameter_rc_channel_index;
299 mav_array_memcpy(packet.param_id, param_id, sizeof(char)*16);
300 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)&packet, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
301#endif
302}
303
304/**
305 * @brief Send a param_map_rc message
306 * @param chan MAVLink channel to send the message
307 * @param struct The MAVLink struct to serialize
308 */
309static inline void mavlink_msg_param_map_rc_send_struct(mavlink_channel_t chan, const mavlink_param_map_rc_t* param_map_rc)
310{
311#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
312 mavlink_msg_param_map_rc_send(chan, param_map_rc->target_system, param_map_rc->target_component, param_map_rc->param_id, param_map_rc->param_index, param_map_rc->parameter_rc_channel_index, param_map_rc->param_value0, param_map_rc->scale, param_map_rc->param_value_min, param_map_rc->param_value_max);
313#else
314 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)param_map_rc, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
315#endif
316}
317
318#if MAVLINK_MSG_ID_PARAM_MAP_RC_LEN <= MAVLINK_MAX_PAYLOAD_LEN
319/*
320 This variant of _send() can be used to save stack space by reusing
321 memory from the receive buffer. The caller provides a
322 mavlink_message_t which is the size of a full mavlink message. This
323 is usually the receive buffer for the channel, and allows a reply to an
324 incoming message with minimum stack space usage.
325 */
326static inline void mavlink_msg_param_map_rc_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const char *param_id, int16_t param_index, uint8_t parameter_rc_channel_index, float param_value0, float scale, float param_value_min, float param_value_max)
327{
328#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
329 char *buf = (char *)msgbuf;
330 _mav_put_float(buf, 0, param_value0);
331 _mav_put_float(buf, 4, scale);
332 _mav_put_float(buf, 8, param_value_min);
333 _mav_put_float(buf, 12, param_value_max);
334 _mav_put_int16_t(buf, 16, param_index);
335 _mav_put_uint8_t(buf, 18, target_system);
336 _mav_put_uint8_t(buf, 19, target_component);
337 _mav_put_uint8_t(buf, 36, parameter_rc_channel_index);
338 _mav_put_char_array(buf, 20, param_id, 16);
339 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, buf, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
340#else
341 mavlink_param_map_rc_t *packet = (mavlink_param_map_rc_t *)msgbuf;
342 packet->param_value0 = param_value0;
343 packet->scale = scale;
344 packet->param_value_min = param_value_min;
345 packet->param_value_max = param_value_max;
346 packet->param_index = param_index;
347 packet->target_system = target_system;
348 packet->target_component = target_component;
349 packet->parameter_rc_channel_index = parameter_rc_channel_index;
350 mav_array_memcpy(packet->param_id, param_id, sizeof(char)*16);
351 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PARAM_MAP_RC, (const char *)packet, MAVLINK_MSG_ID_PARAM_MAP_RC_MIN_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN, MAVLINK_MSG_ID_PARAM_MAP_RC_CRC);
352#endif
353}
354#endif
355
356#endif
357
358// MESSAGE PARAM_MAP_RC UNPACKING
359
360
361/**
362 * @brief Get field target_system from param_map_rc message
363 *
364 * @return System ID
365 */
366static inline uint8_t mavlink_msg_param_map_rc_get_target_system(const mavlink_message_t* msg)
367{
368 return _MAV_RETURN_uint8_t(msg, 18);
369}
370
371/**
372 * @brief Get field target_component from param_map_rc message
373 *
374 * @return Component ID
375 */
376static inline uint8_t mavlink_msg_param_map_rc_get_target_component(const mavlink_message_t* msg)
377{
378 return _MAV_RETURN_uint8_t(msg, 19);
379}
380
381/**
382 * @brief Get field param_id from param_map_rc message
383 *
384 * @return Onboard parameter id, terminated by NULL if the length is less than 16 human-readable chars and WITHOUT null termination (NULL) byte if the length is exactly 16 chars - applications have to provide 16+1 bytes storage if the ID is stored as string
385 */
386static inline uint16_t mavlink_msg_param_map_rc_get_param_id(const mavlink_message_t* msg, char *param_id)
387{
388 return _MAV_RETURN_char_array(msg, param_id, 16, 20);
389}
390
391/**
392 * @brief Get field param_index from param_map_rc message
393 *
394 * @return Parameter index. Send -1 to use the param ID field as identifier (else the param id will be ignored), send -2 to disable any existing map for this rc_channel_index.
395 */
396static inline int16_t mavlink_msg_param_map_rc_get_param_index(const mavlink_message_t* msg)
397{
398 return _MAV_RETURN_int16_t(msg, 16);
399}
400
401/**
402 * @brief Get field parameter_rc_channel_index from param_map_rc message
403 *
404 * @return Index of parameter RC channel. Not equal to the RC channel id. Typically corresponds to a potentiometer-knob on the RC.
405 */
406static inline uint8_t mavlink_msg_param_map_rc_get_parameter_rc_channel_index(const mavlink_message_t* msg)
407{
408 return _MAV_RETURN_uint8_t(msg, 36);
409}
410
411/**
412 * @brief Get field param_value0 from param_map_rc message
413 *
414 * @return Initial parameter value
415 */
416static inline float mavlink_msg_param_map_rc_get_param_value0(const mavlink_message_t* msg)
417{
418 return _MAV_RETURN_float(msg, 0);
419}
420
421/**
422 * @brief Get field scale from param_map_rc message
423 *
424 * @return Scale, maps the RC range [-1, 1] to a parameter value
425 */
426static inline float mavlink_msg_param_map_rc_get_scale(const mavlink_message_t* msg)
427{
428 return _MAV_RETURN_float(msg, 4);
429}
430
431/**
432 * @brief Get field param_value_min from param_map_rc message
433 *
434 * @return Minimum param value. The protocol does not define if this overwrites an onboard minimum value. (Depends on implementation)
435 */
436static inline float mavlink_msg_param_map_rc_get_param_value_min(const mavlink_message_t* msg)
437{
438 return _MAV_RETURN_float(msg, 8);
439}
440
441/**
442 * @brief Get field param_value_max from param_map_rc message
443 *
444 * @return Maximum param value. The protocol does not define if this overwrites an onboard maximum value. (Depends on implementation)
445 */
446static inline float mavlink_msg_param_map_rc_get_param_value_max(const mavlink_message_t* msg)
447{
448 return _MAV_RETURN_float(msg, 12);
449}
450
451/**
452 * @brief Decode a param_map_rc message into a struct
453 *
454 * @param msg The message to decode
455 * @param param_map_rc C-struct to decode the message contents into
456 */
457static inline void mavlink_msg_param_map_rc_decode(const mavlink_message_t* msg, mavlink_param_map_rc_t* param_map_rc)
458{
459#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
460 param_map_rc->param_value0 = mavlink_msg_param_map_rc_get_param_value0(msg);
461 param_map_rc->scale = mavlink_msg_param_map_rc_get_scale(msg);
462 param_map_rc->param_value_min = mavlink_msg_param_map_rc_get_param_value_min(msg);
463 param_map_rc->param_value_max = mavlink_msg_param_map_rc_get_param_value_max(msg);
464 param_map_rc->param_index = mavlink_msg_param_map_rc_get_param_index(msg);
465 param_map_rc->target_system = mavlink_msg_param_map_rc_get_target_system(msg);
466 param_map_rc->target_component = mavlink_msg_param_map_rc_get_target_component(msg);
467 mavlink_msg_param_map_rc_get_param_id(msg, param_map_rc->param_id);
468 param_map_rc->parameter_rc_channel_index = mavlink_msg_param_map_rc_get_parameter_rc_channel_index(msg);
469#else
470 uint8_t len = msg->len < MAVLINK_MSG_ID_PARAM_MAP_RC_LEN? msg->len : MAVLINK_MSG_ID_PARAM_MAP_RC_LEN;
471 memset(param_map_rc, 0, MAVLINK_MSG_ID_PARAM_MAP_RC_LEN);
472 memcpy(param_map_rc, _MAV_PAYLOAD(msg), len);
473#endif
474}