mavlink_msg_heartbeat.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396
  1. #pragma once
  2. // MESSAGE HEARTBEAT PACKING
  3. #define MAVLINK_MSG_ID_HEARTBEAT 0
  4. typedef struct __mavlink_heartbeat_t {
  5. uint32_t custom_mode; /*< A bitfield for use for autopilot-specific flags*/
  6. uint8_t type; /*< Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type.*/
  7. uint8_t autopilot; /*< Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.*/
  8. uint8_t base_mode; /*< System mode bitmap.*/
  9. uint8_t system_status; /*< System status flag.*/
  10. uint8_t mavlink_version; /*< MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version*/
  11. } mavlink_heartbeat_t;
  12. #define MAVLINK_MSG_ID_HEARTBEAT_LEN 9
  13. #define MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN 9
  14. #define MAVLINK_MSG_ID_0_LEN 9
  15. #define MAVLINK_MSG_ID_0_MIN_LEN 9
  16. #define MAVLINK_MSG_ID_HEARTBEAT_CRC 50
  17. #define MAVLINK_MSG_ID_0_CRC 50
  18. #if MAVLINK_COMMAND_24BIT
  19. #define MAVLINK_MESSAGE_INFO_HEARTBEAT { \
  20. 0, \
  21. "HEARTBEAT", \
  22. 6, \
  23. { { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \
  24. { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \
  25. { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \
  26. { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \
  27. { "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \
  28. { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \
  29. } \
  30. }
  31. #else
  32. #define MAVLINK_MESSAGE_INFO_HEARTBEAT { \
  33. "HEARTBEAT", \
  34. 6, \
  35. { { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_heartbeat_t, type) }, \
  36. { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_heartbeat_t, autopilot) }, \
  37. { "base_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_heartbeat_t, base_mode) }, \
  38. { "custom_mode", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_heartbeat_t, custom_mode) }, \
  39. { "system_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_heartbeat_t, system_status) }, \
  40. { "mavlink_version", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_heartbeat_t, mavlink_version) }, \
  41. } \
  42. }
  43. #endif
  44. /**
  45. * @brief Pack a heartbeat message
  46. * @param system_id ID of this system
  47. * @param component_id ID of this component (e.g. 200 for IMU)
  48. * @param msg The MAVLink message to compress the data into
  49. *
  50. * @param type Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type.
  51. * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
  52. * @param base_mode System mode bitmap.
  53. * @param custom_mode A bitfield for use for autopilot-specific flags
  54. * @param system_status System status flag.
  55. * @return length of the message in bytes (excluding serial stream start sign)
  56. */
  57. static inline uint16_t mavlink_msg_heartbeat_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  58. uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
  59. {
  60. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  61. char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
  62. _mav_put_uint32_t(buf, 0, custom_mode);
  63. _mav_put_uint8_t(buf, 4, type);
  64. _mav_put_uint8_t(buf, 5, autopilot);
  65. _mav_put_uint8_t(buf, 6, base_mode);
  66. _mav_put_uint8_t(buf, 7, system_status);
  67. _mav_put_uint8_t(buf, 8, 3);
  68. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN);
  69. #else
  70. mavlink_heartbeat_t packet;
  71. packet.custom_mode = custom_mode;
  72. packet.type = type;
  73. packet.autopilot = autopilot;
  74. packet.base_mode = base_mode;
  75. packet.system_status = system_status;
  76. packet.mavlink_version = 3;
  77. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN);
  78. #endif
  79. msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
  80. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
  81. }
  82. /**
  83. * @brief Pack a heartbeat message
  84. * @param system_id ID of this system
  85. * @param component_id ID of this component (e.g. 200 for IMU)
  86. * @param status MAVLink status structure
  87. * @param msg The MAVLink message to compress the data into
  88. *
  89. * @param type Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type.
  90. * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
  91. * @param base_mode System mode bitmap.
  92. * @param custom_mode A bitfield for use for autopilot-specific flags
  93. * @param system_status System status flag.
  94. * @return length of the message in bytes (excluding serial stream start sign)
  95. */
  96. static inline uint16_t mavlink_msg_heartbeat_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  97. uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
  98. {
  99. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  100. char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
  101. _mav_put_uint32_t(buf, 0, custom_mode);
  102. _mav_put_uint8_t(buf, 4, type);
  103. _mav_put_uint8_t(buf, 5, autopilot);
  104. _mav_put_uint8_t(buf, 6, base_mode);
  105. _mav_put_uint8_t(buf, 7, system_status);
  106. _mav_put_uint8_t(buf, 8, 3);
  107. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN);
  108. #else
  109. mavlink_heartbeat_t packet;
  110. packet.custom_mode = custom_mode;
  111. packet.type = type;
  112. packet.autopilot = autopilot;
  113. packet.base_mode = base_mode;
  114. packet.system_status = system_status;
  115. packet.mavlink_version = 3;
  116. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN);
  117. #endif
  118. msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
  119. #if MAVLINK_CRC_EXTRA
  120. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
  121. #else
  122. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN);
  123. #endif
  124. }
  125. /**
  126. * @brief Pack a heartbeat message on a channel
  127. * @param system_id ID of this system
  128. * @param component_id ID of this component (e.g. 200 for IMU)
  129. * @param chan The MAVLink channel this message will be sent over
  130. * @param msg The MAVLink message to compress the data into
  131. * @param type Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type.
  132. * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
  133. * @param base_mode System mode bitmap.
  134. * @param custom_mode A bitfield for use for autopilot-specific flags
  135. * @param system_status System status flag.
  136. * @return length of the message in bytes (excluding serial stream start sign)
  137. */
  138. static inline uint16_t mavlink_msg_heartbeat_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  139. mavlink_message_t* msg,
  140. uint8_t type,uint8_t autopilot,uint8_t base_mode,uint32_t custom_mode,uint8_t system_status)
  141. {
  142. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  143. char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
  144. _mav_put_uint32_t(buf, 0, custom_mode);
  145. _mav_put_uint8_t(buf, 4, type);
  146. _mav_put_uint8_t(buf, 5, autopilot);
  147. _mav_put_uint8_t(buf, 6, base_mode);
  148. _mav_put_uint8_t(buf, 7, system_status);
  149. _mav_put_uint8_t(buf, 8, 3);
  150. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HEARTBEAT_LEN);
  151. #else
  152. mavlink_heartbeat_t packet;
  153. packet.custom_mode = custom_mode;
  154. packet.type = type;
  155. packet.autopilot = autopilot;
  156. packet.base_mode = base_mode;
  157. packet.system_status = system_status;
  158. packet.mavlink_version = 3;
  159. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HEARTBEAT_LEN);
  160. #endif
  161. msg->msgid = MAVLINK_MSG_ID_HEARTBEAT;
  162. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
  163. }
  164. /**
  165. * @brief Encode a heartbeat struct
  166. *
  167. * @param system_id ID of this system
  168. * @param component_id ID of this component (e.g. 200 for IMU)
  169. * @param msg The MAVLink message to compress the data into
  170. * @param heartbeat C-struct to read the message contents from
  171. */
  172. static inline uint16_t mavlink_msg_heartbeat_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
  173. {
  174. return mavlink_msg_heartbeat_pack(system_id, component_id, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
  175. }
  176. /**
  177. * @brief Encode a heartbeat struct on a channel
  178. *
  179. * @param system_id ID of this system
  180. * @param component_id ID of this component (e.g. 200 for IMU)
  181. * @param chan The MAVLink channel this message will be sent over
  182. * @param msg The MAVLink message to compress the data into
  183. * @param heartbeat C-struct to read the message contents from
  184. */
  185. static inline uint16_t mavlink_msg_heartbeat_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
  186. {
  187. return mavlink_msg_heartbeat_pack_chan(system_id, component_id, chan, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
  188. }
  189. /**
  190. * @brief Encode a heartbeat struct with provided status structure
  191. *
  192. * @param system_id ID of this system
  193. * @param component_id ID of this component (e.g. 200 for IMU)
  194. * @param status MAVLink status structure
  195. * @param msg The MAVLink message to compress the data into
  196. * @param heartbeat C-struct to read the message contents from
  197. */
  198. static inline uint16_t mavlink_msg_heartbeat_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_heartbeat_t* heartbeat)
  199. {
  200. return mavlink_msg_heartbeat_pack_status(system_id, component_id, _status, msg, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
  201. }
  202. /**
  203. * @brief Send a heartbeat message
  204. * @param chan MAVLink channel to send the message
  205. *
  206. * @param type Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type.
  207. * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
  208. * @param base_mode System mode bitmap.
  209. * @param custom_mode A bitfield for use for autopilot-specific flags
  210. * @param system_status System status flag.
  211. */
  212. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  213. static inline void mavlink_msg_heartbeat_send(mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
  214. {
  215. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  216. char buf[MAVLINK_MSG_ID_HEARTBEAT_LEN];
  217. _mav_put_uint32_t(buf, 0, custom_mode);
  218. _mav_put_uint8_t(buf, 4, type);
  219. _mav_put_uint8_t(buf, 5, autopilot);
  220. _mav_put_uint8_t(buf, 6, base_mode);
  221. _mav_put_uint8_t(buf, 7, system_status);
  222. _mav_put_uint8_t(buf, 8, 3);
  223. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
  224. #else
  225. mavlink_heartbeat_t packet;
  226. packet.custom_mode = custom_mode;
  227. packet.type = type;
  228. packet.autopilot = autopilot;
  229. packet.base_mode = base_mode;
  230. packet.system_status = system_status;
  231. packet.mavlink_version = 3;
  232. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)&packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
  233. #endif
  234. }
  235. /**
  236. * @brief Send a heartbeat message
  237. * @param chan MAVLink channel to send the message
  238. * @param struct The MAVLink struct to serialize
  239. */
  240. static inline void mavlink_msg_heartbeat_send_struct(mavlink_channel_t chan, const mavlink_heartbeat_t* heartbeat)
  241. {
  242. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  243. mavlink_msg_heartbeat_send(chan, heartbeat->type, heartbeat->autopilot, heartbeat->base_mode, heartbeat->custom_mode, heartbeat->system_status);
  244. #else
  245. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)heartbeat, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
  246. #endif
  247. }
  248. #if MAVLINK_MSG_ID_HEARTBEAT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  249. /*
  250. This variant of _send() can be used to save stack space by re-using
  251. memory from the receive buffer. The caller provides a
  252. mavlink_message_t which is the size of a full mavlink message. This
  253. is usually the receive buffer for the channel, and allows a reply to an
  254. incoming message with minimum stack space usage.
  255. */
  256. static inline void mavlink_msg_heartbeat_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t type, uint8_t autopilot, uint8_t base_mode, uint32_t custom_mode, uint8_t system_status)
  257. {
  258. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  259. char *buf = (char *)msgbuf;
  260. _mav_put_uint32_t(buf, 0, custom_mode);
  261. _mav_put_uint8_t(buf, 4, type);
  262. _mav_put_uint8_t(buf, 5, autopilot);
  263. _mav_put_uint8_t(buf, 6, base_mode);
  264. _mav_put_uint8_t(buf, 7, system_status);
  265. _mav_put_uint8_t(buf, 8, 3);
  266. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, buf, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
  267. #else
  268. mavlink_heartbeat_t *packet = (mavlink_heartbeat_t *)msgbuf;
  269. packet->custom_mode = custom_mode;
  270. packet->type = type;
  271. packet->autopilot = autopilot;
  272. packet->base_mode = base_mode;
  273. packet->system_status = system_status;
  274. packet->mavlink_version = 3;
  275. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HEARTBEAT, (const char *)packet, MAVLINK_MSG_ID_HEARTBEAT_MIN_LEN, MAVLINK_MSG_ID_HEARTBEAT_LEN, MAVLINK_MSG_ID_HEARTBEAT_CRC);
  276. #endif
  277. }
  278. #endif
  279. #endif
  280. // MESSAGE HEARTBEAT UNPACKING
  281. /**
  282. * @brief Get field type from heartbeat message
  283. *
  284. * @return Vehicle or component type. For a flight controller component the vehicle type (quadrotor, helicopter, etc.). For other components the component type (e.g. camera, gimbal, etc.). This should be used in preference to component id for identifying the component type.
  285. */
  286. static inline uint8_t mavlink_msg_heartbeat_get_type(const mavlink_message_t* msg)
  287. {
  288. return _MAV_RETURN_uint8_t(msg, 4);
  289. }
  290. /**
  291. * @brief Get field autopilot from heartbeat message
  292. *
  293. * @return Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
  294. */
  295. static inline uint8_t mavlink_msg_heartbeat_get_autopilot(const mavlink_message_t* msg)
  296. {
  297. return _MAV_RETURN_uint8_t(msg, 5);
  298. }
  299. /**
  300. * @brief Get field base_mode from heartbeat message
  301. *
  302. * @return System mode bitmap.
  303. */
  304. static inline uint8_t mavlink_msg_heartbeat_get_base_mode(const mavlink_message_t* msg)
  305. {
  306. return _MAV_RETURN_uint8_t(msg, 6);
  307. }
  308. /**
  309. * @brief Get field custom_mode from heartbeat message
  310. *
  311. * @return A bitfield for use for autopilot-specific flags
  312. */
  313. static inline uint32_t mavlink_msg_heartbeat_get_custom_mode(const mavlink_message_t* msg)
  314. {
  315. return _MAV_RETURN_uint32_t(msg, 0);
  316. }
  317. /**
  318. * @brief Get field system_status from heartbeat message
  319. *
  320. * @return System status flag.
  321. */
  322. static inline uint8_t mavlink_msg_heartbeat_get_system_status(const mavlink_message_t* msg)
  323. {
  324. return _MAV_RETURN_uint8_t(msg, 7);
  325. }
  326. /**
  327. * @brief Get field mavlink_version from heartbeat message
  328. *
  329. * @return MAVLink version, not writable by user, gets added by protocol because of magic data type: uint8_t_mavlink_version
  330. */
  331. static inline uint8_t mavlink_msg_heartbeat_get_mavlink_version(const mavlink_message_t* msg)
  332. {
  333. return _MAV_RETURN_uint8_t(msg, 8);
  334. }
  335. /**
  336. * @brief Decode a heartbeat message into a struct
  337. *
  338. * @param msg The message to decode
  339. * @param heartbeat C-struct to decode the message contents into
  340. */
  341. static inline void mavlink_msg_heartbeat_decode(const mavlink_message_t* msg, mavlink_heartbeat_t* heartbeat)
  342. {
  343. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  344. heartbeat->custom_mode = mavlink_msg_heartbeat_get_custom_mode(msg);
  345. heartbeat->type = mavlink_msg_heartbeat_get_type(msg);
  346. heartbeat->autopilot = mavlink_msg_heartbeat_get_autopilot(msg);
  347. heartbeat->base_mode = mavlink_msg_heartbeat_get_base_mode(msg);
  348. heartbeat->system_status = mavlink_msg_heartbeat_get_system_status(msg);
  349. heartbeat->mavlink_version = mavlink_msg_heartbeat_get_mavlink_version(msg);
  350. #else
  351. uint8_t len = msg->len < MAVLINK_MSG_ID_HEARTBEAT_LEN? msg->len : MAVLINK_MSG_ID_HEARTBEAT_LEN;
  352. memset(heartbeat, 0, MAVLINK_MSG_ID_HEARTBEAT_LEN);
  353. memcpy(heartbeat, _MAV_PAYLOAD(msg), len);
  354. #endif
  355. }