novatel.h File Reference


Detailed Description

GNSS core 'c' function library: decoding/encoding NovAtel data.

Author:
Glenn D. MacGougan (GDM)
Date:
2007-11-29
Since:
2006-08-04
REFERENCES

"LICENSE INFORMATION"
Copyright (c) 2007, refer to 'author' doxygen tags
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided the following conditions are met:

THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file novatel.h.

#include "basictypes.h"

Go to the source code of this file.

Data Structures

struct  NOVATELOEM4_structTrackingStatus
 The NovAtel OEM4 tracking status. More...
struct  NOVATELOEM4_structRxStatusBitField
 The NovAtel OEM4 receiver status bitfield. More...
struct  NOVATELOEM4_structBinaryHeader
 The NovAtel OEM4 binary message header. More...
struct  NOVATELOEM4_structObservation
 A container for a NovAtel OEM4 observation. More...

Enumerations

enum  NOVATELOEM4_enumMessageType
 This enumeration is for NovAtel OEM4 message types. More...
enum  NOVATELOEM4_enumTrackingState
 This enumeration is for NovAtel OEM4 channel tracking state. More...
enum  NOVATELOEM4_enumCorrelatorSpacing
 This enumeration is for NovAtel OEM4 correlator spacing. More...
enum  NOVATELOEM4_enumSatelliteSystem
 This enumeration is for NovAtel OEM4 satellite system. More...
enum  NOVATELOEM4_enumCodeType
 This enumeration is for NovAtel OEM4 code type. More...
enum  NOVATELOEM4_enumFrequency
 This enumeration is for NovAtel OEM4 frequency. More...
enum  NOVATELOEM4_enumTimeStatus {
  NOVATELOEM4_TIMESTATUS_UNKNOWN = 20,
  NOVATELOEM4_TIMESTATUS_APPROXIMATE = 60,
  NOVATELOEM4_TIMESTATUS_COARSEADJUSTING = 80,
  NOVATELOEM4_TIMESTATUS_COARSE = 100,
  NOVATELOEM4_TIMESTATUS_COARSESTEERING = 120,
  NOVATELOEM4_TIMESTATUS_FREEWHEELING = 130,
  NOVATELOEM4_TIMESTATUS_FINEADJUSTING = 140,
  NOVATELOEM4_TIMESTATUS_FINE = 160,
  NOVATELOEM4_TIMESTATUS_FINESTEERING = 180,
  NOVATELOEM4_TIMESTATUS_SATTIME = 200
}
 The NovAtel OEM4 time status enumeration. More...

Functions

BOOL NOVATELOEM4_FindNextMessageInFile (FILE *fid, unsigned char *message, const unsigned maxMessageLength, BOOL *wasEndOfFileReached, BOOL *wasMessageFound, unsigned *filePosition, unsigned short *messageLength, unsigned short *messageID, unsigned *numberBadCRC)
 Find the next NovAtel OEM4 message in an open file.
BOOL NOVATELOEM4_DecodeBinaryMessageHeader (const unsigned char *message, const unsigned short messageLength, NOVATELOEM4_structBinaryHeader *header)
 Decode a Novatel OEM4 binary message header given a complete binary message.
BOOL NOVATELOEM4_DecodeRANGEB (const unsigned char *message, const unsigned short messageLength, NOVATELOEM4_structBinaryHeader *header, NOVATELOEM4_structObservation *obsArray, const unsigned char maxNrObs, unsigned *nrObs)
 Decode a NovAtel OEM4 RANGEB message.
BOOL NOVATELOEM4_DecodeTrackingStatus (const unsigned rawTrackingStatus, NOVATELOEM4_structTrackingStatus *trackingStatus)
 Decode the raw 32 bit value that contains tracking status information.
