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