Code for autonomous ground vehicle, Data Bus, 3rd place winner in 2012 Sparkfun AVC.
Dependencies: Watchdog mbed Schedule SimpleFilter LSM303DLM PinDetect DebounceIn Servo
MAVlink/include/pixhawk/mavlink_msg_point_of_interest_connection.h@0:826c6171fc1b, 2012-06-20 (annotated)
- Committer:
- shimniok
- Date:
- Wed Jun 20 14:57:48 2012 +0000
- Revision:
- 0:826c6171fc1b
Updated documentation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
shimniok | 0:826c6171fc1b | 1 | // MESSAGE POINT_OF_INTEREST_CONNECTION PACKING |
shimniok | 0:826c6171fc1b | 2 | |
shimniok | 0:826c6171fc1b | 3 | #define MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION 162 |
shimniok | 0:826c6171fc1b | 4 | |
shimniok | 0:826c6171fc1b | 5 | typedef struct __mavlink_point_of_interest_connection_t |
shimniok | 0:826c6171fc1b | 6 | { |
shimniok | 0:826c6171fc1b | 7 | uint8_t type; ///< 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug |
shimniok | 0:826c6171fc1b | 8 | uint8_t color; ///< 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta |
shimniok | 0:826c6171fc1b | 9 | uint8_t coordinate_system; ///< 0: global, 1:local |
shimniok | 0:826c6171fc1b | 10 | uint16_t timeout; ///< 0: no timeout, >1: timeout in seconds |
shimniok | 0:826c6171fc1b | 11 | float xp1; ///< X1 Position |
shimniok | 0:826c6171fc1b | 12 | float yp1; ///< Y1 Position |
shimniok | 0:826c6171fc1b | 13 | float zp1; ///< Z1 Position |
shimniok | 0:826c6171fc1b | 14 | float xp2; ///< X2 Position |
shimniok | 0:826c6171fc1b | 15 | float yp2; ///< Y2 Position |
shimniok | 0:826c6171fc1b | 16 | float zp2; ///< Z2 Position |
shimniok | 0:826c6171fc1b | 17 | int8_t name[25]; ///< POI connection name |
shimniok | 0:826c6171fc1b | 18 | |
shimniok | 0:826c6171fc1b | 19 | } mavlink_point_of_interest_connection_t; |
shimniok | 0:826c6171fc1b | 20 | |
shimniok | 0:826c6171fc1b | 21 | #define MAVLINK_MSG_POINT_OF_INTEREST_CONNECTION_FIELD_NAME_LEN 25 |
shimniok | 0:826c6171fc1b | 22 | |
shimniok | 0:826c6171fc1b | 23 | |
shimniok | 0:826c6171fc1b | 24 | /** |
shimniok | 0:826c6171fc1b | 25 | * @brief Pack a point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 26 | * @param system_id ID of this system |
shimniok | 0:826c6171fc1b | 27 | * @param component_id ID of this component (e.g. 200 for IMU) |
shimniok | 0:826c6171fc1b | 28 | * @param msg The MAVLink message to compress the data into |
shimniok | 0:826c6171fc1b | 29 | * |
shimniok | 0:826c6171fc1b | 30 | * @param type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug |
shimniok | 0:826c6171fc1b | 31 | * @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta |
shimniok | 0:826c6171fc1b | 32 | * @param coordinate_system 0: global, 1:local |
shimniok | 0:826c6171fc1b | 33 | * @param timeout 0: no timeout, >1: timeout in seconds |
shimniok | 0:826c6171fc1b | 34 | * @param xp1 X1 Position |
shimniok | 0:826c6171fc1b | 35 | * @param yp1 Y1 Position |
shimniok | 0:826c6171fc1b | 36 | * @param zp1 Z1 Position |
shimniok | 0:826c6171fc1b | 37 | * @param xp2 X2 Position |
shimniok | 0:826c6171fc1b | 38 | * @param yp2 Y2 Position |
shimniok | 0:826c6171fc1b | 39 | * @param zp2 Z2 Position |
shimniok | 0:826c6171fc1b | 40 | * @param name POI connection name |
shimniok | 0:826c6171fc1b | 41 | * @return length of the message in bytes (excluding serial stream start sign) |
shimniok | 0:826c6171fc1b | 42 | */ |
shimniok | 0:826c6171fc1b | 43 | static inline uint16_t mavlink_msg_point_of_interest_connection_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const int8_t* name) |
shimniok | 0:826c6171fc1b | 44 | { |
shimniok | 0:826c6171fc1b | 45 | uint16_t i = 0; |
shimniok | 0:826c6171fc1b | 46 | msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION; |
shimniok | 0:826c6171fc1b | 47 | |
shimniok | 0:826c6171fc1b | 48 | i += put_uint8_t_by_index(type, i, msg->payload); // 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug |
shimniok | 0:826c6171fc1b | 49 | i += put_uint8_t_by_index(color, i, msg->payload); // 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta |
shimniok | 0:826c6171fc1b | 50 | i += put_uint8_t_by_index(coordinate_system, i, msg->payload); // 0: global, 1:local |
shimniok | 0:826c6171fc1b | 51 | i += put_uint16_t_by_index(timeout, i, msg->payload); // 0: no timeout, >1: timeout in seconds |
shimniok | 0:826c6171fc1b | 52 | i += put_float_by_index(xp1, i, msg->payload); // X1 Position |
shimniok | 0:826c6171fc1b | 53 | i += put_float_by_index(yp1, i, msg->payload); // Y1 Position |
shimniok | 0:826c6171fc1b | 54 | i += put_float_by_index(zp1, i, msg->payload); // Z1 Position |
shimniok | 0:826c6171fc1b | 55 | i += put_float_by_index(xp2, i, msg->payload); // X2 Position |
shimniok | 0:826c6171fc1b | 56 | i += put_float_by_index(yp2, i, msg->payload); // Y2 Position |
shimniok | 0:826c6171fc1b | 57 | i += put_float_by_index(zp2, i, msg->payload); // Z2 Position |
shimniok | 0:826c6171fc1b | 58 | i += put_array_by_index(name, 25, i, msg->payload); // POI connection name |
shimniok | 0:826c6171fc1b | 59 | |
shimniok | 0:826c6171fc1b | 60 | return mavlink_finalize_message(msg, system_id, component_id, i); |
shimniok | 0:826c6171fc1b | 61 | } |
shimniok | 0:826c6171fc1b | 62 | |
shimniok | 0:826c6171fc1b | 63 | /** |
shimniok | 0:826c6171fc1b | 64 | * @brief Pack a point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 65 | * @param system_id ID of this system |
shimniok | 0:826c6171fc1b | 66 | * @param component_id ID of this component (e.g. 200 for IMU) |
shimniok | 0:826c6171fc1b | 67 | * @param chan The MAVLink channel this message was sent over |
shimniok | 0:826c6171fc1b | 68 | * @param msg The MAVLink message to compress the data into |
shimniok | 0:826c6171fc1b | 69 | * @param type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug |
shimniok | 0:826c6171fc1b | 70 | * @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta |
shimniok | 0:826c6171fc1b | 71 | * @param coordinate_system 0: global, 1:local |
shimniok | 0:826c6171fc1b | 72 | * @param timeout 0: no timeout, >1: timeout in seconds |
shimniok | 0:826c6171fc1b | 73 | * @param xp1 X1 Position |
shimniok | 0:826c6171fc1b | 74 | * @param yp1 Y1 Position |
shimniok | 0:826c6171fc1b | 75 | * @param zp1 Z1 Position |
shimniok | 0:826c6171fc1b | 76 | * @param xp2 X2 Position |
shimniok | 0:826c6171fc1b | 77 | * @param yp2 Y2 Position |
shimniok | 0:826c6171fc1b | 78 | * @param zp2 Z2 Position |
shimniok | 0:826c6171fc1b | 79 | * @param name POI connection name |
shimniok | 0:826c6171fc1b | 80 | * @return length of the message in bytes (excluding serial stream start sign) |
shimniok | 0:826c6171fc1b | 81 | */ |
shimniok | 0:826c6171fc1b | 82 | static inline uint16_t mavlink_msg_point_of_interest_connection_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const int8_t* name) |
shimniok | 0:826c6171fc1b | 83 | { |
shimniok | 0:826c6171fc1b | 84 | uint16_t i = 0; |
shimniok | 0:826c6171fc1b | 85 | msg->msgid = MAVLINK_MSG_ID_POINT_OF_INTEREST_CONNECTION; |
shimniok | 0:826c6171fc1b | 86 | |
shimniok | 0:826c6171fc1b | 87 | i += put_uint8_t_by_index(type, i, msg->payload); // 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug |
shimniok | 0:826c6171fc1b | 88 | i += put_uint8_t_by_index(color, i, msg->payload); // 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta |
shimniok | 0:826c6171fc1b | 89 | i += put_uint8_t_by_index(coordinate_system, i, msg->payload); // 0: global, 1:local |
shimniok | 0:826c6171fc1b | 90 | i += put_uint16_t_by_index(timeout, i, msg->payload); // 0: no timeout, >1: timeout in seconds |
shimniok | 0:826c6171fc1b | 91 | i += put_float_by_index(xp1, i, msg->payload); // X1 Position |
shimniok | 0:826c6171fc1b | 92 | i += put_float_by_index(yp1, i, msg->payload); // Y1 Position |
shimniok | 0:826c6171fc1b | 93 | i += put_float_by_index(zp1, i, msg->payload); // Z1 Position |
shimniok | 0:826c6171fc1b | 94 | i += put_float_by_index(xp2, i, msg->payload); // X2 Position |
shimniok | 0:826c6171fc1b | 95 | i += put_float_by_index(yp2, i, msg->payload); // Y2 Position |
shimniok | 0:826c6171fc1b | 96 | i += put_float_by_index(zp2, i, msg->payload); // Z2 Position |
shimniok | 0:826c6171fc1b | 97 | i += put_array_by_index(name, 25, i, msg->payload); // POI connection name |
shimniok | 0:826c6171fc1b | 98 | |
shimniok | 0:826c6171fc1b | 99 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, i); |
shimniok | 0:826c6171fc1b | 100 | } |
shimniok | 0:826c6171fc1b | 101 | |
shimniok | 0:826c6171fc1b | 102 | /** |
shimniok | 0:826c6171fc1b | 103 | * @brief Encode a point_of_interest_connection struct into a message |
shimniok | 0:826c6171fc1b | 104 | * |
shimniok | 0:826c6171fc1b | 105 | * @param system_id ID of this system |
shimniok | 0:826c6171fc1b | 106 | * @param component_id ID of this component (e.g. 200 for IMU) |
shimniok | 0:826c6171fc1b | 107 | * @param msg The MAVLink message to compress the data into |
shimniok | 0:826c6171fc1b | 108 | * @param point_of_interest_connection C-struct to read the message contents from |
shimniok | 0:826c6171fc1b | 109 | */ |
shimniok | 0:826c6171fc1b | 110 | static inline uint16_t mavlink_msg_point_of_interest_connection_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_point_of_interest_connection_t* point_of_interest_connection) |
shimniok | 0:826c6171fc1b | 111 | { |
shimniok | 0:826c6171fc1b | 112 | return mavlink_msg_point_of_interest_connection_pack(system_id, component_id, msg, point_of_interest_connection->type, point_of_interest_connection->color, point_of_interest_connection->coordinate_system, point_of_interest_connection->timeout, point_of_interest_connection->xp1, point_of_interest_connection->yp1, point_of_interest_connection->zp1, point_of_interest_connection->xp2, point_of_interest_connection->yp2, point_of_interest_connection->zp2, point_of_interest_connection->name); |
shimniok | 0:826c6171fc1b | 113 | } |
shimniok | 0:826c6171fc1b | 114 | |
shimniok | 0:826c6171fc1b | 115 | /** |
shimniok | 0:826c6171fc1b | 116 | * @brief Send a point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 117 | * @param chan MAVLink channel to send the message |
shimniok | 0:826c6171fc1b | 118 | * |
shimniok | 0:826c6171fc1b | 119 | * @param type 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug |
shimniok | 0:826c6171fc1b | 120 | * @param color 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta |
shimniok | 0:826c6171fc1b | 121 | * @param coordinate_system 0: global, 1:local |
shimniok | 0:826c6171fc1b | 122 | * @param timeout 0: no timeout, >1: timeout in seconds |
shimniok | 0:826c6171fc1b | 123 | * @param xp1 X1 Position |
shimniok | 0:826c6171fc1b | 124 | * @param yp1 Y1 Position |
shimniok | 0:826c6171fc1b | 125 | * @param zp1 Z1 Position |
shimniok | 0:826c6171fc1b | 126 | * @param xp2 X2 Position |
shimniok | 0:826c6171fc1b | 127 | * @param yp2 Y2 Position |
shimniok | 0:826c6171fc1b | 128 | * @param zp2 Z2 Position |
shimniok | 0:826c6171fc1b | 129 | * @param name POI connection name |
shimniok | 0:826c6171fc1b | 130 | */ |
shimniok | 0:826c6171fc1b | 131 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
shimniok | 0:826c6171fc1b | 132 | |
shimniok | 0:826c6171fc1b | 133 | static inline void mavlink_msg_point_of_interest_connection_send(mavlink_channel_t chan, uint8_t type, uint8_t color, uint8_t coordinate_system, uint16_t timeout, float xp1, float yp1, float zp1, float xp2, float yp2, float zp2, const int8_t* name) |
shimniok | 0:826c6171fc1b | 134 | { |
shimniok | 0:826c6171fc1b | 135 | mavlink_message_t msg; |
shimniok | 0:826c6171fc1b | 136 | mavlink_msg_point_of_interest_connection_pack_chan(mavlink_system.sysid, mavlink_system.compid, chan, &msg, type, color, coordinate_system, timeout, xp1, yp1, zp1, xp2, yp2, zp2, name); |
shimniok | 0:826c6171fc1b | 137 | mavlink_send_uart(chan, &msg); |
shimniok | 0:826c6171fc1b | 138 | } |
shimniok | 0:826c6171fc1b | 139 | |
shimniok | 0:826c6171fc1b | 140 | #endif |
shimniok | 0:826c6171fc1b | 141 | // MESSAGE POINT_OF_INTEREST_CONNECTION UNPACKING |
shimniok | 0:826c6171fc1b | 142 | |
shimniok | 0:826c6171fc1b | 143 | /** |
shimniok | 0:826c6171fc1b | 144 | * @brief Get field type from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 145 | * |
shimniok | 0:826c6171fc1b | 146 | * @return 0: Notice, 1: Warning, 2: Critical, 3: Emergency, 4: Debug |
shimniok | 0:826c6171fc1b | 147 | */ |
shimniok | 0:826c6171fc1b | 148 | static inline uint8_t mavlink_msg_point_of_interest_connection_get_type(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 149 | { |
shimniok | 0:826c6171fc1b | 150 | return (uint8_t)(msg->payload)[0]; |
shimniok | 0:826c6171fc1b | 151 | } |
shimniok | 0:826c6171fc1b | 152 | |
shimniok | 0:826c6171fc1b | 153 | /** |
shimniok | 0:826c6171fc1b | 154 | * @brief Get field color from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 155 | * |
shimniok | 0:826c6171fc1b | 156 | * @return 0: blue, 1: yellow, 2: red, 3: orange, 4: green, 5: magenta |
shimniok | 0:826c6171fc1b | 157 | */ |
shimniok | 0:826c6171fc1b | 158 | static inline uint8_t mavlink_msg_point_of_interest_connection_get_color(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 159 | { |
shimniok | 0:826c6171fc1b | 160 | return (uint8_t)(msg->payload+sizeof(uint8_t))[0]; |
shimniok | 0:826c6171fc1b | 161 | } |
shimniok | 0:826c6171fc1b | 162 | |
shimniok | 0:826c6171fc1b | 163 | /** |
shimniok | 0:826c6171fc1b | 164 | * @brief Get field coordinate_system from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 165 | * |
shimniok | 0:826c6171fc1b | 166 | * @return 0: global, 1:local |
shimniok | 0:826c6171fc1b | 167 | */ |
shimniok | 0:826c6171fc1b | 168 | static inline uint8_t mavlink_msg_point_of_interest_connection_get_coordinate_system(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 169 | { |
shimniok | 0:826c6171fc1b | 170 | return (uint8_t)(msg->payload+sizeof(uint8_t)+sizeof(uint8_t))[0]; |
shimniok | 0:826c6171fc1b | 171 | } |
shimniok | 0:826c6171fc1b | 172 | |
shimniok | 0:826c6171fc1b | 173 | /** |
shimniok | 0:826c6171fc1b | 174 | * @brief Get field timeout from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 175 | * |
shimniok | 0:826c6171fc1b | 176 | * @return 0: no timeout, >1: timeout in seconds |
shimniok | 0:826c6171fc1b | 177 | */ |
shimniok | 0:826c6171fc1b | 178 | static inline uint16_t mavlink_msg_point_of_interest_connection_get_timeout(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 179 | { |
shimniok | 0:826c6171fc1b | 180 | generic_16bit r; |
shimniok | 0:826c6171fc1b | 181 | r.b[1] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t))[0]; |
shimniok | 0:826c6171fc1b | 182 | r.b[0] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t))[1]; |
shimniok | 0:826c6171fc1b | 183 | return (uint16_t)r.s; |
shimniok | 0:826c6171fc1b | 184 | } |
shimniok | 0:826c6171fc1b | 185 | |
shimniok | 0:826c6171fc1b | 186 | /** |
shimniok | 0:826c6171fc1b | 187 | * @brief Get field xp1 from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 188 | * |
shimniok | 0:826c6171fc1b | 189 | * @return X1 Position |
shimniok | 0:826c6171fc1b | 190 | */ |
shimniok | 0:826c6171fc1b | 191 | static inline float mavlink_msg_point_of_interest_connection_get_xp1(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 192 | { |
shimniok | 0:826c6171fc1b | 193 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 194 | r.b[3] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t))[0]; |
shimniok | 0:826c6171fc1b | 195 | r.b[2] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t))[1]; |
shimniok | 0:826c6171fc1b | 196 | r.b[1] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t))[2]; |
shimniok | 0:826c6171fc1b | 197 | r.b[0] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t))[3]; |
shimniok | 0:826c6171fc1b | 198 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 199 | } |
shimniok | 0:826c6171fc1b | 200 | |
shimniok | 0:826c6171fc1b | 201 | /** |
shimniok | 0:826c6171fc1b | 202 | * @brief Get field yp1 from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 203 | * |
shimniok | 0:826c6171fc1b | 204 | * @return Y1 Position |
shimniok | 0:826c6171fc1b | 205 | */ |
shimniok | 0:826c6171fc1b | 206 | static inline float mavlink_msg_point_of_interest_connection_get_yp1(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 207 | { |
shimniok | 0:826c6171fc1b | 208 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 209 | r.b[3] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 210 | r.b[2] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 211 | r.b[1] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 212 | r.b[0] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 213 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 214 | } |
shimniok | 0:826c6171fc1b | 215 | |
shimniok | 0:826c6171fc1b | 216 | /** |
shimniok | 0:826c6171fc1b | 217 | * @brief Get field zp1 from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 218 | * |
shimniok | 0:826c6171fc1b | 219 | * @return Z1 Position |
shimniok | 0:826c6171fc1b | 220 | */ |
shimniok | 0:826c6171fc1b | 221 | static inline float mavlink_msg_point_of_interest_connection_get_zp1(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 222 | { |
shimniok | 0:826c6171fc1b | 223 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 224 | r.b[3] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 225 | r.b[2] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 226 | r.b[1] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 227 | r.b[0] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 228 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 229 | } |
shimniok | 0:826c6171fc1b | 230 | |
shimniok | 0:826c6171fc1b | 231 | /** |
shimniok | 0:826c6171fc1b | 232 | * @brief Get field xp2 from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 233 | * |
shimniok | 0:826c6171fc1b | 234 | * @return X2 Position |
shimniok | 0:826c6171fc1b | 235 | */ |
shimniok | 0:826c6171fc1b | 236 | static inline float mavlink_msg_point_of_interest_connection_get_xp2(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 237 | { |
shimniok | 0:826c6171fc1b | 238 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 239 | r.b[3] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 240 | r.b[2] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 241 | r.b[1] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 242 | r.b[0] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 243 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 244 | } |
shimniok | 0:826c6171fc1b | 245 | |
shimniok | 0:826c6171fc1b | 246 | /** |
shimniok | 0:826c6171fc1b | 247 | * @brief Get field yp2 from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 248 | * |
shimniok | 0:826c6171fc1b | 249 | * @return Y2 Position |
shimniok | 0:826c6171fc1b | 250 | */ |
shimniok | 0:826c6171fc1b | 251 | static inline float mavlink_msg_point_of_interest_connection_get_yp2(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 252 | { |
shimniok | 0:826c6171fc1b | 253 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 254 | r.b[3] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 255 | r.b[2] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 256 | r.b[1] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 257 | r.b[0] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 258 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 259 | } |
shimniok | 0:826c6171fc1b | 260 | |
shimniok | 0:826c6171fc1b | 261 | /** |
shimniok | 0:826c6171fc1b | 262 | * @brief Get field zp2 from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 263 | * |
shimniok | 0:826c6171fc1b | 264 | * @return Z2 Position |
shimniok | 0:826c6171fc1b | 265 | */ |
shimniok | 0:826c6171fc1b | 266 | static inline float mavlink_msg_point_of_interest_connection_get_zp2(const mavlink_message_t* msg) |
shimniok | 0:826c6171fc1b | 267 | { |
shimniok | 0:826c6171fc1b | 268 | generic_32bit r; |
shimniok | 0:826c6171fc1b | 269 | r.b[3] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[0]; |
shimniok | 0:826c6171fc1b | 270 | r.b[2] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[1]; |
shimniok | 0:826c6171fc1b | 271 | r.b[1] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[2]; |
shimniok | 0:826c6171fc1b | 272 | r.b[0] = (msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float))[3]; |
shimniok | 0:826c6171fc1b | 273 | return (float)r.f; |
shimniok | 0:826c6171fc1b | 274 | } |
shimniok | 0:826c6171fc1b | 275 | |
shimniok | 0:826c6171fc1b | 276 | /** |
shimniok | 0:826c6171fc1b | 277 | * @brief Get field name from point_of_interest_connection message |
shimniok | 0:826c6171fc1b | 278 | * |
shimniok | 0:826c6171fc1b | 279 | * @return POI connection name |
shimniok | 0:826c6171fc1b | 280 | */ |
shimniok | 0:826c6171fc1b | 281 | static inline uint16_t mavlink_msg_point_of_interest_connection_get_name(const mavlink_message_t* msg, int8_t* r_data) |
shimniok | 0:826c6171fc1b | 282 | { |
shimniok | 0:826c6171fc1b | 283 | |
shimniok | 0:826c6171fc1b | 284 | memcpy(r_data, msg->payload+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint8_t)+sizeof(uint16_t)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float)+sizeof(float), 25); |
shimniok | 0:826c6171fc1b | 285 | return 25; |
shimniok | 0:826c6171fc1b | 286 | } |
shimniok | 0:826c6171fc1b | 287 | |
shimniok | 0:826c6171fc1b | 288 | /** |
shimniok | 0:826c6171fc1b | 289 | * @brief Decode a point_of_interest_connection message into a struct |
shimniok | 0:826c6171fc1b | 290 | * |
shimniok | 0:826c6171fc1b | 291 | * @param msg The message to decode |
shimniok | 0:826c6171fc1b | 292 | * @param point_of_interest_connection C-struct to decode the message contents into |
shimniok | 0:826c6171fc1b | 293 | */ |
shimniok | 0:826c6171fc1b | 294 | static inline void mavlink_msg_point_of_interest_connection_decode(const mavlink_message_t* msg, mavlink_point_of_interest_connection_t* point_of_interest_connection) |
shimniok | 0:826c6171fc1b | 295 | { |
shimniok | 0:826c6171fc1b | 296 | point_of_interest_connection->type = mavlink_msg_point_of_interest_connection_get_type(msg); |
shimniok | 0:826c6171fc1b | 297 | point_of_interest_connection->color = mavlink_msg_point_of_interest_connection_get_color(msg); |
shimniok | 0:826c6171fc1b | 298 | point_of_interest_connection->coordinate_system = mavlink_msg_point_of_interest_connection_get_coordinate_system(msg); |
shimniok | 0:826c6171fc1b | 299 | point_of_interest_connection->timeout = mavlink_msg_point_of_interest_connection_get_timeout(msg); |
shimniok | 0:826c6171fc1b | 300 | point_of_interest_connection->xp1 = mavlink_msg_point_of_interest_connection_get_xp1(msg); |
shimniok | 0:826c6171fc1b | 301 | point_of_interest_connection->yp1 = mavlink_msg_point_of_interest_connection_get_yp1(msg); |
shimniok | 0:826c6171fc1b | 302 | point_of_interest_connection->zp1 = mavlink_msg_point_of_interest_connection_get_zp1(msg); |
shimniok | 0:826c6171fc1b | 303 | point_of_interest_connection->xp2 = mavlink_msg_point_of_interest_connection_get_xp2(msg); |
shimniok | 0:826c6171fc1b | 304 | point_of_interest_connection->yp2 = mavlink_msg_point_of_interest_connection_get_yp2(msg); |
shimniok | 0:826c6171fc1b | 305 | point_of_interest_connection->zp2 = mavlink_msg_point_of_interest_connection_get_zp2(msg); |
shimniok | 0:826c6171fc1b | 306 | mavlink_msg_point_of_interest_connection_get_name(msg, point_of_interest_connection->name); |
shimniok | 0:826c6171fc1b | 307 | } |