mavlink_msg_rc_channels_override.h 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. #pragma once
  2. // MESSAGE RC_CHANNELS_OVERRIDE PACKING
  3. #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE 70
  4. typedef struct __mavlink_rc_channels_override_t {
  5. uint16_t chan1_raw; /*< [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.*/
  6. uint16_t chan2_raw; /*< [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.*/
  7. uint16_t chan3_raw; /*< [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.*/
  8. uint16_t chan4_raw; /*< [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.*/
  9. uint16_t chan5_raw; /*< [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.*/
  10. uint16_t chan6_raw; /*< [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.*/
  11. uint16_t chan7_raw; /*< [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.*/
  12. uint16_t chan8_raw; /*< [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.*/
  13. uint8_t target_system; /*< System ID*/
  14. uint8_t target_component; /*< Component ID*/
  15. uint16_t chan9_raw; /*< [us] RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  16. uint16_t chan10_raw; /*< [us] RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  17. uint16_t chan11_raw; /*< [us] RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  18. uint16_t chan12_raw; /*< [us] RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  19. uint16_t chan13_raw; /*< [us] RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  20. uint16_t chan14_raw; /*< [us] RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  21. uint16_t chan15_raw; /*< [us] RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  22. uint16_t chan16_raw; /*< [us] RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  23. uint16_t chan17_raw; /*< [us] RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  24. uint16_t chan18_raw; /*< [us] RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.*/
  25. } mavlink_rc_channels_override_t;
  26. #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN 38
  27. #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN 18
  28. #define MAVLINK_MSG_ID_70_LEN 38
  29. #define MAVLINK_MSG_ID_70_MIN_LEN 18
  30. #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC 124
  31. #define MAVLINK_MSG_ID_70_CRC 124
  32. #if MAVLINK_COMMAND_24BIT
  33. #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \
  34. 70, \
  35. "RC_CHANNELS_OVERRIDE", \
  36. 20, \
  37. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \
  38. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \
  39. { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \
  40. { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \
  41. { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \
  42. { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \
  43. { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_override_t, chan5_raw) }, \
  44. { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \
  45. { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \
  46. { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \
  47. { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_override_t, chan9_raw) }, \
  48. { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_rc_channels_override_t, chan10_raw) }, \
  49. { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_rc_channels_override_t, chan11_raw) }, \
  50. { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_rc_channels_override_t, chan12_raw) }, \
  51. { "chan13_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_rc_channels_override_t, chan13_raw) }, \
  52. { "chan14_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_rc_channels_override_t, chan14_raw) }, \
  53. { "chan15_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_rc_channels_override_t, chan15_raw) }, \
  54. { "chan16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_rc_channels_override_t, chan16_raw) }, \
  55. { "chan17_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_rc_channels_override_t, chan17_raw) }, \
  56. { "chan18_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_rc_channels_override_t, chan18_raw) }, \
  57. } \
  58. }
  59. #else
  60. #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \
  61. "RC_CHANNELS_OVERRIDE", \
  62. 20, \
  63. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \
  64. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \
  65. { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \
  66. { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \
  67. { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \
  68. { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \
  69. { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_override_t, chan5_raw) }, \
  70. { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \
  71. { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \
  72. { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \
  73. { "chan9_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_rc_channels_override_t, chan9_raw) }, \
  74. { "chan10_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_rc_channels_override_t, chan10_raw) }, \
  75. { "chan11_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_rc_channels_override_t, chan11_raw) }, \
  76. { "chan12_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_rc_channels_override_t, chan12_raw) }, \
  77. { "chan13_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_rc_channels_override_t, chan13_raw) }, \
  78. { "chan14_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_rc_channels_override_t, chan14_raw) }, \
  79. { "chan15_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_rc_channels_override_t, chan15_raw) }, \
  80. { "chan16_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_rc_channels_override_t, chan16_raw) }, \
  81. { "chan17_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_rc_channels_override_t, chan17_raw) }, \
  82. { "chan18_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 36, offsetof(mavlink_rc_channels_override_t, chan18_raw) }, \
  83. } \
  84. }
  85. #endif
  86. /**
  87. * @brief Pack a rc_channels_override message
  88. * @param system_id ID of this system
  89. * @param component_id ID of this component (e.g. 200 for IMU)
  90. * @param msg The MAVLink message to compress the data into
  91. *
  92. * @param target_system System ID
  93. * @param target_component Component ID
  94. * @param chan1_raw [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  95. * @param chan2_raw [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  96. * @param chan3_raw [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  97. * @param chan4_raw [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  98. * @param chan5_raw [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  99. * @param chan6_raw [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  100. * @param chan7_raw [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  101. * @param chan8_raw [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  102. * @param chan9_raw [us] RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  103. * @param chan10_raw [us] RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  104. * @param chan11_raw [us] RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  105. * @param chan12_raw [us] RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  106. * @param chan13_raw [us] RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  107. * @param chan14_raw [us] RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  108. * @param chan15_raw [us] RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  109. * @param chan16_raw [us] RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  110. * @param chan17_raw [us] RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  111. * @param chan18_raw [us] RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  112. * @return length of the message in bytes (excluding serial stream start sign)
  113. */
  114. static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  115. uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw)
  116. {
  117. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  118. char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
  119. _mav_put_uint16_t(buf, 0, chan1_raw);
  120. _mav_put_uint16_t(buf, 2, chan2_raw);
  121. _mav_put_uint16_t(buf, 4, chan3_raw);
  122. _mav_put_uint16_t(buf, 6, chan4_raw);
  123. _mav_put_uint16_t(buf, 8, chan5_raw);
  124. _mav_put_uint16_t(buf, 10, chan6_raw);
  125. _mav_put_uint16_t(buf, 12, chan7_raw);
  126. _mav_put_uint16_t(buf, 14, chan8_raw);
  127. _mav_put_uint8_t(buf, 16, target_system);
  128. _mav_put_uint8_t(buf, 17, target_component);
  129. _mav_put_uint16_t(buf, 18, chan9_raw);
  130. _mav_put_uint16_t(buf, 20, chan10_raw);
  131. _mav_put_uint16_t(buf, 22, chan11_raw);
  132. _mav_put_uint16_t(buf, 24, chan12_raw);
  133. _mav_put_uint16_t(buf, 26, chan13_raw);
  134. _mav_put_uint16_t(buf, 28, chan14_raw);
  135. _mav_put_uint16_t(buf, 30, chan15_raw);
  136. _mav_put_uint16_t(buf, 32, chan16_raw);
  137. _mav_put_uint16_t(buf, 34, chan17_raw);
  138. _mav_put_uint16_t(buf, 36, chan18_raw);
  139. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
  140. #else
  141. mavlink_rc_channels_override_t packet;
  142. packet.chan1_raw = chan1_raw;
  143. packet.chan2_raw = chan2_raw;
  144. packet.chan3_raw = chan3_raw;
  145. packet.chan4_raw = chan4_raw;
  146. packet.chan5_raw = chan5_raw;
  147. packet.chan6_raw = chan6_raw;
  148. packet.chan7_raw = chan7_raw;
  149. packet.chan8_raw = chan8_raw;
  150. packet.target_system = target_system;
  151. packet.target_component = target_component;
  152. packet.chan9_raw = chan9_raw;
  153. packet.chan10_raw = chan10_raw;
  154. packet.chan11_raw = chan11_raw;
  155. packet.chan12_raw = chan12_raw;
  156. packet.chan13_raw = chan13_raw;
  157. packet.chan14_raw = chan14_raw;
  158. packet.chan15_raw = chan15_raw;
  159. packet.chan16_raw = chan16_raw;
  160. packet.chan17_raw = chan17_raw;
  161. packet.chan18_raw = chan18_raw;
  162. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
  163. #endif
  164. msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
  165. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
  166. }
  167. /**
  168. * @brief Pack a rc_channels_override 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 chan1_raw [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  176. * @param chan2_raw [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  177. * @param chan3_raw [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  178. * @param chan4_raw [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  179. * @param chan5_raw [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  180. * @param chan6_raw [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  181. * @param chan7_raw [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  182. * @param chan8_raw [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  183. * @param chan9_raw [us] RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  184. * @param chan10_raw [us] RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  185. * @param chan11_raw [us] RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  186. * @param chan12_raw [us] RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  187. * @param chan13_raw [us] RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  188. * @param chan14_raw [us] RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  189. * @param chan15_raw [us] RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  190. * @param chan16_raw [us] RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  191. * @param chan17_raw [us] RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  192. * @param chan18_raw [us] RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  193. * @return length of the message in bytes (excluding serial stream start sign)
  194. */
  195. static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  196. mavlink_message_t* msg,
  197. uint8_t target_system,uint8_t target_component,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw,uint16_t chan9_raw,uint16_t chan10_raw,uint16_t chan11_raw,uint16_t chan12_raw,uint16_t chan13_raw,uint16_t chan14_raw,uint16_t chan15_raw,uint16_t chan16_raw,uint16_t chan17_raw,uint16_t chan18_raw)
  198. {
  199. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  200. char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
  201. _mav_put_uint16_t(buf, 0, chan1_raw);
  202. _mav_put_uint16_t(buf, 2, chan2_raw);
  203. _mav_put_uint16_t(buf, 4, chan3_raw);
  204. _mav_put_uint16_t(buf, 6, chan4_raw);
  205. _mav_put_uint16_t(buf, 8, chan5_raw);
  206. _mav_put_uint16_t(buf, 10, chan6_raw);
  207. _mav_put_uint16_t(buf, 12, chan7_raw);
  208. _mav_put_uint16_t(buf, 14, chan8_raw);
  209. _mav_put_uint8_t(buf, 16, target_system);
  210. _mav_put_uint8_t(buf, 17, target_component);
  211. _mav_put_uint16_t(buf, 18, chan9_raw);
  212. _mav_put_uint16_t(buf, 20, chan10_raw);
  213. _mav_put_uint16_t(buf, 22, chan11_raw);
  214. _mav_put_uint16_t(buf, 24, chan12_raw);
  215. _mav_put_uint16_t(buf, 26, chan13_raw);
  216. _mav_put_uint16_t(buf, 28, chan14_raw);
  217. _mav_put_uint16_t(buf, 30, chan15_raw);
  218. _mav_put_uint16_t(buf, 32, chan16_raw);
  219. _mav_put_uint16_t(buf, 34, chan17_raw);
  220. _mav_put_uint16_t(buf, 36, chan18_raw);
  221. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
  222. #else
  223. mavlink_rc_channels_override_t packet;
  224. packet.chan1_raw = chan1_raw;
  225. packet.chan2_raw = chan2_raw;
  226. packet.chan3_raw = chan3_raw;
  227. packet.chan4_raw = chan4_raw;
  228. packet.chan5_raw = chan5_raw;
  229. packet.chan6_raw = chan6_raw;
  230. packet.chan7_raw = chan7_raw;
  231. packet.chan8_raw = chan8_raw;
  232. packet.target_system = target_system;
  233. packet.target_component = target_component;
  234. packet.chan9_raw = chan9_raw;
  235. packet.chan10_raw = chan10_raw;
  236. packet.chan11_raw = chan11_raw;
  237. packet.chan12_raw = chan12_raw;
  238. packet.chan13_raw = chan13_raw;
  239. packet.chan14_raw = chan14_raw;
  240. packet.chan15_raw = chan15_raw;
  241. packet.chan16_raw = chan16_raw;
  242. packet.chan17_raw = chan17_raw;
  243. packet.chan18_raw = chan18_raw;
  244. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
  245. #endif
  246. msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
  247. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
  248. }
  249. /**
  250. * @brief Encode a rc_channels_override struct
  251. *
  252. * @param system_id ID of this system
  253. * @param component_id ID of this component (e.g. 200 for IMU)
  254. * @param msg The MAVLink message to compress the data into
  255. * @param rc_channels_override C-struct to read the message contents from
  256. */
  257. static inline uint16_t mavlink_msg_rc_channels_override_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override)
  258. {
  259. return mavlink_msg_rc_channels_override_pack(system_id, component_id, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw, rc_channels_override->chan9_raw, rc_channels_override->chan10_raw, rc_channels_override->chan11_raw, rc_channels_override->chan12_raw, rc_channels_override->chan13_raw, rc_channels_override->chan14_raw, rc_channels_override->chan15_raw, rc_channels_override->chan16_raw, rc_channels_override->chan17_raw, rc_channels_override->chan18_raw);
  260. }
  261. /**
  262. * @brief Encode a rc_channels_override struct on a channel
  263. *
  264. * @param system_id ID of this system
  265. * @param component_id ID of this component (e.g. 200 for IMU)
  266. * @param chan The MAVLink channel this message will be sent over
  267. * @param msg The MAVLink message to compress the data into
  268. * @param rc_channels_override C-struct to read the message contents from
  269. */
  270. static inline uint16_t mavlink_msg_rc_channels_override_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override)
  271. {
  272. return mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, chan, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw, rc_channels_override->chan9_raw, rc_channels_override->chan10_raw, rc_channels_override->chan11_raw, rc_channels_override->chan12_raw, rc_channels_override->chan13_raw, rc_channels_override->chan14_raw, rc_channels_override->chan15_raw, rc_channels_override->chan16_raw, rc_channels_override->chan17_raw, rc_channels_override->chan18_raw);
  273. }
  274. /**
  275. * @brief Send a rc_channels_override message
  276. * @param chan MAVLink channel to send the message
  277. *
  278. * @param target_system System ID
  279. * @param target_component Component ID
  280. * @param chan1_raw [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  281. * @param chan2_raw [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  282. * @param chan3_raw [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  283. * @param chan4_raw [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  284. * @param chan5_raw [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  285. * @param chan6_raw [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  286. * @param chan7_raw [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  287. * @param chan8_raw [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  288. * @param chan9_raw [us] RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  289. * @param chan10_raw [us] RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  290. * @param chan11_raw [us] RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  291. * @param chan12_raw [us] RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  292. * @param chan13_raw [us] RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  293. * @param chan14_raw [us] RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  294. * @param chan15_raw [us] RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  295. * @param chan16_raw [us] RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  296. * @param chan17_raw [us] RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  297. * @param chan18_raw [us] RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  298. */
  299. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  300. static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw)
  301. {
  302. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  303. char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
  304. _mav_put_uint16_t(buf, 0, chan1_raw);
  305. _mav_put_uint16_t(buf, 2, chan2_raw);
  306. _mav_put_uint16_t(buf, 4, chan3_raw);
  307. _mav_put_uint16_t(buf, 6, chan4_raw);
  308. _mav_put_uint16_t(buf, 8, chan5_raw);
  309. _mav_put_uint16_t(buf, 10, chan6_raw);
  310. _mav_put_uint16_t(buf, 12, chan7_raw);
  311. _mav_put_uint16_t(buf, 14, chan8_raw);
  312. _mav_put_uint8_t(buf, 16, target_system);
  313. _mav_put_uint8_t(buf, 17, target_component);
  314. _mav_put_uint16_t(buf, 18, chan9_raw);
  315. _mav_put_uint16_t(buf, 20, chan10_raw);
  316. _mav_put_uint16_t(buf, 22, chan11_raw);
  317. _mav_put_uint16_t(buf, 24, chan12_raw);
  318. _mav_put_uint16_t(buf, 26, chan13_raw);
  319. _mav_put_uint16_t(buf, 28, chan14_raw);
  320. _mav_put_uint16_t(buf, 30, chan15_raw);
  321. _mav_put_uint16_t(buf, 32, chan16_raw);
  322. _mav_put_uint16_t(buf, 34, chan17_raw);
  323. _mav_put_uint16_t(buf, 36, chan18_raw);
  324. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
  325. #else
  326. mavlink_rc_channels_override_t packet;
  327. packet.chan1_raw = chan1_raw;
  328. packet.chan2_raw = chan2_raw;
  329. packet.chan3_raw = chan3_raw;
  330. packet.chan4_raw = chan4_raw;
  331. packet.chan5_raw = chan5_raw;
  332. packet.chan6_raw = chan6_raw;
  333. packet.chan7_raw = chan7_raw;
  334. packet.chan8_raw = chan8_raw;
  335. packet.target_system = target_system;
  336. packet.target_component = target_component;
  337. packet.chan9_raw = chan9_raw;
  338. packet.chan10_raw = chan10_raw;
  339. packet.chan11_raw = chan11_raw;
  340. packet.chan12_raw = chan12_raw;
  341. packet.chan13_raw = chan13_raw;
  342. packet.chan14_raw = chan14_raw;
  343. packet.chan15_raw = chan15_raw;
  344. packet.chan16_raw = chan16_raw;
  345. packet.chan17_raw = chan17_raw;
  346. packet.chan18_raw = chan18_raw;
  347. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
  348. #endif
  349. }
  350. /**
  351. * @brief Send a rc_channels_override message
  352. * @param chan MAVLink channel to send the message
  353. * @param struct The MAVLink struct to serialize
  354. */
  355. static inline void mavlink_msg_rc_channels_override_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_override_t* rc_channels_override)
  356. {
  357. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  358. mavlink_msg_rc_channels_override_send(chan, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw, rc_channels_override->chan9_raw, rc_channels_override->chan10_raw, rc_channels_override->chan11_raw, rc_channels_override->chan12_raw, rc_channels_override->chan13_raw, rc_channels_override->chan14_raw, rc_channels_override->chan15_raw, rc_channels_override->chan16_raw, rc_channels_override->chan17_raw, rc_channels_override->chan18_raw);
  359. #else
  360. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)rc_channels_override, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
  361. #endif
  362. }
  363. #if MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  364. /*
  365. This variant of _send() can be used to save stack space by re-using
  366. memory from the receive buffer. The caller provides a
  367. mavlink_message_t which is the size of a full mavlink message. This
  368. is usually the receive buffer for the channel, and allows a reply to an
  369. incoming message with minimum stack space usage.
  370. */
  371. static inline void mavlink_msg_rc_channels_override_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw, uint16_t chan9_raw, uint16_t chan10_raw, uint16_t chan11_raw, uint16_t chan12_raw, uint16_t chan13_raw, uint16_t chan14_raw, uint16_t chan15_raw, uint16_t chan16_raw, uint16_t chan17_raw, uint16_t chan18_raw)
  372. {
  373. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  374. char *buf = (char *)msgbuf;
  375. _mav_put_uint16_t(buf, 0, chan1_raw);
  376. _mav_put_uint16_t(buf, 2, chan2_raw);
  377. _mav_put_uint16_t(buf, 4, chan3_raw);
  378. _mav_put_uint16_t(buf, 6, chan4_raw);
  379. _mav_put_uint16_t(buf, 8, chan5_raw);
  380. _mav_put_uint16_t(buf, 10, chan6_raw);
  381. _mav_put_uint16_t(buf, 12, chan7_raw);
  382. _mav_put_uint16_t(buf, 14, chan8_raw);
  383. _mav_put_uint8_t(buf, 16, target_system);
  384. _mav_put_uint8_t(buf, 17, target_component);
  385. _mav_put_uint16_t(buf, 18, chan9_raw);
  386. _mav_put_uint16_t(buf, 20, chan10_raw);
  387. _mav_put_uint16_t(buf, 22, chan11_raw);
  388. _mav_put_uint16_t(buf, 24, chan12_raw);
  389. _mav_put_uint16_t(buf, 26, chan13_raw);
  390. _mav_put_uint16_t(buf, 28, chan14_raw);
  391. _mav_put_uint16_t(buf, 30, chan15_raw);
  392. _mav_put_uint16_t(buf, 32, chan16_raw);
  393. _mav_put_uint16_t(buf, 34, chan17_raw);
  394. _mav_put_uint16_t(buf, 36, chan18_raw);
  395. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
  396. #else
  397. mavlink_rc_channels_override_t *packet = (mavlink_rc_channels_override_t *)msgbuf;
  398. packet->chan1_raw = chan1_raw;
  399. packet->chan2_raw = chan2_raw;
  400. packet->chan3_raw = chan3_raw;
  401. packet->chan4_raw = chan4_raw;
  402. packet->chan5_raw = chan5_raw;
  403. packet->chan6_raw = chan6_raw;
  404. packet->chan7_raw = chan7_raw;
  405. packet->chan8_raw = chan8_raw;
  406. packet->target_system = target_system;
  407. packet->target_component = target_component;
  408. packet->chan9_raw = chan9_raw;
  409. packet->chan10_raw = chan10_raw;
  410. packet->chan11_raw = chan11_raw;
  411. packet->chan12_raw = chan12_raw;
  412. packet->chan13_raw = chan13_raw;
  413. packet->chan14_raw = chan14_raw;
  414. packet->chan15_raw = chan15_raw;
  415. packet->chan16_raw = chan16_raw;
  416. packet->chan17_raw = chan17_raw;
  417. packet->chan18_raw = chan18_raw;
  418. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
  419. #endif
  420. }
  421. #endif
  422. #endif
  423. // MESSAGE RC_CHANNELS_OVERRIDE UNPACKING
  424. /**
  425. * @brief Get field target_system from rc_channels_override message
  426. *
  427. * @return System ID
  428. */
  429. static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const mavlink_message_t* msg)
  430. {
  431. return _MAV_RETURN_uint8_t(msg, 16);
  432. }
  433. /**
  434. * @brief Get field target_component from rc_channels_override message
  435. *
  436. * @return Component ID
  437. */
  438. static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(const mavlink_message_t* msg)
  439. {
  440. return _MAV_RETURN_uint8_t(msg, 17);
  441. }
  442. /**
  443. * @brief Get field chan1_raw from rc_channels_override message
  444. *
  445. * @return [us] RC channel 1 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  446. */
  447. static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavlink_message_t* msg)
  448. {
  449. return _MAV_RETURN_uint16_t(msg, 0);
  450. }
  451. /**
  452. * @brief Get field chan2_raw from rc_channels_override message
  453. *
  454. * @return [us] RC channel 2 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  455. */
  456. static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavlink_message_t* msg)
  457. {
  458. return _MAV_RETURN_uint16_t(msg, 2);
  459. }
  460. /**
  461. * @brief Get field chan3_raw from rc_channels_override message
  462. *
  463. * @return [us] RC channel 3 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  464. */
  465. static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavlink_message_t* msg)
  466. {
  467. return _MAV_RETURN_uint16_t(msg, 4);
  468. }
  469. /**
  470. * @brief Get field chan4_raw from rc_channels_override message
  471. *
  472. * @return [us] RC channel 4 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  473. */
  474. static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavlink_message_t* msg)
  475. {
  476. return _MAV_RETURN_uint16_t(msg, 6);
  477. }
  478. /**
  479. * @brief Get field chan5_raw from rc_channels_override message
  480. *
  481. * @return [us] RC channel 5 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  482. */
  483. static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavlink_message_t* msg)
  484. {
  485. return _MAV_RETURN_uint16_t(msg, 8);
  486. }
  487. /**
  488. * @brief Get field chan6_raw from rc_channels_override message
  489. *
  490. * @return [us] RC channel 6 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  491. */
  492. static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavlink_message_t* msg)
  493. {
  494. return _MAV_RETURN_uint16_t(msg, 10);
  495. }
  496. /**
  497. * @brief Get field chan7_raw from rc_channels_override message
  498. *
  499. * @return [us] RC channel 7 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  500. */
  501. static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavlink_message_t* msg)
  502. {
  503. return _MAV_RETURN_uint16_t(msg, 12);
  504. }
  505. /**
  506. * @brief Get field chan8_raw from rc_channels_override message
  507. *
  508. * @return [us] RC channel 8 value. A value of UINT16_MAX means to ignore this field. A value of 0 means to release this channel back to the RC radio.
  509. */
  510. static inline uint16_t mavlink_msg_rc_channels_override_get_chan8_raw(const mavlink_message_t* msg)
  511. {
  512. return _MAV_RETURN_uint16_t(msg, 14);
  513. }
  514. /**
  515. * @brief Get field chan9_raw from rc_channels_override message
  516. *
  517. * @return [us] RC channel 9 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  518. */
  519. static inline uint16_t mavlink_msg_rc_channels_override_get_chan9_raw(const mavlink_message_t* msg)
  520. {
  521. return _MAV_RETURN_uint16_t(msg, 18);
  522. }
  523. /**
  524. * @brief Get field chan10_raw from rc_channels_override message
  525. *
  526. * @return [us] RC channel 10 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  527. */
  528. static inline uint16_t mavlink_msg_rc_channels_override_get_chan10_raw(const mavlink_message_t* msg)
  529. {
  530. return _MAV_RETURN_uint16_t(msg, 20);
  531. }
  532. /**
  533. * @brief Get field chan11_raw from rc_channels_override message
  534. *
  535. * @return [us] RC channel 11 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  536. */
  537. static inline uint16_t mavlink_msg_rc_channels_override_get_chan11_raw(const mavlink_message_t* msg)
  538. {
  539. return _MAV_RETURN_uint16_t(msg, 22);
  540. }
  541. /**
  542. * @brief Get field chan12_raw from rc_channels_override message
  543. *
  544. * @return [us] RC channel 12 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  545. */
  546. static inline uint16_t mavlink_msg_rc_channels_override_get_chan12_raw(const mavlink_message_t* msg)
  547. {
  548. return _MAV_RETURN_uint16_t(msg, 24);
  549. }
  550. /**
  551. * @brief Get field chan13_raw from rc_channels_override message
  552. *
  553. * @return [us] RC channel 13 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  554. */
  555. static inline uint16_t mavlink_msg_rc_channels_override_get_chan13_raw(const mavlink_message_t* msg)
  556. {
  557. return _MAV_RETURN_uint16_t(msg, 26);
  558. }
  559. /**
  560. * @brief Get field chan14_raw from rc_channels_override message
  561. *
  562. * @return [us] RC channel 14 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  563. */
  564. static inline uint16_t mavlink_msg_rc_channels_override_get_chan14_raw(const mavlink_message_t* msg)
  565. {
  566. return _MAV_RETURN_uint16_t(msg, 28);
  567. }
  568. /**
  569. * @brief Get field chan15_raw from rc_channels_override message
  570. *
  571. * @return [us] RC channel 15 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  572. */
  573. static inline uint16_t mavlink_msg_rc_channels_override_get_chan15_raw(const mavlink_message_t* msg)
  574. {
  575. return _MAV_RETURN_uint16_t(msg, 30);
  576. }
  577. /**
  578. * @brief Get field chan16_raw from rc_channels_override message
  579. *
  580. * @return [us] RC channel 16 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  581. */
  582. static inline uint16_t mavlink_msg_rc_channels_override_get_chan16_raw(const mavlink_message_t* msg)
  583. {
  584. return _MAV_RETURN_uint16_t(msg, 32);
  585. }
  586. /**
  587. * @brief Get field chan17_raw from rc_channels_override message
  588. *
  589. * @return [us] RC channel 17 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  590. */
  591. static inline uint16_t mavlink_msg_rc_channels_override_get_chan17_raw(const mavlink_message_t* msg)
  592. {
  593. return _MAV_RETURN_uint16_t(msg, 34);
  594. }
  595. /**
  596. * @brief Get field chan18_raw from rc_channels_override message
  597. *
  598. * @return [us] RC channel 18 value. A value of 0 or UINT16_MAX means to ignore this field. A value of UINT16_MAX-1 means to release this channel back to the RC radio.
  599. */
  600. static inline uint16_t mavlink_msg_rc_channels_override_get_chan18_raw(const mavlink_message_t* msg)
  601. {
  602. return _MAV_RETURN_uint16_t(msg, 36);
  603. }
  604. /**
  605. * @brief Decode a rc_channels_override message into a struct
  606. *
  607. * @param msg The message to decode
  608. * @param rc_channels_override C-struct to decode the message contents into
  609. */
  610. static inline void mavlink_msg_rc_channels_override_decode(const mavlink_message_t* msg, mavlink_rc_channels_override_t* rc_channels_override)
  611. {
  612. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  613. rc_channels_override->chan1_raw = mavlink_msg_rc_channels_override_get_chan1_raw(msg);
  614. rc_channels_override->chan2_raw = mavlink_msg_rc_channels_override_get_chan2_raw(msg);
  615. rc_channels_override->chan3_raw = mavlink_msg_rc_channels_override_get_chan3_raw(msg);
  616. rc_channels_override->chan4_raw = mavlink_msg_rc_channels_override_get_chan4_raw(msg);
  617. rc_channels_override->chan5_raw = mavlink_msg_rc_channels_override_get_chan5_raw(msg);
  618. rc_channels_override->chan6_raw = mavlink_msg_rc_channels_override_get_chan6_raw(msg);
  619. rc_channels_override->chan7_raw = mavlink_msg_rc_channels_override_get_chan7_raw(msg);
  620. rc_channels_override->chan8_raw = mavlink_msg_rc_channels_override_get_chan8_raw(msg);
  621. rc_channels_override->target_system = mavlink_msg_rc_channels_override_get_target_system(msg);
  622. rc_channels_override->target_component = mavlink_msg_rc_channels_override_get_target_component(msg);
  623. rc_channels_override->chan9_raw = mavlink_msg_rc_channels_override_get_chan9_raw(msg);
  624. rc_channels_override->chan10_raw = mavlink_msg_rc_channels_override_get_chan10_raw(msg);
  625. rc_channels_override->chan11_raw = mavlink_msg_rc_channels_override_get_chan11_raw(msg);
  626. rc_channels_override->chan12_raw = mavlink_msg_rc_channels_override_get_chan12_raw(msg);
  627. rc_channels_override->chan13_raw = mavlink_msg_rc_channels_override_get_chan13_raw(msg);
  628. rc_channels_override->chan14_raw = mavlink_msg_rc_channels_override_get_chan14_raw(msg);
  629. rc_channels_override->chan15_raw = mavlink_msg_rc_channels_override_get_chan15_raw(msg);
  630. rc_channels_override->chan16_raw = mavlink_msg_rc_channels_override_get_chan16_raw(msg);
  631. rc_channels_override->chan17_raw = mavlink_msg_rc_channels_override_get_chan17_raw(msg);
  632. rc_channels_override->chan18_raw = mavlink_msg_rc_channels_override_get_chan18_raw(msg);
  633. #else
  634. uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN;
  635. memset(rc_channels_override, 0, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
  636. memcpy(rc_channels_override, _MAV_PAYLOAD(msg), len);
  637. #endif
  638. }