#pragma once // MESSAGE TUB_LND PACKING #define MAVLINK_MSG_ID_TUB_LND 20105 typedef struct __mavlink_tub_lnd_t { uint32_t time_boot_ms; /*< [ms] Timestamp (milliseconds since system boot)*/ uint8_t tub_in_seq; /*< TUB input index*/ uint8_t lnd_in_seq; /*< LND input index*/ uint8_t WOW; /*< WOW*/ uint8_t DOOR; /*< DOOR*/ uint8_t pres; /*< pressure*/ uint8_t throttle; /*< throttle*/ uint8_t brake_left; /*< left brake*/ uint8_t brake_right; /*< right brake*/ int8_t steer; /*< steer(deg)*/ } mavlink_tub_lnd_t; #define MAVLINK_MSG_ID_TUB_LND_LEN 13 #define MAVLINK_MSG_ID_TUB_LND_MIN_LEN 13 #define MAVLINK_MSG_ID_20105_LEN 13 #define MAVLINK_MSG_ID_20105_MIN_LEN 13 #define MAVLINK_MSG_ID_TUB_LND_CRC 92 #define MAVLINK_MSG_ID_20105_CRC 92 #if MAVLINK_COMMAND_24BIT #define MAVLINK_MESSAGE_INFO_TUB_LND { \ 20105, \ "TUB_LND", \ 10, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_tub_lnd_t, time_boot_ms) }, \ { "tub_in_seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_tub_lnd_t, tub_in_seq) }, \ { "lnd_in_seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_tub_lnd_t, lnd_in_seq) }, \ { "WOW", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_tub_lnd_t, WOW) }, \ { "DOOR", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_tub_lnd_t, DOOR) }, \ { "pres", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_tub_lnd_t, pres) }, \ { "throttle", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_tub_lnd_t, throttle) }, \ { "brake_left", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_tub_lnd_t, brake_left) }, \ { "brake_right", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_tub_lnd_t, brake_right) }, \ { "steer", NULL, MAVLINK_TYPE_INT8_T, 0, 12, offsetof(mavlink_tub_lnd_t, steer) }, \ } \ } #else #define MAVLINK_MESSAGE_INFO_TUB_LND { \ "TUB_LND", \ 10, \ { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_tub_lnd_t, time_boot_ms) }, \ { "tub_in_seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_tub_lnd_t, tub_in_seq) }, \ { "lnd_in_seq", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_tub_lnd_t, lnd_in_seq) }, \ { "WOW", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_tub_lnd_t, WOW) }, \ { "DOOR", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_tub_lnd_t, DOOR) }, \ { "pres", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_tub_lnd_t, pres) }, \ { "throttle", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_tub_lnd_t, throttle) }, \ { "brake_left", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_tub_lnd_t, brake_left) }, \ { "brake_right", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_tub_lnd_t, brake_right) }, \ { "steer", NULL, MAVLINK_TYPE_INT8_T, 0, 12, offsetof(mavlink_tub_lnd_t, steer) }, \ } \ } #endif /** * @brief Pack a tub_lnd message * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * * @param time_boot_ms [ms] Timestamp (milliseconds since system boot) * @param tub_in_seq TUB input index * @param lnd_in_seq LND input index * @param WOW WOW * @param DOOR DOOR * @param pres pressure * @param throttle throttle * @param brake_left left brake * @param brake_right right brake * @param steer steer(deg) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_tub_lnd_pack(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, uint32_t time_boot_ms, uint8_t tub_in_seq, uint8_t lnd_in_seq, uint8_t WOW, uint8_t DOOR, uint8_t pres, uint8_t throttle, uint8_t brake_left, uint8_t brake_right, int8_t steer) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_TUB_LND_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_uint8_t(buf, 4, tub_in_seq); _mav_put_uint8_t(buf, 5, lnd_in_seq); _mav_put_uint8_t(buf, 6, WOW); _mav_put_uint8_t(buf, 7, DOOR); _mav_put_uint8_t(buf, 8, pres); _mav_put_uint8_t(buf, 9, throttle); _mav_put_uint8_t(buf, 10, brake_left); _mav_put_uint8_t(buf, 11, brake_right); _mav_put_int8_t(buf, 12, steer); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TUB_LND_LEN); #else mavlink_tub_lnd_t packet; packet.time_boot_ms = time_boot_ms; packet.tub_in_seq = tub_in_seq; packet.lnd_in_seq = lnd_in_seq; packet.WOW = WOW; packet.DOOR = DOOR; packet.pres = pres; packet.throttle = throttle; packet.brake_left = brake_left; packet.brake_right = brake_right; packet.steer = steer; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TUB_LND_LEN); #endif msg->msgid = MAVLINK_MSG_ID_TUB_LND; return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TUB_LND_MIN_LEN, MAVLINK_MSG_ID_TUB_LND_LEN, MAVLINK_MSG_ID_TUB_LND_CRC); } /** * @brief Pack a tub_lnd message on a channel * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into * @param time_boot_ms [ms] Timestamp (milliseconds since system boot) * @param tub_in_seq TUB input index * @param lnd_in_seq LND input index * @param WOW WOW * @param DOOR DOOR * @param pres pressure * @param throttle throttle * @param brake_left left brake * @param brake_right right brake * @param steer steer(deg) * @return length of the message in bytes (excluding serial stream start sign) */ static inline uint16_t mavlink_msg_tub_lnd_pack_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint32_t time_boot_ms,uint8_t tub_in_seq,uint8_t lnd_in_seq,uint8_t WOW,uint8_t DOOR,uint8_t pres,uint8_t throttle,uint8_t brake_left,uint8_t brake_right,int8_t steer) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_TUB_LND_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_uint8_t(buf, 4, tub_in_seq); _mav_put_uint8_t(buf, 5, lnd_in_seq); _mav_put_uint8_t(buf, 6, WOW); _mav_put_uint8_t(buf, 7, DOOR); _mav_put_uint8_t(buf, 8, pres); _mav_put_uint8_t(buf, 9, throttle); _mav_put_uint8_t(buf, 10, brake_left); _mav_put_uint8_t(buf, 11, brake_right); _mav_put_int8_t(buf, 12, steer); memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TUB_LND_LEN); #else mavlink_tub_lnd_t packet; packet.time_boot_ms = time_boot_ms; packet.tub_in_seq = tub_in_seq; packet.lnd_in_seq = lnd_in_seq; packet.WOW = WOW; packet.DOOR = DOOR; packet.pres = pres; packet.throttle = throttle; packet.brake_left = brake_left; packet.brake_right = brake_right; packet.steer = steer; memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TUB_LND_LEN); #endif msg->msgid = MAVLINK_MSG_ID_TUB_LND; return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TUB_LND_MIN_LEN, MAVLINK_MSG_ID_TUB_LND_LEN, MAVLINK_MSG_ID_TUB_LND_CRC); } /** * @brief Encode a tub_lnd struct * * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param msg The MAVLink message to compress the data into * @param tub_lnd C-struct to read the message contents from */ static inline uint16_t mavlink_msg_tub_lnd_encode(uint16_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_tub_lnd_t* tub_lnd) { return mavlink_msg_tub_lnd_pack(system_id, component_id, msg, tub_lnd->time_boot_ms, tub_lnd->tub_in_seq, tub_lnd->lnd_in_seq, tub_lnd->WOW, tub_lnd->DOOR, tub_lnd->pres, tub_lnd->throttle, tub_lnd->brake_left, tub_lnd->brake_right, tub_lnd->steer); } /** * @brief Encode a tub_lnd struct on a channel * * @param system_id ID of this system * @param component_id ID of this component (e.g. 200 for IMU) * @param chan The MAVLink channel this message will be sent over * @param msg The MAVLink message to compress the data into * @param tub_lnd C-struct to read the message contents from */ static inline uint16_t mavlink_msg_tub_lnd_encode_chan(uint16_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_tub_lnd_t* tub_lnd) { return mavlink_msg_tub_lnd_pack_chan(system_id, component_id, chan, msg, tub_lnd->time_boot_ms, tub_lnd->tub_in_seq, tub_lnd->lnd_in_seq, tub_lnd->WOW, tub_lnd->DOOR, tub_lnd->pres, tub_lnd->throttle, tub_lnd->brake_left, tub_lnd->brake_right, tub_lnd->steer); } /** * @brief Send a tub_lnd message * @param chan MAVLink channel to send the message * * @param time_boot_ms [ms] Timestamp (milliseconds since system boot) * @param tub_in_seq TUB input index * @param lnd_in_seq LND input index * @param WOW WOW * @param DOOR DOOR * @param pres pressure * @param throttle throttle * @param brake_left left brake * @param brake_right right brake * @param steer steer(deg) */ #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS static inline void mavlink_msg_tub_lnd_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t tub_in_seq, uint8_t lnd_in_seq, uint8_t WOW, uint8_t DOOR, uint8_t pres, uint8_t throttle, uint8_t brake_left, uint8_t brake_right, int8_t steer) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char buf[MAVLINK_MSG_ID_TUB_LND_LEN]; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_uint8_t(buf, 4, tub_in_seq); _mav_put_uint8_t(buf, 5, lnd_in_seq); _mav_put_uint8_t(buf, 6, WOW); _mav_put_uint8_t(buf, 7, DOOR); _mav_put_uint8_t(buf, 8, pres); _mav_put_uint8_t(buf, 9, throttle); _mav_put_uint8_t(buf, 10, brake_left); _mav_put_uint8_t(buf, 11, brake_right); _mav_put_int8_t(buf, 12, steer); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TUB_LND, buf, MAVLINK_MSG_ID_TUB_LND_MIN_LEN, MAVLINK_MSG_ID_TUB_LND_LEN, MAVLINK_MSG_ID_TUB_LND_CRC); #else mavlink_tub_lnd_t packet; packet.time_boot_ms = time_boot_ms; packet.tub_in_seq = tub_in_seq; packet.lnd_in_seq = lnd_in_seq; packet.WOW = WOW; packet.DOOR = DOOR; packet.pres = pres; packet.throttle = throttle; packet.brake_left = brake_left; packet.brake_right = brake_right; packet.steer = steer; _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TUB_LND, (const char *)&packet, MAVLINK_MSG_ID_TUB_LND_MIN_LEN, MAVLINK_MSG_ID_TUB_LND_LEN, MAVLINK_MSG_ID_TUB_LND_CRC); #endif } /** * @brief Send a tub_lnd message * @param chan MAVLink channel to send the message * @param struct The MAVLink struct to serialize */ static inline void mavlink_msg_tub_lnd_send_struct(mavlink_channel_t chan, const mavlink_tub_lnd_t* tub_lnd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS mavlink_msg_tub_lnd_send(chan, tub_lnd->time_boot_ms, tub_lnd->tub_in_seq, tub_lnd->lnd_in_seq, tub_lnd->WOW, tub_lnd->DOOR, tub_lnd->pres, tub_lnd->throttle, tub_lnd->brake_left, tub_lnd->brake_right, tub_lnd->steer); #else _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TUB_LND, (const char *)tub_lnd, MAVLINK_MSG_ID_TUB_LND_MIN_LEN, MAVLINK_MSG_ID_TUB_LND_LEN, MAVLINK_MSG_ID_TUB_LND_CRC); #endif } #if MAVLINK_MSG_ID_TUB_LND_LEN <= MAVLINK_MAX_PAYLOAD_LEN /* This varient of _send() can be used to save stack space by re-using memory from the receive buffer. The caller provides a mavlink_message_t which is the size of a full mavlink message. This is usually the receive buffer for the channel, and allows a reply to an incoming message with minimum stack space usage. */ static inline void mavlink_msg_tub_lnd_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t tub_in_seq, uint8_t lnd_in_seq, uint8_t WOW, uint8_t DOOR, uint8_t pres, uint8_t throttle, uint8_t brake_left, uint8_t brake_right, int8_t steer) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS char *buf = (char *)msgbuf; _mav_put_uint32_t(buf, 0, time_boot_ms); _mav_put_uint8_t(buf, 4, tub_in_seq); _mav_put_uint8_t(buf, 5, lnd_in_seq); _mav_put_uint8_t(buf, 6, WOW); _mav_put_uint8_t(buf, 7, DOOR); _mav_put_uint8_t(buf, 8, pres); _mav_put_uint8_t(buf, 9, throttle); _mav_put_uint8_t(buf, 10, brake_left); _mav_put_uint8_t(buf, 11, brake_right); _mav_put_int8_t(buf, 12, steer); _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TUB_LND, buf, MAVLINK_MSG_ID_TUB_LND_MIN_LEN, MAVLINK_MSG_ID_TUB_LND_LEN, MAVLINK_MSG_ID_TUB_LND_CRC); #else mavlink_tub_lnd_t *packet = (mavlink_tub_lnd_t *)msgbuf; packet->time_boot_ms = time_boot_ms; packet->tub_in_seq = tub_in_seq; packet->lnd_in_seq = lnd_in_seq; packet->WOW = WOW; packet->DOOR = DOOR; packet->pres = pres; packet->throttle = throttle; packet->brake_left = brake_left; packet->brake_right = brake_right; packet->steer = steer; _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TUB_LND, (const char *)packet, MAVLINK_MSG_ID_TUB_LND_MIN_LEN, MAVLINK_MSG_ID_TUB_LND_LEN, MAVLINK_MSG_ID_TUB_LND_CRC); #endif } #endif #endif // MESSAGE TUB_LND UNPACKING /** * @brief Get field time_boot_ms from tub_lnd message * * @return [ms] Timestamp (milliseconds since system boot) */ static inline uint32_t mavlink_msg_tub_lnd_get_time_boot_ms(const mavlink_message_t* msg) { return _MAV_RETURN_uint32_t(msg, 0); } /** * @brief Get field tub_in_seq from tub_lnd message * * @return TUB input index */ static inline uint8_t mavlink_msg_tub_lnd_get_tub_in_seq(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 4); } /** * @brief Get field lnd_in_seq from tub_lnd message * * @return LND input index */ static inline uint8_t mavlink_msg_tub_lnd_get_lnd_in_seq(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 5); } /** * @brief Get field WOW from tub_lnd message * * @return WOW */ static inline uint8_t mavlink_msg_tub_lnd_get_WOW(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 6); } /** * @brief Get field DOOR from tub_lnd message * * @return DOOR */ static inline uint8_t mavlink_msg_tub_lnd_get_DOOR(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 7); } /** * @brief Get field pres from tub_lnd message * * @return pressure */ static inline uint8_t mavlink_msg_tub_lnd_get_pres(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 8); } /** * @brief Get field throttle from tub_lnd message * * @return throttle */ static inline uint8_t mavlink_msg_tub_lnd_get_throttle(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 9); } /** * @brief Get field brake_left from tub_lnd message * * @return left brake */ static inline uint8_t mavlink_msg_tub_lnd_get_brake_left(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 10); } /** * @brief Get field brake_right from tub_lnd message * * @return right brake */ static inline uint8_t mavlink_msg_tub_lnd_get_brake_right(const mavlink_message_t* msg) { return _MAV_RETURN_uint8_t(msg, 11); } /** * @brief Get field steer from tub_lnd message * * @return steer(deg) */ static inline int8_t mavlink_msg_tub_lnd_get_steer(const mavlink_message_t* msg) { return _MAV_RETURN_int8_t(msg, 12); } /** * @brief Decode a tub_lnd message into a struct * * @param msg The message to decode * @param tub_lnd C-struct to decode the message contents into */ static inline void mavlink_msg_tub_lnd_decode(const mavlink_message_t* msg, mavlink_tub_lnd_t* tub_lnd) { #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS tub_lnd->time_boot_ms = mavlink_msg_tub_lnd_get_time_boot_ms(msg); tub_lnd->tub_in_seq = mavlink_msg_tub_lnd_get_tub_in_seq(msg); tub_lnd->lnd_in_seq = mavlink_msg_tub_lnd_get_lnd_in_seq(msg); tub_lnd->WOW = mavlink_msg_tub_lnd_get_WOW(msg); tub_lnd->DOOR = mavlink_msg_tub_lnd_get_DOOR(msg); tub_lnd->pres = mavlink_msg_tub_lnd_get_pres(msg); tub_lnd->throttle = mavlink_msg_tub_lnd_get_throttle(msg); tub_lnd->brake_left = mavlink_msg_tub_lnd_get_brake_left(msg); tub_lnd->brake_right = mavlink_msg_tub_lnd_get_brake_right(msg); tub_lnd->steer = mavlink_msg_tub_lnd_get_steer(msg); #else uint8_t len = msg->len < MAVLINK_MSG_ID_TUB_LND_LEN? msg->len : MAVLINK_MSG_ID_TUB_LND_LEN; memset(tub_lnd, 0, MAVLINK_MSG_ID_TUB_LND_LEN); memcpy(tub_lnd, _MAV_PAYLOAD(msg), len); #endif }