26
- 0x##
(2’s complement of the arithmetic sum of the bytes between the delimiters)
- 0x10
(DLE)
- 0x03
(ETX is last byte)
Position Record
The Position Record has a record identifier of
typedef struct
{
float
alt;
float
epe;
float
eph;
float
epv;
int
fix;
double
gps_tow;
double
lat;
double
lon;
float
lon_vel;
float
lat_vel;
float
alt_vel;
float
msl_hght;
int
leap_sec;
long
grmn_days;
} cpo_pvt_data;
alt
Ellipsoid altitude (meters)
epe
Estimated position error (meters)
eph
Position error, horizontal (meters)
epv
Position error, vertical (meters)
fix
0 = no fix; 1 = no fix; 2 = 2D; 3 = 3D; 4 = 2D differential; 5 = 3D differential;
6 and greater = not defined
gps_tow
GPS time of week (sec)
lat
Latitude (radians)
lon
Longitude (radians)
lon_vel
Longitude velocity (meters/second)
lat_vel
Latitude velocity (meters/second)
alt_vel
Altitude velocity (meters/second)
msl_hght
Height (mean sea level) (meters)
leap_sec
UTC leap seconds
grmn_days Garmin days (days since December 31, 1989)
DLE and ETX bytes:
Sample C code to receive the two records should filter DLE and ETX bytes as described below:
typedef enum
{
DAT,
DLE,
ETX
} rx_state_type;
/* Declare and initialize static variables */
static char
in_que[ 256 ];
static int
in_que_ptr = 0;
static rx_state_type rx_state = DAT;
.
.
.
void add_to_que( char data )
{