BOOL NOVATELOEM4_DecodeRAWEPHEMB (const unsigned char *message, const unsigned short messageLength, NOVATELOEM4_structBinaryHeader *header, unsigned *prn, unsigned *reference_week, unsigned *reference_time, unsigned *tow, unsigned short *iodc, unsigned char *iode, unsigned *toe, unsigned *toc, unsigned short *week, unsigned char *health, unsigned char *alert_flag, unsigned char *anti_spoof, unsigned char *code_on_L2, unsigned char *ura, unsigned char *L2_P_data_flag, unsigned char *fit_interval_flag, unsigned short *age_of_data_offset, double *tgd, double *af2, double *af1, double *af0, double *m0, double *delta_n, double *ecc, double *sqrta, double *omega0, double *i0, double *w, double *omegadot, double *idot, double *cuc, double *cus, double *crc, double *crs, double *cic, double *cis)
 Decode a NovAtel OEM4 RAWEPHEMB message.
BOOL NOVATELOEM4_DecodeRANGECMPB (const unsigned char *message, const unsigned short messageLength, NOVATELOEM4_structBinaryHeader *header, NOVATELOEM4_structObservation *obsArray, const unsigned char maxNrObs, unsigned *nrObs)
 Decode a NovAtel OEM4 RANGEBCMPB message.


Enumeration Type Documentation

enum NOVATELOEM4_enumCodeType

This enumeration is for NovAtel OEM4 code type.

Definition at line 127 of file novatel.h.

enum NOVATELOEM4_enumCorrelatorSpacing

This enumeration is for NovAtel OEM4 correlator spacing.

Definition at line 105 of file novatel.h.

enum NOVATELOEM4_enumFrequency

This enumeration is for NovAtel OEM4 frequency.

Definition at line 138 of file novatel.h.

enum NOVATELOEM4_enumMessageType

This enumeration is for NovAtel OEM4 message types.

Definition at line 50 of file novatel.h.

enum NOVATELOEM4_enumSatelliteSystem

This enumeration is for NovAtel OEM4 satellite system.

Definition at line 116 of file novatel.h.

enum NOVATELOEM4_enumTimeStatus

The NovAtel OEM4 time status enumeration.

Enumerator:
NOVATELOEM4_TIMESTATUS_UNKNOWN  Time validity is unknown.
NOVATELOEM4_TIMESTATUS_APPROXIMATE  Time is set approximately.
NOVATELOEM4_TIMESTATUS_COARSEADJUSTING  Time is approaching coarse precision.
NOVATELOEM4_TIMESTATUS_COARSE  This time is valid to coarse precision.
NOVATELOEM4_TIMESTATUS_COARSESTEERING  Time is coarse set, and is being steered.
NOVATELOEM4_TIMESTATUS_FREEWHEELING  Position is lost, and the range bias cannot be calculated.
NOVATELOEM4_TIMESTATUS_FINEADJUSTING  Time is adjusting to fine precision.
NOVATELOEM4_TIMESTATUS_FINE  Time has fine precision.
NOVATELOEM4_TIMESTATUS_FINESTEERING  Time is fine, set and is being steered.
NOVATELOEM4_TIMESTATUS_SATTIME  Time from satellite. This is only used in logs containing satellite data such as ephemeris and almanac.

Definition at line 167 of file novatel.h.

enum NOVATELOEM4_enumTrackingState

This enumeration is for NovAtel OEM4 channel tracking state.

Definition at line 87 of file novatel.h.


Function Documentation

BOOL NOVATELOEM4_DecodeBinaryMessageHeader ( const unsigned char *  message,
const unsigned short  messageLength,
NOVATELOEM4_structBinaryHeader header 
)

Decode a Novatel OEM4 binary message header given a complete binary message.

Author:
Glenn D. MacGougan (GDM)
Date:
2007-11-29
Since:
2006-11-10
Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
message  The message buffer containing a complete NOVATEL OEM4 binary message (input).
messageLength  The length of the entire message (input).
header  A pointer to a NovAtel OEM4 header information struct (output).

Definition at line 368 of file novatel.c.

