mavlink_message_boot.h 736 Bytes
Newer Older
pixhawk's avatar
pixhawk committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
// MESSAGE BOOT PACKING

#define MESSAGE_ID_BOOT 1

/**
 * @brief Send a boot message
 *
 * @param version The onboard software version
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t message_boot_pack(uint8_t system_id, CommMessage_t* msg, uint32 version)
{
	msg->msgid = MESSAGE_ID_BOOT;
	uint16_t i = 0;

	i += put_uint32_by_index(version, i, msg->payload); //The onboard software version

	return finalize_message(msg, system_id, i);
}

// MESSAGE BOOT UNPACKING

/**
 * @brief Get field version from boot message
 *
 * @return The onboard software version
 */
static inline uint32 message_boot_get_version(CommMessage_t* msg)
{
	return *((uint32*) (void*)msg->payload);
}