00001
00002
00003 #define MAVLINK_MSG_ID_GPS_RTK 127
00004
00005 typedef struct __mavlink_gps_rtk_t
00006 {
00007 uint32_t time_last_baseline_ms;
00008 uint32_t tow;
00009 int32_t baseline_a_mm;
00010 int32_t baseline_b_mm;
00011 int32_t baseline_c_mm;
00012 uint32_t accuracy;
00013 int32_t iar_num_hypotheses;
00014 uint16_t wn;
00015 uint8_t rtk_receiver_id;
00016 uint8_t rtk_health;
00017 uint8_t rtk_rate;
00018 uint8_t nsats;
00019 uint8_t baseline_coords_type;
00020 } mavlink_gps_rtk_t;
00021
00022 #define MAVLINK_MSG_ID_GPS_RTK_LEN 35
00023 #define MAVLINK_MSG_ID_127_LEN 35
00024
00025 #define MAVLINK_MSG_ID_GPS_RTK_CRC 25
00026 #define MAVLINK_MSG_ID_127_CRC 25
00027
00028
00029
00030 #define MAVLINK_MESSAGE_INFO_GPS_RTK { \
00031 "GPS_RTK", \
00032 13, \
00033 { { "time_last_baseline_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gps_rtk_t, time_last_baseline_ms) }, \
00034 { "tow", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gps_rtk_t, tow) }, \
00035 { "baseline_a_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_rtk_t, baseline_a_mm) }, \
00036 { "baseline_b_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_rtk_t, baseline_b_mm) }, \
00037 { "baseline_c_mm", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_rtk_t, baseline_c_mm) }, \
00038 { "accuracy", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps_rtk_t, accuracy) }, \
00039 { "iar_num_hypotheses", NULL, MAVLINK_TYPE_INT32_T, 0, 24, offsetof(mavlink_gps_rtk_t, iar_num_hypotheses) }, \
00040 { "wn", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps_rtk_t, wn) }, \
00041 { "rtk_receiver_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gps_rtk_t, rtk_receiver_id) }, \
00042 { "rtk_health", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gps_rtk_t, rtk_health) }, \
00043 { "rtk_rate", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps_rtk_t, rtk_rate) }, \
00044 { "nsats", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps_rtk_t, nsats) }, \
00045 { "baseline_coords_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps_rtk_t, baseline_coords_type) }, \
00046 } \
00047 }
00048
00049
00071 static inline uint16_t mavlink_msg_gps_rtk_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
00072 uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
00073 {
00074 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00075 char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
00076 _mav_put_uint32_t(buf, 0, time_last_baseline_ms);
00077 _mav_put_uint32_t(buf, 4, tow);
00078 _mav_put_int32_t(buf, 8, baseline_a_mm);
00079 _mav_put_int32_t(buf, 12, baseline_b_mm);
00080 _mav_put_int32_t(buf, 16, baseline_c_mm);
00081 _mav_put_uint32_t(buf, 20, accuracy);
00082 _mav_put_int32_t(buf, 24, iar_num_hypotheses);
00083 _mav_put_uint16_t(buf, 28, wn);
00084 _mav_put_uint8_t(buf, 30, rtk_receiver_id);
00085 _mav_put_uint8_t(buf, 31, rtk_health);
00086 _mav_put_uint8_t(buf, 32, rtk_rate);
00087 _mav_put_uint8_t(buf, 33, nsats);
00088 _mav_put_uint8_t(buf, 34, baseline_coords_type);
00089
00090 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
00091 #else
00092 mavlink_gps_rtk_t packet;
00093 packet.time_last_baseline_ms = time_last_baseline_ms;
00094 packet.tow = tow;
00095 packet.baseline_a_mm = baseline_a_mm;
00096 packet.baseline_b_mm = baseline_b_mm;
00097 packet.baseline_c_mm = baseline_c_mm;
00098 packet.accuracy = accuracy;
00099 packet.iar_num_hypotheses = iar_num_hypotheses;
00100 packet.wn = wn;
00101 packet.rtk_receiver_id = rtk_receiver_id;
00102 packet.rtk_health = rtk_health;
00103 packet.rtk_rate = rtk_rate;
00104 packet.nsats = nsats;
00105 packet.baseline_coords_type = baseline_coords_type;
00106
00107 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
00108 #endif
00109
00110 msg->msgid = MAVLINK_MSG_ID_GPS_RTK;
00111 #if MAVLINK_CRC_EXTRA
00112 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
00113 #else
00114 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RTK_LEN);
00115 #endif
00116 }
00117
00139 static inline uint16_t mavlink_msg_gps_rtk_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
00140 mavlink_message_t* msg,
00141 uint32_t time_last_baseline_ms,uint8_t rtk_receiver_id,uint16_t wn,uint32_t tow,uint8_t rtk_health,uint8_t rtk_rate,uint8_t nsats,uint8_t baseline_coords_type,int32_t baseline_a_mm,int32_t baseline_b_mm,int32_t baseline_c_mm,uint32_t accuracy,int32_t iar_num_hypotheses)
00142 {
00143 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00144 char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
00145 _mav_put_uint32_t(buf, 0, time_last_baseline_ms);
00146 _mav_put_uint32_t(buf, 4, tow);
00147 _mav_put_int32_t(buf, 8, baseline_a_mm);
00148 _mav_put_int32_t(buf, 12, baseline_b_mm);
00149 _mav_put_int32_t(buf, 16, baseline_c_mm);
00150 _mav_put_uint32_t(buf, 20, accuracy);
00151 _mav_put_int32_t(buf, 24, iar_num_hypotheses);
00152 _mav_put_uint16_t(buf, 28, wn);
00153 _mav_put_uint8_t(buf, 30, rtk_receiver_id);
00154 _mav_put_uint8_t(buf, 31, rtk_health);
00155 _mav_put_uint8_t(buf, 32, rtk_rate);
00156 _mav_put_uint8_t(buf, 33, nsats);
00157 _mav_put_uint8_t(buf, 34, baseline_coords_type);
00158
00159 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
00160 #else
00161 mavlink_gps_rtk_t packet;
00162 packet.time_last_baseline_ms = time_last_baseline_ms;
00163 packet.tow = tow;
00164 packet.baseline_a_mm = baseline_a_mm;
00165 packet.baseline_b_mm = baseline_b_mm;
00166 packet.baseline_c_mm = baseline_c_mm;
00167 packet.accuracy = accuracy;
00168 packet.iar_num_hypotheses = iar_num_hypotheses;
00169 packet.wn = wn;
00170 packet.rtk_receiver_id = rtk_receiver_id;
00171 packet.rtk_health = rtk_health;
00172 packet.rtk_rate = rtk_rate;
00173 packet.nsats = nsats;
00174 packet.baseline_coords_type = baseline_coords_type;
00175
00176 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
00177 #endif
00178
00179 msg->msgid = MAVLINK_MSG_ID_GPS_RTK;
00180 #if MAVLINK_CRC_EXTRA
00181 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
00182 #else
00183 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RTK_LEN);
00184 #endif
00185 }
00186
00195 static inline uint16_t mavlink_msg_gps_rtk_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk)
00196 {
00197 return mavlink_msg_gps_rtk_pack(system_id, component_id, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
00198 }
00199
00209 static inline uint16_t mavlink_msg_gps_rtk_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_rtk_t* gps_rtk)
00210 {
00211 return mavlink_msg_gps_rtk_pack_chan(system_id, component_id, chan, msg, gps_rtk->time_last_baseline_ms, gps_rtk->rtk_receiver_id, gps_rtk->wn, gps_rtk->tow, gps_rtk->rtk_health, gps_rtk->rtk_rate, gps_rtk->nsats, gps_rtk->baseline_coords_type, gps_rtk->baseline_a_mm, gps_rtk->baseline_b_mm, gps_rtk->baseline_c_mm, gps_rtk->accuracy, gps_rtk->iar_num_hypotheses);
00212 }
00213
00232 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
00233
00234 static inline void mavlink_msg_gps_rtk_send(mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
00235 {
00236 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00237 char buf[MAVLINK_MSG_ID_GPS_RTK_LEN];
00238 _mav_put_uint32_t(buf, 0, time_last_baseline_ms);
00239 _mav_put_uint32_t(buf, 4, tow);
00240 _mav_put_int32_t(buf, 8, baseline_a_mm);
00241 _mav_put_int32_t(buf, 12, baseline_b_mm);
00242 _mav_put_int32_t(buf, 16, baseline_c_mm);
00243 _mav_put_uint32_t(buf, 20, accuracy);
00244 _mav_put_int32_t(buf, 24, iar_num_hypotheses);
00245 _mav_put_uint16_t(buf, 28, wn);
00246 _mav_put_uint8_t(buf, 30, rtk_receiver_id);
00247 _mav_put_uint8_t(buf, 31, rtk_health);
00248 _mav_put_uint8_t(buf, 32, rtk_rate);
00249 _mav_put_uint8_t(buf, 33, nsats);
00250 _mav_put_uint8_t(buf, 34, baseline_coords_type);
00251
00252 #if MAVLINK_CRC_EXTRA
00253 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
00254 #else
00255 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
00256 #endif
00257 #else
00258 mavlink_gps_rtk_t packet;
00259 packet.time_last_baseline_ms = time_last_baseline_ms;
00260 packet.tow = tow;
00261 packet.baseline_a_mm = baseline_a_mm;
00262 packet.baseline_b_mm = baseline_b_mm;
00263 packet.baseline_c_mm = baseline_c_mm;
00264 packet.accuracy = accuracy;
00265 packet.iar_num_hypotheses = iar_num_hypotheses;
00266 packet.wn = wn;
00267 packet.rtk_receiver_id = rtk_receiver_id;
00268 packet.rtk_health = rtk_health;
00269 packet.rtk_rate = rtk_rate;
00270 packet.nsats = nsats;
00271 packet.baseline_coords_type = baseline_coords_type;
00272
00273 #if MAVLINK_CRC_EXTRA
00274 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
00275 #else
00276 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)&packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
00277 #endif
00278 #endif
00279 }
00280
00281 #if MAVLINK_MSG_ID_GPS_RTK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
00282
00283
00284
00285
00286
00287
00288
00289 static inline void mavlink_msg_gps_rtk_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_last_baseline_ms, uint8_t rtk_receiver_id, uint16_t wn, uint32_t tow, uint8_t rtk_health, uint8_t rtk_rate, uint8_t nsats, uint8_t baseline_coords_type, int32_t baseline_a_mm, int32_t baseline_b_mm, int32_t baseline_c_mm, uint32_t accuracy, int32_t iar_num_hypotheses)
00290 {
00291 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00292 char *buf = (char *)msgbuf;
00293 _mav_put_uint32_t(buf, 0, time_last_baseline_ms);
00294 _mav_put_uint32_t(buf, 4, tow);
00295 _mav_put_int32_t(buf, 8, baseline_a_mm);
00296 _mav_put_int32_t(buf, 12, baseline_b_mm);
00297 _mav_put_int32_t(buf, 16, baseline_c_mm);
00298 _mav_put_uint32_t(buf, 20, accuracy);
00299 _mav_put_int32_t(buf, 24, iar_num_hypotheses);
00300 _mav_put_uint16_t(buf, 28, wn);
00301 _mav_put_uint8_t(buf, 30, rtk_receiver_id);
00302 _mav_put_uint8_t(buf, 31, rtk_health);
00303 _mav_put_uint8_t(buf, 32, rtk_rate);
00304 _mav_put_uint8_t(buf, 33, nsats);
00305 _mav_put_uint8_t(buf, 34, baseline_coords_type);
00306
00307 #if MAVLINK_CRC_EXTRA
00308 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
00309 #else
00310 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, buf, MAVLINK_MSG_ID_GPS_RTK_LEN);
00311 #endif
00312 #else
00313 mavlink_gps_rtk_t *packet = (mavlink_gps_rtk_t *)msgbuf;
00314 packet->time_last_baseline_ms = time_last_baseline_ms;
00315 packet->tow = tow;
00316 packet->baseline_a_mm = baseline_a_mm;
00317 packet->baseline_b_mm = baseline_b_mm;
00318 packet->baseline_c_mm = baseline_c_mm;
00319 packet->accuracy = accuracy;
00320 packet->iar_num_hypotheses = iar_num_hypotheses;
00321 packet->wn = wn;
00322 packet->rtk_receiver_id = rtk_receiver_id;
00323 packet->rtk_health = rtk_health;
00324 packet->rtk_rate = rtk_rate;
00325 packet->nsats = nsats;
00326 packet->baseline_coords_type = baseline_coords_type;
00327
00328 #if MAVLINK_CRC_EXTRA
00329 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS_RTK_LEN, MAVLINK_MSG_ID_GPS_RTK_CRC);
00330 #else
00331 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RTK, (const char *)packet, MAVLINK_MSG_ID_GPS_RTK_LEN);
00332 #endif
00333 #endif
00334 }
00335 #endif
00336
00337 #endif
00338
00339
00340
00341
00347 static inline uint32_t mavlink_msg_gps_rtk_get_time_last_baseline_ms(const mavlink_message_t* msg)
00348 {
00349 return _MAV_RETURN_uint32_t(msg, 0);
00350 }
00351
00357 static inline uint8_t mavlink_msg_gps_rtk_get_rtk_receiver_id(const mavlink_message_t* msg)
00358 {
00359 return _MAV_RETURN_uint8_t(msg, 30);
00360 }
00361
00367 static inline uint16_t mavlink_msg_gps_rtk_get_wn(const mavlink_message_t* msg)
00368 {
00369 return _MAV_RETURN_uint16_t(msg, 28);
00370 }
00371
00377 static inline uint32_t mavlink_msg_gps_rtk_get_tow(const mavlink_message_t* msg)
00378 {
00379 return _MAV_RETURN_uint32_t(msg, 4);
00380 }
00381
00387 static inline uint8_t mavlink_msg_gps_rtk_get_rtk_health(const mavlink_message_t* msg)
00388 {
00389 return _MAV_RETURN_uint8_t(msg, 31);
00390 }
00391
00397 static inline uint8_t mavlink_msg_gps_rtk_get_rtk_rate(const mavlink_message_t* msg)
00398 {
00399 return _MAV_RETURN_uint8_t(msg, 32);
00400 }
00401
00407 static inline uint8_t mavlink_msg_gps_rtk_get_nsats(const mavlink_message_t* msg)
00408 {
00409 return _MAV_RETURN_uint8_t(msg, 33);
00410 }
00411
00417 static inline uint8_t mavlink_msg_gps_rtk_get_baseline_coords_type(const mavlink_message_t* msg)
00418 {
00419 return _MAV_RETURN_uint8_t(msg, 34);
00420 }
00421
00427 static inline int32_t mavlink_msg_gps_rtk_get_baseline_a_mm(const mavlink_message_t* msg)
00428 {
00429 return _MAV_RETURN_int32_t(msg, 8);
00430 }
00431
00437 static inline int32_t mavlink_msg_gps_rtk_get_baseline_b_mm(const mavlink_message_t* msg)
00438 {
00439 return _MAV_RETURN_int32_t(msg, 12);
00440 }
00441
00447 static inline int32_t mavlink_msg_gps_rtk_get_baseline_c_mm(const mavlink_message_t* msg)
00448 {
00449 return _MAV_RETURN_int32_t(msg, 16);
00450 }
00451
00457 static inline uint32_t mavlink_msg_gps_rtk_get_accuracy(const mavlink_message_t* msg)
00458 {
00459 return _MAV_RETURN_uint32_t(msg, 20);
00460 }
00461
00467 static inline int32_t mavlink_msg_gps_rtk_get_iar_num_hypotheses(const mavlink_message_t* msg)
00468 {
00469 return _MAV_RETURN_int32_t(msg, 24);
00470 }
00471
00478 static inline void mavlink_msg_gps_rtk_decode(const mavlink_message_t* msg, mavlink_gps_rtk_t* gps_rtk)
00479 {
00480 #if MAVLINK_NEED_BYTE_SWAP
00481 gps_rtk->time_last_baseline_ms = mavlink_msg_gps_rtk_get_time_last_baseline_ms(msg);
00482 gps_rtk->tow = mavlink_msg_gps_rtk_get_tow(msg);
00483 gps_rtk->baseline_a_mm = mavlink_msg_gps_rtk_get_baseline_a_mm(msg);
00484 gps_rtk->baseline_b_mm = mavlink_msg_gps_rtk_get_baseline_b_mm(msg);
00485 gps_rtk->baseline_c_mm = mavlink_msg_gps_rtk_get_baseline_c_mm(msg);
00486 gps_rtk->accuracy = mavlink_msg_gps_rtk_get_accuracy(msg);
00487 gps_rtk->iar_num_hypotheses = mavlink_msg_gps_rtk_get_iar_num_hypotheses(msg);
00488 gps_rtk->wn = mavlink_msg_gps_rtk_get_wn(msg);
00489 gps_rtk->rtk_receiver_id = mavlink_msg_gps_rtk_get_rtk_receiver_id(msg);
00490 gps_rtk->rtk_health = mavlink_msg_gps_rtk_get_rtk_health(msg);
00491 gps_rtk->rtk_rate = mavlink_msg_gps_rtk_get_rtk_rate(msg);
00492 gps_rtk->nsats = mavlink_msg_gps_rtk_get_nsats(msg);
00493 gps_rtk->baseline_coords_type = mavlink_msg_gps_rtk_get_baseline_coords_type(msg);
00494 #else
00495 memcpy(gps_rtk, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_RTK_LEN);
00496 #endif
00497 }