BOOL NOVATELOEM4_DecodeRANGEB ( const unsigned char *  message,
const unsigned short  messageLength,
NOVATELOEM4_structBinaryHeader header,
NOVATELOEM4_structObservation obsArray,
const unsigned char  maxNrObs,
unsigned *  nrObs 
)

Decode a NovAtel OEM4 RANGEB message.

Given a message buffer with a complete NovAtel OEM4 RANGEB binary message, and a user provided array of observation structs, this function will decode the binary message into the user provided array.

Author:
Glenn D. MacGougan (GDM)
Date:
2007-11-29
Since:
2006-11-10
Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
message  The message buffer containing a complete RANGEB message (input).
messageLength  The length of the entire message (input).
header  A pointer to a NovAtel OEM4 header information struct (output).
obsArray  A pointer to a user provided array of struct_NOVATELOEM4_RANGE (output).
maxNrObs  The maximum number of elements in the array provided (input).
nrObs  The number of valid elements set in the array (output).

Definition at line 626 of file novatel.c.

BOOL NOVATELOEM4_DecodeRANGECMPB ( const unsigned char *  message,
const unsigned short  messageLength,
NOVATELOEM4_structBinaryHeader header,
NOVATELOEM4_structObservation obsArray,
const unsigned char  maxNrObs,
unsigned *  nrObs 
)

Decode a NovAtel OEM4 RANGEBCMPB message.

Given a message buffer with a complete NovAtel OEM4 RANGECMPB binary message, and a user provided array of observation structs, this function will decode the compressed binary message into the user provided array.

Author:
Ossama Al-Fanek (OA-F)
Date:
March 17, 2007
Remarks:
Reviewed by GDM, March 17, 2007.
Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
message  The message buffer containing a complete RANGEB message (input).
messageLength  The length of the entire message (input).
header  A pointer to a NovAtel OEM4 header information struct (output).
obsArray  A pointer to a user provided array of struct_NOVATELOEM4_RANGE (output).
maxNrObs  The maximum number of elements in the array provided (input).
nrObs  The number of valid elements set in the array (output).

Definition at line 434 of file novatel.c.

BOOL NOVATELOEM4_DecodeRAWEPHEMB ( const unsigned char *  message,
const unsigned short  messageLength,
NOVATELOEM4_structBinaryHeader header,
unsigned *  prn,
unsigned *  reference_week,
unsigned *  reference_time,
unsigned *  tow,
unsigned short *  iodc,
unsigned char *  iode,
unsigned *  toe,
unsigned *  toc,
unsigned short *  week,
unsigned char *  health,
unsigned char *  alert_flag,
unsigned char *  anti_spoof,
unsigned char *  code_on_L2,
unsigned char *  ura,
unsigned char *  L2_P_data_flag,
unsigned char *  fit_interval_flag,
unsigned short *  age_of_data_offset,
double *  tgd,
double *  af2,
double *  af1,
double *  af0,
double *  m0,
double *  delta_n,
double *  ecc,
double *  sqrta,
double *  omega0,
double *  i0,
double *  w,
double *  omegadot,
double *  idot,
double *  cuc,
double *  cus,
double *  crc,
double *  crs,
double *  cic,
double *  cis 
)

Decode a NovAtel OEM4 RAWEPHEMB message.

Given a message buffer with a complete NovAtel OEM4 RAWEPHEMB binary message, this function will decode the content into useable ephemeris information.

