#ifndef UBX_H #define UBX_H /*============================ INCLUDES ======================================*/ #include "libcmn.h" #include "ParsePackUbx.h" /*============================ MACROS =========================================*/ #define GET_BYTE_FLAG(byte, index) (((byte) & (0x01 << (index))) >> index) #define UBX_MAX_LEN (1024) #define UBX_MIN_LEN (7) #define F9P_PROTOCOL_VER_27 (0x00) #define F9P_PROTOCOL_VER_27_1 (0x01) #define UBX_NAV (0x01) #define UBX_ACK (0x05) #define UBX_MON (0x0A) #define UBX_ACK_ID (0x01) #define UBX_NAV_PVT (0x07) #define UBX_NAV_NED (0x3C) #define UBX_NAV_SAT (0x35) #define UBX_MON_HW (0x09) typedef struct { /*================================================== pvt ============================================*/ UtcStruct utc; uint8_t SvNum; uint8_t TimeFlag, DateValid, TimeValid, TimeFullyResolved; uint8_t GpsType, RtkType; uint32_t towms; int LatDeg, LonDeg; // degree 1e-7 int hgt, msl; // mm int hacc, vacc, sacc; // hacc: horizontal accuracy estimate(mm), vacc: vertical accuracy estimate(mm), sacc: speed acc(mm/s) float ve, vn, vd; // 1mm/s float GroundSpeed; // m/s float pdop; float cacc; // sacc: speed accuracy estimate(m), cacc: course/heading accuracy estimate(deg) float HeadingMotionDeg; // heading of motion, degree float HeadingVehichleDeg; // heading of vehicle, degree int CntNavPvt; int LastCntNavPvt; int PpsNavPvt; uint8_t seq; }UbxStruct; extern void UbxDecodeNavPvt(UbxStruct *sol, uint8_t frame[]); extern void UbxDecodeInit(UbxStruct *sol); extern void UbxDecodeStats(UbxStruct *sol); #endif