mavlink_msg_rc_channels_override.h 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792
  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
  169. * @param system_id ID of this system
  170. * @param component_id ID of this component (e.g. 200 for IMU)
  171. * @param status MAVLink status structure
  172. * @param msg The MAVLink message to compress the data into
  173. *
  174. * @param target_system System ID
  175. * @param target_component Component ID
  176. * @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.
  177. * @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.
  178. * @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.
  179. * @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.
  180. * @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.
  181. * @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.
  182. * @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.
  183. * @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.
  184. * @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.
  185. * @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.
  186. * @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.
  187. * @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.
  188. * @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.
  189. * @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.
  190. * @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.
  191. * @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.
  192. * @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.
  193. * @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.
  194. * @return length of the message in bytes (excluding serial stream start sign)
  195. */
  196. static inline uint16_t mavlink_msg_rc_channels_override_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, 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. #if MAVLINK_CRC_EXTRA
  248. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
  249. #else
  250. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_MIN_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
  251. #endif
  252. }
  253. /**
  254. * @brief Pack a rc_channels_override message on a channel
  255. * @param system_id ID of this system
  256. * @param component_id ID of this component (e.g. 200 for IMU)
  257. * @param chan The MAVLink channel this message will be sent over
  258. * @param msg The MAVLink message to compress the data into
  259. * @param target_system System ID
  260. * @param target_component Component ID
  261. * @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.
  262. * @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.
  263. * @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.
  264. * @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.
  265. * @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.
  266. * @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.
  267. * @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.
  268. * @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.
  269. * @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.
  270. * @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.
  271. * @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.
  272. * @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.
  273. * @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.
  274. * @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.
  275. * @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.
  276. * @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.
  277. * @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.
  278. * @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.
  279. * @return length of the message in bytes (excluding serial stream start sign)
  280. */
  281. static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  282. mavlink_message_t* msg,
  283. 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)
  284. {
  285. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  286. char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
  287. _mav_put_uint16_t(buf, 0, chan1_raw);
  288. _mav_put_uint16_t(buf, 2, chan2_raw);
  289. _mav_put_uint16_t(buf, 4, chan3_raw);
  290. _mav_put_uint16_t(buf, 6, chan4_raw);
  291. _mav_put_uint16_t(buf, 8, chan5_raw);
  292. _mav_put_uint16_t(buf, 10, chan6_raw);
  293. _mav_put_uint16_t(buf, 12, chan7_raw);
  294. _mav_put_uint16_t(buf, 14, chan8_raw);
  295. _mav_put_uint8_t(buf, 16, target_system);
  296. _mav_put_uint8_t(buf, 17, target_component);
  297. _mav_put_uint16_t(buf, 18, chan9_raw);
  298. _mav_put_uint16_t(buf, 20, chan10_raw);
  299. _mav_put_uint16_t(buf, 22, chan11_raw);
  300. _mav_put_uint16_t(buf, 24, chan12_raw);
  301. _mav_put_uint16_t(buf, 26, chan13_raw);
  302. _mav_put_uint16_t(buf, 28, chan14_raw);
  303. _mav_put_uint16_t(buf, 30, chan15_raw);
  304. _mav_put_uint16_t(buf, 32, chan16_raw);
  305. _mav_put_uint16_t(buf, 34, chan17_raw);
  306. _mav_put_uint16_t(buf, 36, chan18_raw);
  307. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
  308. #else
  309. mavlink_rc_channels_override_t packet;
  310. packet.chan1_raw = chan1_raw;
  311. packet.chan2_raw = chan2_raw;
  312. packet.chan3_raw = chan3_raw;
  313. packet.chan4_raw = chan4_raw;
  314. packet.chan5_raw = chan5_raw;
  315. packet.chan6_raw = chan6_raw;
  316. packet.chan7_raw = chan7_raw;
  317. packet.chan8_raw = chan8_raw;
  318. packet.target_system = target_system;
  319. packet.target_component = target_component;
  320. packet.chan9_raw = chan9_raw;
  321. packet.chan10_raw = chan10_raw;
  322. packet.chan11_raw = chan11_raw;
  323. packet.chan12_raw = chan12_raw;
  324. packet.chan13_raw = chan13_raw;
  325. packet.chan14_raw = chan14_raw;
  326. packet.chan15_raw = chan15_raw;
  327. packet.chan16_raw = chan16_raw;
  328. packet.chan17_raw = chan17_raw;
  329. packet.chan18_raw = chan18_raw;
  330. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
  331. #endif
  332. msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
  333. 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);
  334. }
  335. /**
  336. * @brief Encode a rc_channels_override struct
  337. *
  338. * @param system_id ID of this system
  339. * @param component_id ID of this component (e.g. 200 for IMU)
  340. * @param msg The MAVLink message to compress the data into
  341. * @param rc_channels_override C-struct to read the message contents from
  342. */
  343. 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)
  344. {
  345. 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);
  346. }
  347. /**
  348. * @brief Encode a rc_channels_override struct on a channel
  349. *
  350. * @param system_id ID of this system
  351. * @param component_id ID of this component (e.g. 200 for IMU)
  352. * @param chan The MAVLink channel this message will be sent over
  353. * @param msg The MAVLink message to compress the data into
  354. * @param rc_channels_override C-struct to read the message contents from
  355. */
  356. 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)
  357. {
  358. 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);
  359. }
  360. /**
  361. * @brief Encode a rc_channels_override struct with provided status structure
  362. *
  363. * @param system_id ID of this system
  364. * @param component_id ID of this component (e.g. 200 for IMU)
  365. * @param status MAVLink status structure
  366. * @param msg The MAVLink message to compress the data into
  367. * @param rc_channels_override C-struct to read the message contents from
  368. */
  369. static inline uint16_t mavlink_msg_rc_channels_override_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override)
  370. {
  371. return mavlink_msg_rc_channels_override_pack_status(system_id, component_id, _status, 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);
  372. }
  373. /**
  374. * @brief Send a rc_channels_override message
  375. * @param chan MAVLink channel to send the message
  376. *
  377. * @param target_system System ID
  378. * @param target_component Component ID
  379. * @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.
  380. * @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.
  381. * @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.
  382. * @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.
  383. * @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.
  384. * @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.
  385. * @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.
  386. * @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.
  387. * @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.
  388. * @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.
  389. * @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.
  390. * @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.
  391. * @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.
  392. * @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.
  393. * @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.
  394. * @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.
  395. * @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.
  396. * @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.
  397. */
  398. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  399. 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)
  400. {
  401. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  402. char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
  403. _mav_put_uint16_t(buf, 0, chan1_raw);
  404. _mav_put_uint16_t(buf, 2, chan2_raw);
  405. _mav_put_uint16_t(buf, 4, chan3_raw);
  406. _mav_put_uint16_t(buf, 6, chan4_raw);
  407. _mav_put_uint16_t(buf, 8, chan5_raw);
  408. _mav_put_uint16_t(buf, 10, chan6_raw);
  409. _mav_put_uint16_t(buf, 12, chan7_raw);
  410. _mav_put_uint16_t(buf, 14, chan8_raw);
  411. _mav_put_uint8_t(buf, 16, target_system);
  412. _mav_put_uint8_t(buf, 17, target_component);
  413. _mav_put_uint16_t(buf, 18, chan9_raw);
  414. _mav_put_uint16_t(buf, 20, chan10_raw);
  415. _mav_put_uint16_t(buf, 22, chan11_raw);
  416. _mav_put_uint16_t(buf, 24, chan12_raw);
  417. _mav_put_uint16_t(buf, 26, chan13_raw);
  418. _mav_put_uint16_t(buf, 28, chan14_raw);
  419. _mav_put_uint16_t(buf, 30, chan15_raw);
  420. _mav_put_uint16_t(buf, 32, chan16_raw);
  421. _mav_put_uint16_t(buf, 34, chan17_raw);
  422. _mav_put_uint16_t(buf, 36, chan18_raw);
  423. _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);
  424. #else
  425. mavlink_rc_channels_override_t packet;
  426. packet.chan1_raw = chan1_raw;
  427. packet.chan2_raw = chan2_raw;
  428. packet.chan3_raw = chan3_raw;
  429. packet.chan4_raw = chan4_raw;
  430. packet.chan5_raw = chan5_raw;
  431. packet.chan6_raw = chan6_raw;
  432. packet.chan7_raw = chan7_raw;
  433. packet.chan8_raw = chan8_raw;
  434. packet.target_system = target_system;
  435. packet.target_component = target_component;
  436. packet.chan9_raw = chan9_raw;
  437. packet.chan10_raw = chan10_raw;
  438. packet.chan11_raw = chan11_raw;
  439. packet.chan12_raw = chan12_raw;
  440. packet.chan13_raw = chan13_raw;
  441. packet.chan14_raw = chan14_raw;
  442. packet.chan15_raw = chan15_raw;
  443. packet.chan16_raw = chan16_raw;
  444. packet.chan17_raw = chan17_raw;
  445. packet.chan18_raw = chan18_raw;
  446. _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);
  447. #endif
  448. }
  449. /**
  450. * @brief Send a rc_channels_override message
  451. * @param chan MAVLink channel to send the message
  452. * @param struct The MAVLink struct to serialize
  453. */
  454. static inline void mavlink_msg_rc_channels_override_send_struct(mavlink_channel_t chan, const mavlink_rc_channels_override_t* rc_channels_override)
  455. {
  456. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  457. 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);
  458. #else
  459. _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);
  460. #endif
  461. }
  462. #if MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  463. /*
  464. This variant of _send() can be used to save stack space by re-using
  465. memory from the receive buffer. The caller provides a
  466. mavlink_message_t which is the size of a full mavlink message. This
  467. is usually the receive buffer for the channel, and allows a reply to an
  468. incoming message with minimum stack space usage.
  469. */
  470. 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)
  471. {
  472. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  473. char *buf = (char *)msgbuf;
  474. _mav_put_uint16_t(buf, 0, chan1_raw);
  475. _mav_put_uint16_t(buf, 2, chan2_raw);
  476. _mav_put_uint16_t(buf, 4, chan3_raw);
  477. _mav_put_uint16_t(buf, 6, chan4_raw);
  478. _mav_put_uint16_t(buf, 8, chan5_raw);
  479. _mav_put_uint16_t(buf, 10, chan6_raw);
  480. _mav_put_uint16_t(buf, 12, chan7_raw);
  481. _mav_put_uint16_t(buf, 14, chan8_raw);
  482. _mav_put_uint8_t(buf, 16, target_system);
  483. _mav_put_uint8_t(buf, 17, target_component);
  484. _mav_put_uint16_t(buf, 18, chan9_raw);
  485. _mav_put_uint16_t(buf, 20, chan10_raw);
  486. _mav_put_uint16_t(buf, 22, chan11_raw);
  487. _mav_put_uint16_t(buf, 24, chan12_raw);
  488. _mav_put_uint16_t(buf, 26, chan13_raw);
  489. _mav_put_uint16_t(buf, 28, chan14_raw);
  490. _mav_put_uint16_t(buf, 30, chan15_raw);
  491. _mav_put_uint16_t(buf, 32, chan16_raw);
  492. _mav_put_uint16_t(buf, 34, chan17_raw);
  493. _mav_put_uint16_t(buf, 36, chan18_raw);
  494. _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);
  495. #else
  496. mavlink_rc_channels_override_t *packet = (mavlink_rc_channels_override_t *)msgbuf;
  497. packet->chan1_raw = chan1_raw;
  498. packet->chan2_raw = chan2_raw;
  499. packet->chan3_raw = chan3_raw;
  500. packet->chan4_raw = chan4_raw;
  501. packet->chan5_raw = chan5_raw;
  502. packet->chan6_raw = chan6_raw;
  503. packet->chan7_raw = chan7_raw;
  504. packet->chan8_raw = chan8_raw;
  505. packet->target_system = target_system;
  506. packet->target_component = target_component;
  507. packet->chan9_raw = chan9_raw;
  508. packet->chan10_raw = chan10_raw;
  509. packet->chan11_raw = chan11_raw;
  510. packet->chan12_raw = chan12_raw;
  511. packet->chan13_raw = chan13_raw;
  512. packet->chan14_raw = chan14_raw;
  513. packet->chan15_raw = chan15_raw;
  514. packet->chan16_raw = chan16_raw;
  515. packet->chan17_raw = chan17_raw;
  516. packet->chan18_raw = chan18_raw;
  517. _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);
  518. #endif
  519. }
  520. #endif
  521. #endif
  522. // MESSAGE RC_CHANNELS_OVERRIDE UNPACKING
  523. /**
  524. * @brief Get field target_system from rc_channels_override message
  525. *
  526. * @return System ID
  527. */
  528. static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const mavlink_message_t* msg)
  529. {
  530. return _MAV_RETURN_uint8_t(msg, 16);
  531. }
  532. /**
  533. * @brief Get field target_component from rc_channels_override message
  534. *
  535. * @return Component ID
  536. */
  537. static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(const mavlink_message_t* msg)
  538. {
  539. return _MAV_RETURN_uint8_t(msg, 17);
  540. }
  541. /**
  542. * @brief Get field chan1_raw from rc_channels_override message
  543. *
  544. * @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.
  545. */
  546. static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavlink_message_t* msg)
  547. {
  548. return _MAV_RETURN_uint16_t(msg, 0);
  549. }
  550. /**
  551. * @brief Get field chan2_raw from rc_channels_override message
  552. *
  553. * @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.
  554. */
  555. static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavlink_message_t* msg)
  556. {
  557. return _MAV_RETURN_uint16_t(msg, 2);
  558. }
  559. /**
  560. * @brief Get field chan3_raw from rc_channels_override message
  561. *
  562. * @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.
  563. */
  564. static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavlink_message_t* msg)
  565. {
  566. return _MAV_RETURN_uint16_t(msg, 4);
  567. }
  568. /**
  569. * @brief Get field chan4_raw from rc_channels_override message
  570. *
  571. * @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.
  572. */
  573. static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavlink_message_t* msg)
  574. {
  575. return _MAV_RETURN_uint16_t(msg, 6);
  576. }
  577. /**
  578. * @brief Get field chan5_raw from rc_channels_override message
  579. *
  580. * @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.
  581. */
  582. static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavlink_message_t* msg)
  583. {
  584. return _MAV_RETURN_uint16_t(msg, 8);
  585. }
  586. /**
  587. * @brief Get field chan6_raw from rc_channels_override message
  588. *
  589. * @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.
  590. */
  591. static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavlink_message_t* msg)
  592. {
  593. return _MAV_RETURN_uint16_t(msg, 10);
  594. }
  595. /**
  596. * @brief Get field chan7_raw from rc_channels_override message
  597. *
  598. * @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.
  599. */
  600. static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavlink_message_t* msg)
  601. {
  602. return _MAV_RETURN_uint16_t(msg, 12);
  603. }
  604. /**
  605. * @brief Get field chan8_raw from rc_channels_override message
  606. *
  607. * @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.
  608. */
  609. static inline uint16_t mavlink_msg_rc_channels_override_get_chan8_raw(const mavlink_message_t* msg)
  610. {
  611. return _MAV_RETURN_uint16_t(msg, 14);
  612. }
  613. /**
  614. * @brief Get field chan9_raw from rc_channels_override message
  615. *
  616. * @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.
  617. */
  618. static inline uint16_t mavlink_msg_rc_channels_override_get_chan9_raw(const mavlink_message_t* msg)
  619. {
  620. return _MAV_RETURN_uint16_t(msg, 18);
  621. }
  622. /**
  623. * @brief Get field chan10_raw from rc_channels_override message
  624. *
  625. * @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.
  626. */
  627. static inline uint16_t mavlink_msg_rc_channels_override_get_chan10_raw(const mavlink_message_t* msg)
  628. {
  629. return _MAV_RETURN_uint16_t(msg, 20);
  630. }
  631. /**
  632. * @brief Get field chan11_raw from rc_channels_override message
  633. *
  634. * @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.
  635. */
  636. static inline uint16_t mavlink_msg_rc_channels_override_get_chan11_raw(const mavlink_message_t* msg)
  637. {
  638. return _MAV_RETURN_uint16_t(msg, 22);
  639. }
  640. /**
  641. * @brief Get field chan12_raw from rc_channels_override message
  642. *
  643. * @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.
  644. */
  645. static inline uint16_t mavlink_msg_rc_channels_override_get_chan12_raw(const mavlink_message_t* msg)
  646. {
  647. return _MAV_RETURN_uint16_t(msg, 24);
  648. }
  649. /**
  650. * @brief Get field chan13_raw from rc_channels_override message
  651. *
  652. * @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.
  653. */
  654. static inline uint16_t mavlink_msg_rc_channels_override_get_chan13_raw(const mavlink_message_t* msg)
  655. {
  656. return _MAV_RETURN_uint16_t(msg, 26);
  657. }
  658. /**
  659. * @brief Get field chan14_raw from rc_channels_override message
  660. *
  661. * @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.
  662. */
  663. static inline uint16_t mavlink_msg_rc_channels_override_get_chan14_raw(const mavlink_message_t* msg)
  664. {
  665. return _MAV_RETURN_uint16_t(msg, 28);
  666. }
  667. /**
  668. * @brief Get field chan15_raw from rc_channels_override message
  669. *
  670. * @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.
  671. */
  672. static inline uint16_t mavlink_msg_rc_channels_override_get_chan15_raw(const mavlink_message_t* msg)
  673. {
  674. return _MAV_RETURN_uint16_t(msg, 30);
  675. }
  676. /**
  677. * @brief Get field chan16_raw from rc_channels_override message
  678. *
  679. * @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.
  680. */
  681. static inline uint16_t mavlink_msg_rc_channels_override_get_chan16_raw(const mavlink_message_t* msg)
  682. {
  683. return _MAV_RETURN_uint16_t(msg, 32);
  684. }
  685. /**
  686. * @brief Get field chan17_raw from rc_channels_override message
  687. *
  688. * @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.
  689. */
  690. static inline uint16_t mavlink_msg_rc_channels_override_get_chan17_raw(const mavlink_message_t* msg)
  691. {
  692. return _MAV_RETURN_uint16_t(msg, 34);
  693. }
  694. /**
  695. * @brief Get field chan18_raw from rc_channels_override message
  696. *
  697. * @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.
  698. */
  699. static inline uint16_t mavlink_msg_rc_channels_override_get_chan18_raw(const mavlink_message_t* msg)
  700. {
  701. return _MAV_RETURN_uint16_t(msg, 36);
  702. }
  703. /**
  704. * @brief Decode a rc_channels_override message into a struct
  705. *
  706. * @param msg The message to decode
  707. * @param rc_channels_override C-struct to decode the message contents into
  708. */
  709. static inline void mavlink_msg_rc_channels_override_decode(const mavlink_message_t* msg, mavlink_rc_channels_override_t* rc_channels_override)
  710. {
  711. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  712. rc_channels_override->chan1_raw = mavlink_msg_rc_channels_override_get_chan1_raw(msg);
  713. rc_channels_override->chan2_raw = mavlink_msg_rc_channels_override_get_chan2_raw(msg);
  714. rc_channels_override->chan3_raw = mavlink_msg_rc_channels_override_get_chan3_raw(msg);
  715. rc_channels_override->chan4_raw = mavlink_msg_rc_channels_override_get_chan4_raw(msg);
  716. rc_channels_override->chan5_raw = mavlink_msg_rc_channels_override_get_chan5_raw(msg);
  717. rc_channels_override->chan6_raw = mavlink_msg_rc_channels_override_get_chan6_raw(msg);
  718. rc_channels_override->chan7_raw = mavlink_msg_rc_channels_override_get_chan7_raw(msg);
  719. rc_channels_override->chan8_raw = mavlink_msg_rc_channels_override_get_chan8_raw(msg);
  720. rc_channels_override->target_system = mavlink_msg_rc_channels_override_get_target_system(msg);
  721. rc_channels_override->target_component = mavlink_msg_rc_channels_override_get_target_component(msg);
  722. rc_channels_override->chan9_raw = mavlink_msg_rc_channels_override_get_chan9_raw(msg);
  723. rc_channels_override->chan10_raw = mavlink_msg_rc_channels_override_get_chan10_raw(msg);
  724. rc_channels_override->chan11_raw = mavlink_msg_rc_channels_override_get_chan11_raw(msg);
  725. rc_channels_override->chan12_raw = mavlink_msg_rc_channels_override_get_chan12_raw(msg);
  726. rc_channels_override->chan13_raw = mavlink_msg_rc_channels_override_get_chan13_raw(msg);
  727. rc_channels_override->chan14_raw = mavlink_msg_rc_channels_override_get_chan14_raw(msg);
  728. rc_channels_override->chan15_raw = mavlink_msg_rc_channels_override_get_chan15_raw(msg);
  729. rc_channels_override->chan16_raw = mavlink_msg_rc_channels_override_get_chan16_raw(msg);
  730. rc_channels_override->chan17_raw = mavlink_msg_rc_channels_override_get_chan17_raw(msg);
  731. rc_channels_override->chan18_raw = mavlink_msg_rc_channels_override_get_chan18_raw(msg);
  732. #else
  733. uint8_t len = msg->len < MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN? msg->len : MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN;
  734. memset(rc_channels_override, 0, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
  735. memcpy(rc_channels_override, _MAV_PAYLOAD(msg), len);
  736. #endif
  737. }