Author:
Glenn D. MacGougan (GDM)
Date:
2007-11-29
Since:
2006-11-10
Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
message  The message buffer containing a complete RANGEB message (input).
messageLength  The length of the entire message (input).
header  A pointer to a NovAtel OEM4 header information struct (output).
prn  The satellite PRN number.
reference_week  The reference GPS week (0-1024+) [weeks].
reference_time  The reference GPS time of week (0-604800) [s].
tow  The time of week in subframe1, the time of the leading bit edge of subframe 2 [s]
iodc  10 bit issue of data (clock), 8 LSB bits will match the iode []
iode  8 bit issue of data (ephemeris) []
toe  reference time ephemeris (0-604800) [s]
toc  reference time (clock) (0-604800) [s]
week  10 bit gps week 0-1023 (user must account for week rollover ) [week]
health  6 bit health parameter, 0 if healthy, unhealth othersize [0=healthy]
alert_flag  1 = URA may be worse than indicated [0,1]
anti_spoof  anti-spoof flag from 0=off, 1=on [0,1]
code_on_L2  0=reserved, 1=P code on L2, 2=C/A on L2 [0,1,2]
ura  User Range Accuracy lookup code, 0 is excellent, 15 is use at own risk [0-15], see p. 83 GPSICD200C
L2_P_data_flag  flag indicating if P is on L2 1=true [0,1]
fit_interval_flag  fit interval flag (four hour interval or longer) 0=4 fours, 1=greater [0,1]
age_of_data_offset  age of data offset [s]
tgd  group delay [s]
af2  polynomial clock correction coefficient (rate of clock drift) [s/s^2]
af1  polynomial clock correction coefficient (clock drift) [s/s]
af0  polynomial clock correction coefficient (clock bias) [s]
m0  mean anomaly at reference time [rad]
delta_n  mean motion difference from computed value [rad/s]
ecc  eccentricity []
sqrta  square root of the semi-major axis [m^(1/2)]
omega0  longitude of ascending node of orbit plane at weekly epoch [rad]
i0  inclination angle at reference time [rad]
w  argument of perigee [rad]
omegadot  rate of right ascension [rad/s]
idot  rate of inclination angle [rad/s]
cuc  amplitude of the cosine harmonic correction term to the argument of latitude [rad]
cus  amplitude of the sine harmonic correction term to the argument of latitude [rad]
crc  amplitude of the cosine harmonic correction term to the orbit radius [m]
crs  amplitude of the sine harmonic correction term to the orbit radius [m]
cic  amplitude of the cosine harmonic correction term to the angle of inclination [rad]
cis  amplitude of the sine harmonic correction term to the angle of inclination [rad]

Definition at line 795 of file novatel.c.

BOOL NOVATELOEM4_DecodeTrackingStatus ( const unsigned  rawTrackingStatus,
NOVATELOEM4_structTrackingStatus trackingStatus 
)

Decode the raw 32 bit value that contains tracking status information.

Author:
Glenn D. MacGougan (GDM)
Date:
2007-11-29
Since:
2006-11-10
Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
rawTrackingStatus  The raw 32 bit tracking status value (input).
trackingStatus  The decoded tracking status information (output).

Definition at line 740 of file novatel.c.

BOOL NOVATELOEM4_FindNextMessageInFile ( FILE *  fid,
unsigned char *  message,
const unsigned  maxMessageLength,
BOOL *  wasEndOfFileReached,
BOOL *  wasMessageFound,
unsigned *  filePosition,
unsigned short *  messageLength,
unsigned short *  messageID,
unsigned *  numberBadCRC 
)

Find the next NovAtel OEM4 message in an open file.

Search a file (FILE*), that is already open, for the next NovAtel OEM4 message. The user must provide a message buffer with an associated maximum length (8192 bytes recommended ).

Author:
Glenn D. MacGougan (GDM)
Date:
2007-11-29
Since:
2006-11-09
Returns:
TRUE(1) if successful, FALSE(0) otherwise.
Parameters:
fid  A file pointer to an open file (input).
message  A message buffer in which to place the message found (input/output).
maxMessageLength  The maximum size of the message buffer (input).
wasEndOfFileReached  Has the end of the file been reached (output).
wasMessageFound  Was a valid message found (output).
filePosition  The file position for the start of the message found (output).
messageLength  The length of the entire message found and stored in the message buffer (output).
messageID  The message ID of the message found.
numberBadCRC  The number of bad crc values found. (crc fails or mistaken messages).

Definition at line 152 of file novatel.c.