novatel.h

Go to the documentation of this file.
00001 /**
00002 \file    novatel.h
00003 \brief   GNSS core 'c' function library: decoding/encoding NovAtel data.
00004 \author  Glenn D. MacGougan (GDM)
00005 \date    2007-11-29
00006 \since   2006-08-04
00007 
00008 \b REFERENCES \n
00009 - NovAtel OEM4 Command and Log Reference. www.novatel.com.
00010 
00011 \b "LICENSE INFORMATION" \n
00012 Copyright (c) 2007, refer to 'author' doxygen tags \n
00013 All rights reserved. \n
00014 
00015 Redistribution and use in source and binary forms, with or without
00016 modification, are permitted provided the following conditions are met: \n
00017 
00018 - Redistributions of source code must retain the above copyright
00019   notice, this list of conditions and the following disclaimer. \n
00020 - Redistributions in binary form must reproduce the above copyright
00021   notice, this list of conditions and the following disclaimer in the
00022   documentation and/or other materials provided with the distribution. \n
00023 - The name(s) of the contributor(s) may not be used to endorse or promote 
00024   products derived from this software without specific prior written 
00025   permission. \n
00026 
00027 THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND ANY EXPRESS 
00028 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
00029 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00030 DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
00031 INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00032 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 
00033 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 
00034 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
00035 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
00036 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
00037 SUCH DAMAGE.
00038 */
00039 
00040 #ifndef _C_NOVATEL_H_
00041 #define _C_NOVATEL_H_
00042 
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046 
00047 #include <stdio.h>
00048 #include "basictypes.h"
00049 
00050 
00051 
00052 /// brief  This enumeration is for the supported NovAtel OEM3 message types.
00053 typedef enum
00054 {
00055   NOVATELOEM3_POSB = 1,  //!< message  1, byte count = 88
00056   NOVATELOEM3_TM1B = 3,  //!< message  3, byte count = 52
00057   NOVATELOEM3_IONB = 16, //!< message 16, byte count = 76
00058   NOVATELOEM3_UTCB = 17, //!< message 17, byte count = 52
00059   NOVATELOEM3_ALMB = 18, //!< message 18, byte count = 120  
00060   NOVATELOEM3_REPB = 14, //!< message 14, byte count = 108
00061   NOVATELOEM3_RGEB = 32, //!< message 32, byte count = 32 + obs * 44   
00062   NOVATELOEM3_MESSAGETYPE_UNKNOWN
00063 } NOVATELOEM3_enumMessageType;
00064 
00065 /// brief  This enumeration is for the NovAtel OEM3 solution status indicator.
00066 typedef enum
00067 {
00068   NOVATELOEM3_SOLUTIONSTATUS_OK = 0,
00069   NOVATELOEM3_SOLUTIONSTATUS_INSUFFICIENT_OBS = 1,
00070   NOVATELOEM3_SOLUTIONSTATUS_NO_CONVERGENCE = 2,
00071   NOVATELOEM3_SOLUTIONSTATUS_SINGULAR = 3,
00072   NOVATELOEM3_SOLUTIONSTATUS_EXCEEDED_COVAR_TRACE = 4,
00073   NOVATELOEM3_SOLUTIONSTATUS_EXCEEDED_TEST_DIST = 5,
00074   NOVATELOEM3_SOLUTIONSTATUS_NOT_CONVERGED_COLD_START = 6,
00075   NOVATELOEM3_SOLUTIONSTATUS_EXCEEDED_COCOM = 7,
00076   NOVATELOEM3_SOLUTIONSTATUS_RESERVED
00077 } NOVATELOEM3_enumSolutionStatus;
00078 
00079 typedef struct
00080 {
00081   unsigned isAntenna_OK:1; //!< This bit will be set to 1 if the antenna connection is not drawing excessive current.
00082   unsigned isL1PLL_OK:1;   //!< When the L1 RF downconverter passes self-test, the bit will be set to 1.
00083   unsigned isRAM_OK:1;     //!< When this bit is set to 1, the receiver RAM has passed the self-test requirements.
00084   unsigned isROM_OK:1;     //!< When this bit is set to 1, the receiver NVM test has passed the self test requirements.
00085   unsigned isDSP_OK:1;     //!< This bit will be set to 1 when the digital signal processors (DSP) have passed the self-test requirements.
00086   unsigned isL1AGC_OK:1;   //!< When set to 1, the L1AGC circuits are operating within normal range of control. Can be indicative of jamming.
00087   unsigned isCOM1_OK:1;    //!< When set to 1, the COM1 UART has passed the self-test requirements.
00088   unsigned isCOM2_OK:1;    //!< When set to 1, the COM2 UART has passed the self-test requirements.
00089   unsigned isWeekNotSet:1; //!< When set to 1, the week is not set. Clock jumps probable.
00090   unsigned noCoarseTime:1; //!< No coarse time. Clock jumps probable.
00091   unsigned noFineTime:1;   //!< No fine time. Clock jumps probable.
00092   unsigned isL1JammerDetected:1;      //!< Indicates if an L1 jammer is detected.
00093   unsigned isCOM1BufferOverrun:1;     //!< Indicates if the COM1 buffer is overrun. Too much data requested.
00094   unsigned isCOM2BufferOverrun:1;     //!< Indicates if the COM2 buffer is overrun. Too much data requested.
00095   unsigned isConsoleBufferOverrun:1;  //!< Indicates if the console buffer is overrun.
00096   unsigned isCPUOverloaded:1;         //!< Indicates if the CPU is being over-taxed.
00097   unsigned isAlmanacSavedInNVM:1;     //!< Indicates if the almanac is saved in non-volatile memory (12 channel cards only).
00098   unsigned isL2AGC_OK:1;              //!< When set to 1, the L2 AGC circuits are operating within normal range of control.
00099   unsigned isL2JammerDetected:1;      //!< Indicates if a jammer on L2 is detected.
00100   unsigned isL2PLL_OK:1;              //!< When the L2 RF downconverter passes self-test, the bit will be set to 1.
00101   unsigned OCXOPLL:1;                 //!< When an external oscillator is connected and the OCXOPLL bit passes self-test, the bit will be set to 1.
00102   unsigned SavedAlmanacNeedsUpdate:1; //!< When the almanac received is newer than the one currently stored in NVM (non-volatile memory), the bit will be set to 1.
00103   unsigned isAlmanacInvalid:1;        //!< Indicates if the almanac is valid.
00104   unsigned isPositionInvalid:1;       //!< Indicates if the position fis is valid.
00105   unsigned isPositionFixed:1;         //!< Indicates if a fix position command has been accepted.
00106   unsigned isClockModelInvalid:1;     //!< Indicates if the clock model has not stabilized.
00107   unsigned isClockSteeringDisabled:1; //!< Indicates if the clockadjust disable command has been accepted.
00108   unsigned reserved:5;                //!< reserved.
00109 } NOVATELOEM3_bitfieldSelfTestStatus;
00110 
00111 typedef struct
00112 {
00113   unsigned State:4;                           //!< 0-L1 Idle, 1-L1 Sky Search, 2-L1 Wide FLL, 3-L1 FLL, 4-L1 PLL, 5-L1 Reacq, 6-L1 Steering, 7-L1 FLL, 8-L2 Idle, 9-L2 Pcode Alignment, 10-L2 Search, 11-L2 PLL
00114   unsigned Number:5;                          //!< 0-31
00115   unsigned isPhaseLocked:1;                   //!< A boolean to indicate if this channel phase locked. 
00116   unsigned isParityKnown:1;                   //!< A boolean to indicate if this channel has known parity.
00117   unsigned isCodeLocked:1;                    //!< A boolean to indicate if this channel is code locked.
00118   unsigned CorrelatorSpacing:3;               //!< 0-Not used, 1-1 chip, 2-Narrow correlator.
00119   unsigned SatelliteSystem:3;                 //!< 0-GPS, 1-GLONASS, 2-WAAS, 3-Pseudolite, 4-7 reserved.
00120   unsigned Reserved1:1;                       //!< Reserved.
00121   unsigned isGrouped:1;                        //!< Is this channel grouped with another channel. i.e. L1/L2 group.
00122   unsigned Frequency:1;                       //!< 0-L1, 1-L2
00123   unsigned CodeType:2;                        //!< 0-CA , 1-P, 2-P codeless, 3-reserved.
00124   unsigned isForwareErrorCorrectionEnabled:1; //!< Is FEC enabled.
00125   unsigned Reserved2:6;                       //!< Reserved.
00126   unsigned isExternalRange:1;                 //!< Is this an external range.
00127   unsigned isChannelAssignmentForced:1;       //!< Is the channel assignment forced.
00128 } NOVATELOEM3_bitfieldTrackingStatus;
00129 
00130 typedef struct
00131 {
00132   unsigned week;     //!< week.
00133   double   tow;      //!< time of week [0-604800).
00134   unsigned nrObs;    //!< The number of observations.
00135   NOVATELOEM3_bitfieldSelfTestStatus status; //!< The receiver self test status. 
00136 
00137 } NOVATELOEM3_structObservationHeader;
00138 
00139 /// \brief  A NOVATEL OEM3 observation message container. i.e. RGEB container.
00140 typedef struct
00141 {
00142   unsigned prn;      //!< The PRN.
00143   double   psr;      //!< pseudorange [m].
00144   float    psrstd;   //!< standard deviation of the psr [m].
00145   double   adr;      //!< accumulated Doppler range [cycles].
00146   float    adrstd;   //!< standard deviation of the adr [cycles].
00147   float    doppler;  //!< Doppler [Hz].
00148   float    cno;      //!< Carrier to noise density ratio [dB-Hz].
00149   float    locktime; //!< locktime in PLL mode [s].
00150   NOVATELOEM3_bitfieldTrackingStatus status; //!< The channel tracking status.
00151 
00152 } NOVATELOEM3_structObservation;
00153 
00154 
00155 
00156 /// \brief  A container for REPB (raw ephemeris) data.
00157 typedef struct
00158 {
00159   unsigned prn;
00160   unsigned char subframe1[30];
00161   unsigned char subframe2[30];
00162   unsigned char subframe3[30];
00163   unsigned char reserved[2];
00164 } NOVATELOEM3_structREPB;
00165 
00166 
00167 
00168 
00169 /// \brief  This enumeration is for NovAtel OEM4 message types.
00170 typedef enum 
00171 {
00172   NOVATELOEM4_IONUTCB               = 8,
00173   NOVATELOEM4_CLOCKMODELB           = 16,
00174   NOVATELOEM4_RAWGPSSUBFRAMEB       = 25,
00175   NOVATELOEM4_CHANDEBUGB            = 32,
00176   NOVATELOEM4_VERSIONB              = 37,
00177   NOVATELOEM4_RAWEPHEMB             = 41,
00178   NOVATELOEM4_BESTPOSB              = 42,
00179   NOVATELOEM4_RANGEB                = 43,
00180   NOVATELOEM4_PSRPOSB               = 47,
00181   NOVATELOEM4_SATVISB               = 48,
00182   NOVATELOEM4_ALMANACB              = 73,
00183   NOVATELOEM4_RAWALMB               = 74,
00184   NOVATELOEM4_TRACKSTATB            = 83,
00185   NOVATELOEM4_SATSTATB              = 84,
00186   NOVATELOEM4_RXSTATUSB             = 93,
00187   NOVATELOEM4_RXSTATUSEVENTB        = 94,
00188   NOVATELOEM4_MATCHEDPOSB           = 96,
00189   NOVATELOEM4_BESTVELB              = 99,
00190   NOVATELOEM4_PSRVELB               = 100,
00191   NOVATELOEM4_TIMEB                 = 101,
00192   NOVATELOEM4_RANGEPNB              = 126,
00193   NOVATELOEM4_RXCONFIGB             = 128,
00194   NOVATELOEM4_RANGECMPB             = 140,
00195   NOVATELOEM4_RTKPOSB               = 141,
00196   NOVATELOEM4_NAVIGATEB             = 161,
00197   NOVATELOEM4_AVEPOSB               = 172,
00198   NOVATELOEM4_REFSTATIONB           = 175,
00199   NOVATELOEM4_PASSCOM1B             = 233,
00200   NOVATELOEM4_PASSCOM2B             = 234,
00201   NOVATELOEM4_PASSCOM3B             = 235,
00202   NOVATELOEM4_MESSAGETYPE_UNKNOWN
00203 
00204 } NOVATELOEM4_enumMessageType;
00205 
00206 /// \brief  This enumeration is for NovAtel OEM4 channel tracking state.
00207 typedef enum 
00208 {
00209   NOVATELOEM4_L1Idle                      = 0,
00210   NOVATELOEM4_L1SkySearch                 = 1,
00211   NOVATELOEM4_L1WideFrequencyBandPullIn   = 2,
00212   NOVATELOEM4_L1NarrorFrequencyBandPullIn = 3,
00213   NOVATELOEM4_L1PhaseLockLoop             = 4,
00214   NOVATELOEM4_L1ReAcquisition             = 5,
00215   NOVATELOEM4_L1Steerin                   = 6,
00216   NOVATELOEM4_L1FrequencyLockLoop         = 7,
00217   NOVATELOEM4_L2Idle                      = 8,
00218   NOVATELOEM4_L2PCodeAlignment            = 9,
00219   NOVATELOEM4_L2Search                    = 10,
00220   NOVATELOEM4_L2PhaseLockLoop             = 11
00221 
00222 } NOVATELOEM4_enumTrackingState;
00223 
00224 /// \brief  This enumeration is for NovAtel OEM4 correlator spacing.
00225 typedef enum 
00226 {
00227   NOVATELOEM4_ReservedSpacingA        = 0,
00228   NOVATELOEM4_OneChipSpacing          = 1,
00229   NOVATELOEM4_NarrowSpacing           = 2,
00230   NOVATELOEM4_ReservedSpacingB        = 3,
00231   NOVATELOEM4_PulseApertureCorrelator = 4,
00232 
00233 } NOVATELOEM4_enumCorrelatorSpacing;
00234 
00235 /// \brief  This enumeration is for NovAtel OEM4 satellite system.
00236 typedef enum
00237 {
00238   NOVATELOEM4_GPSSystem        = 0,
00239   NOVATELOEM4_GLONASSSystem    = 1,
00240   NOVATELOEM4_WAASSystem       = 2,
00241   NOVATELOEM4_PseudoliteSystem = 3,
00242   NOVATELOEM4_ReservedSystem 
00243 
00244 } NOVATELOEM4_enumSatelliteSystem;
00245 
00246 /// \brief  This enumeration is for NovAtel OEM4 code type.
00247 typedef enum 
00248 {
00249   NOVATELOEM4_CACode     = 0,
00250   NOVATELOEM4_PCode      = 1,
00251   NOVATELOEM4_PCodeless  = 2,  
00252   NOVATELOEM4_L2C        = 4,
00253   
00254   NOVATELOEM4_ReservedCodeType 
00255 } NOVATELOEM4_enumCodeType;
00256 
00257 /// \brief  This enumeration is for NovAtel OEM4 frequency.
00258 typedef enum 
00259 {
00260   NOVATELOEM4_L1 = 0,
00261   NOVATELOEM4_L2 = 1,         
00262   NOVATELOEM4_ReservedFrequency
00263 
00264 } NOVATELOEM4_enumFrequency;
00265 
00266 /// \brief  The NovAtel OEM4 tracking status.
00267 typedef struct 
00268 {
00269   NOVATELOEM4_enumTrackingState      eTrackingState;     //!< The channel tracking state. 
00270   unsigned                           channelNumber;      //!< The channel index.
00271   BOOL                               isPhaseLocked;      //!< Is the channel phase locked (TRUE/FALSE)?
00272   BOOL                               isParityKnown;      //!< Is the parity known (TRUE/FALSE)? if not there is a possible 1/2 cycle ambiguity. Do NOT use the adr measurement without valid parity!
00273   BOOL                               isCodeLocked;       //!< Is the channel code locked (TRUE/FALSE)? The pseudorange is invalid if FALSE.
00274   NOVATELOEM4_enumCorrelatorSpacing  eCorrelatorSpacing; //!< The correlator spacing.
00275   NOVATELOEM4_enumSatelliteSystem    eSatelliteSystem;   //!< The satellite sytem for this channel.
00276   BOOL                               isGrouped;          //!< Is this measurement grouped (TRUE/FALSE)? e.g. tracking L1 & L2 for a single satellite.
00277   NOVATELOEM4_enumFrequency          eFrequency;         //!< The frequency type for this channel.
00278   NOVATELOEM4_enumCodeType           eCodeType;          //!< The code type for this channel.
00279   BOOL                               isFECEnabled;       //!< Is forward error correction enable (TRUE/FALSE)?
00280   BOOL                               isPrimaryL1Channel; //!< Is this the primary L1 channel (TRUE/FALSE)?
00281   BOOL                               isHalfCycleAdded;   //!< Has a half cycle been added to the adr after the parity determination (TRUE/FALSE)?
00282   BOOL                               isForcedAssignment; //!< Is this channel forced to track this PRN by the user (TRUE/FALSE)?
00283 
00284 } NOVATELOEM4_structTrackingStatus;
00285 
00286 /// \brief  The NovAtel OEM4 time status enumeration.
00287 typedef enum
00288 {
00289   NOVATELOEM4_TIMESTATUS_UNKNOWN         = 20,  //!< Time validity is unknown.
00290   NOVATELOEM4_TIMESTATUS_APPROXIMATE     = 60,  //!< Time is set approximately.
00291   NOVATELOEM4_TIMESTATUS_COARSEADJUSTING = 80,  //!< Time is approaching coarse precision.
00292   NOVATELOEM4_TIMESTATUS_COARSE          = 100, //!< This time is valid to coarse precision.
00293   NOVATELOEM4_TIMESTATUS_COARSESTEERING  = 120, //!< Time is coarse set, and is being steered.
00294   NOVATELOEM4_TIMESTATUS_FREEWHEELING    = 130, //!< Position is lost, and the range bias cannot be calculated.
00295   NOVATELOEM4_TIMESTATUS_FINEADJUSTING   = 140, //!< Time is adjusting to fine precision.
00296   NOVATELOEM4_TIMESTATUS_FINE            = 160, //!< Time has fine precision.
00297   NOVATELOEM4_TIMESTATUS_FINESTEERING    = 180, //!< Time is fine, set and is being steered.
00298   NOVATELOEM4_TIMESTATUS_SATTIME         = 200  //!< Time from satellite. This is only used in logs containing satellite data such as ephemeris and almanac.
00299 
00300 } NOVATELOEM4_enumTimeStatus;
00301 
00302 /// \brief  The NovAtel OEM4 receiver status bitfield.
00303 typedef struct
00304 {
00305   unsigned isErrorIndicated:1;           //!< A boolean to indicate if any errors indicated by the receiver. Check the receiver status message if any error is indicated.
00306   unsigned isTemperatureBad:1;           //!< A boolean to indicate if there is a temperature status warning. 
00307   unsigned isVoltageBad:1;               //!< A boolean to indicate if there is a voltage supply status warngin.
00308   unsigned isAntennaNotPowered:1;        //!< A boolean to indicate if the antenna is NOT powered.
00309   unsigned reserved_a:1;                 //!< reserved
00310   unsigned isAntennaOpen:1;              //!< A boolean to indicate if the antenna is open.
00311   unsigned isAntennaShorted:1;           //!< A boolean to indicate if the antenna is shorted.
00312   unsigned isCPUOverloaded:1;            //!< A boolean to indicate if the CPU is overloaded.
00313   unsigned isCOM1BufferOverrun:1;        //!< A boolean to indicate if COM1 buffer is overrun.
00314   unsigned isCOM2BufferOverrun:1;        //!< A boolean to indicate if COM2 buffer is overrun.
00315   unsigned isCOM3BufferOverrun:1;        //!< A boolean to indicate if COM3 buffer is overrun.
00316   unsigned isUSBBufferOverrun:1;         //!< A boolean to indicate if USB buffer is overrun.
00317   unsigned reserved_b:3;                 //!< reserved.
00318   unsigned isRF1_AGC_StatusBad:1;        //!< A boolean to indicate if the RF1 AGC status is invalid.
00319   unsigned reserved_c:1;                 //!< reserved.
00320   unsigned isRF2_AGC_StatusBad:1;        //!< A boolean to indicate if the RF2 AGC status if invalid.
00321   unsigned isAlmanacInvalid:1;           //!< A boolean to indicate if the almanac is invalid.
00322   unsigned isPositionSolutionInvalid:1;  //!< A boolean to indicate if the position solution is invalid.
00323   unsigned isPositionFixed:1;            //!< A boolean to indicate if the user has fixed the receiver's antenna position.
00324   unsigned isClockSteeringDisabled:1;    //!< A boolean to indicate if clock steering is disabled.
00325   unsigned isClockModelInvalid:1;        //!< A boolean to indicate if the clock model is invalid.
00326   unsigned isExternalOcsillatorDriven:1; //!< A boolean to indicate if the receiver is driven by an external oscillator.
00327   unsigned isSoftwareResouceBad:1;       //!< A boolean to indicate if there is a software resource warning.
00328   unsigned reserved_d:4;                 //!< reserved.
00329   unsigned isAUX3StatusEvent:1;          //!< A boolean to indicate if an AUX3 status event has occurred.
00330   unsigned isAUX2StatusEvent:1;          //!< A boolean to indicate if an AUX2 status event has occurred.
00331   unsigned isAUX1StatusEvent:1;          //!< A boolean to indicate if an AUX1 status event has occurred.
00332 
00333 } NOVATELOEM4_structRxStatusBitField;
00334 
00335 
00336 /// \brief  The NovAtel OEM4 binary message header.
00337 typedef struct 
00338 {
00339   // 0xAA 0x44 0x12 sync bytes
00340   unsigned char                       headerLength;    //!< The header length [bytes].
00341   unsigned short                      messageID;       //!< The binary message ID.
00342   char                                messageType;     //!< The message type.
00343   char                                portAddress;     //!< The port address.
00344   unsigned short                      dataLength;      //!< The length of the data part of the message (length of entire mesage - header size - CRC size) [bytes].
00345   unsigned short                      sequenceNr;      //!< The sequence number.
00346   char                                idleTime;        //!< The processor idle time.
00347   NOVATELOEM4_enumTimeStatus          eTimeStatus;     //!< The quality status of the GPS time.
00348   unsigned short                      gpsWeek;         //!< The GPS week (0-1024+) [weeks].
00349   unsigned long                       gpsMilliSeconds; //!< The GPS time of week in milliseconds.
00350   NOVATELOEM4_structRxStatusBitField  receiverStatus;  //!< The receiver status bitfield.
00351   unsigned short                      reserved;        //!< A reserved value.
00352   unsigned short                      receiverVersion; //!< The receiver firmware version.
00353 
00354 } NOVATELOEM4_structBinaryHeader;
00355 
00356 
00357 /// \brief  A container for a NovAtel OEM4 observation.
00358 typedef struct
00359 {
00360   unsigned short prn;       //!< The PRN for this channel.
00361   unsigned short reserved;  //!< A 16 bit reserved value.
00362   double   psr;             //!< The pseudorange measurement [m].
00363   float    psrstd;          //!< The receiver estimated pseudorange measurement standard deviation [m].
00364   double   adr;             //!< The carrier phase or accumulated Doppler range measurement [cycles].
00365   float    adrstd;          //!< The receiver estimated accumulated Doppler range measurement standard deviation [cycles].
00366   float    doppler;         //!< The Doppler measurement for this channel [Hz].
00367   float    cno;             //!< The carrier to noise density ratio for this channel [dB-Hz]
00368   float    locktime;        //!< The number of seconds of continous phase tracking (no known cycle slips) [s].
00369 
00370   unsigned rawTrackingStatus;                      //!< The raw tracking status 32 bit value.
00371   NOVATELOEM4_structTrackingStatus trackingStatus; //!< The decoded channel tracking status information.
00372 
00373 } NOVATELOEM4_structObservation;
00374 
00375 /// \brief  NovAtel OEM4 Solution Status enumeration.
00376 typedef enum
00377 {
00378   NOVATELOEM4_SOLNSTATUS_SOL_COMPUTED = 0, //!< Solution computed
00379   NOVATELOEM4_SOLNSTATUS_INSUFFICIENT_OBS = 1, //!< Insufficient observations
00380   NOVATELOEM4_SOLNSTATUS_NO_CONVERGENCE = 2, //!< No convergence
00381   NOVATELOEM4_SOLNSTATUS_SINGULARITY = 3, //!< Singularity at parameters matrix
00382   NOVATELOEM4_SOLNSTATUS_COV_TRACE = 4, //!< Covariance trace exceeds maximum (trace > 1000 m)
00383   NOVATELOEM4_SOLNSTATUS_TEST_DIST = 5, //!< Test distance exceeded (maximum of 3 rejections if distance > 10 km)
00384   NOVATELOEM4_SOLNSTATUS_COLD_START = 6, //!< Not yet converged from cold start
00385   NOVATELOEM4_SOLNSTATUS_V_H_LIMIT = 7, //!< Height or velocity limits exceeded (in accordance with COCOM export licensing restrictions)
00386   NOVATELOEM4_SOLNSTATUS_VARIANCE = 8, //!< Variance exceeds limits
00387   NOVATELOEM4_SOLNSTATUS_RESIDUALS = 9, //!< Residuals are too large
00388   NOVATELOEM4_SOLNSTATUS_DELTA_POS = 10, //!< Delta position is too large
00389   NOVATELOEM4_SOLNSTATUS_NEGATIVE_VAR = 11, //!< Negative variance
00390   NOVATELOEM4_SOLNSTATUS_RESERVED = 12,
00391   NOVATELOEM4_SOLNSTATUS_INTEGRITY_WARNING = 13, //!< Large residuals make position unreliable
00392   NOVATELOEM4_SOLNSTATUS_INS_14 = 14, //!< INS solution status values - Output only when using an inertial navigation system such as NovAtel’s SPAN products. 
00393   NOVATELOEM4_SOLNSTATUS_INS_15 = 15, //!< INS solution status values - Output only when using an inertial navigation system such as NovAtel’s SPAN products. 
00394   NOVATELOEM4_SOLNSTATUS_INS_16 = 16, //!< INS solution status values - Output only when using an inertial navigation system such as NovAtel’s SPAN products. 
00395   NOVATELOEM4_SOLNSTATUS_INS_17 = 17, //!< INS solution status values - Output only when using an inertial navigation system such as NovAtel’s SPAN products. 
00396   NOVATELOEM4_SOLNSTATUS_PENDING = 18, //!< When a FIX POSITION command is entered, the receiver computes its own position and determines if the fixed position is valid. PENDING implies there are not enough satellites being tracked to verify if the FIX POSITION entered into the receiver is valid. The receiver needs to be tracking two or more GPS satellites to perform this check. Under normal conditions you should only see PENDING for a few seconds on power up before the GPS receiver has locked onto its first few satellites. If your antenna is obstructed (or not plugged in) and you have entered a FIX POSITION command, then you may see PENDING indefinitely.
00397   NOVATELOEM4_SOLNSTATUS_INVALID_FIX = 19, //!< The fixed position, entered using the FIX POSITION command, is not valid
00398   NOVATELOEM4_SOLNSTATUS_UNAUTHORIZED = 20, //!< Position type is unauthorized - HP or XP on a receiver not authorized for it
00399   NOVATELOEM4_SOLNSTATUS_UNKNOWN
00400 } NOVATELOEM4_enumSolutionStatus;
00401 
00402 /// \brief  NovAtel OEM4 Position Status enumeration.
00403 typedef enum
00404 {
00405   NOVATELOEM4_POS_STATUS_NONE = 0, //!< No solution
00406   NOVATELOEM4_POS_STATUS_FIXEDPOS = 1, //!< Position has been fixed by the FIX POSITION command
00407   NOVATELOEM4_POS_STATUS_FIXEDHEIGHT = 2, //!< Position has been fixed by the FIX HEIGHT/AUTO command
00408   NOVATELOEM4_POS_STATUS_RESERVED_3 = 3,
00409   NOVATELOEM4_POS_STATUS_RESERVED_4 = 4,
00410   NOVATELOEM4_POS_STATUS_RESERVED_5 = 5,
00411   NOVATELOEM4_POS_STATUS_RESERVED_6 = 6,
00412   NOVATELOEM4_POS_STATUS_RESERVED_7 = 7,
00413   NOVATELOEM4_POS_STATUS_DOPPLER_VELOCITY = 8, //!< Velocity computed using instantaneous Doppler
00414   NOVATELOEM4_POS_STATUS_RESERVED_9 = 9,
00415   NOVATELOEM4_POS_STATUS_RESERVED_10 = 10,
00416   NOVATELOEM4_POS_STATUS_RESERVED_11 = 11,
00417   NOVATELOEM4_POS_STATUS_RESERVED_12 = 12,
00418   NOVATELOEM4_POS_STATUS_RESERVED_13 = 13,
00419   NOVATELOEM4_POS_STATUS_RESERVED_14 = 14,
00420   NOVATELOEM4_POS_STATUS_RESERVED_15 = 15,
00421   NOVATELOEM4_POS_STATUS_SINGLE = 16, //!< Single point position
00422   NOVATELOEM4_POS_STATUS_PSRDIFF = 17, //!< Pseudorange differential solution
00423   NOVATELOEM4_POS_STATUS_WAAS = 18, //!< Solution calculated using corrections from an SBAS
00424   NOVATELOEM4_POS_STATUS_PROPAGATED = 19, //!< Propagated by a Kalman filter without new observations
00425   NOVATELOEM4_POS_STATUS_OMNISTAR = 20, //!< OmniSTAR VBS position (L1 sub-meter) a
00426   NOVATELOEM4_POS_STATUS_RESERVED_21 = 21,
00427   NOVATELOEM4_POS_STATUS_RESERVED_22 = 22,
00428   NOVATELOEM4_POS_STATUS_RESERVED_23 = 23,
00429   NOVATELOEM4_POS_STATUS_RESERVED_24 = 24,
00430   NOVATELOEM4_POS_STATUS_RESERVED_25 = 25,
00431   NOVATELOEM4_POS_STATUS_RESERVED_26 = 26,
00432   NOVATELOEM4_POS_STATUS_RESERVED_27 = 27,
00433   NOVATELOEM4_POS_STATUS_RESERVED_28 = 28,
00434   NOVATELOEM4_POS_STATUS_RESERVED_29 = 29,
00435   NOVATELOEM4_POS_STATUS_RESERVED_30 = 30,
00436   NOVATELOEM4_POS_STATUS_RESERVED_31 = 31,
00437   NOVATELOEM4_POS_STATUS_L1_FLOAT = 32, //!< Floating L1 ambiguity solution
00438   NOVATELOEM4_POS_STATUS_IONOFREE_FLOAT = 33, //!< Floating ionospheric-free ambiguity solution
00439   NOVATELOEM4_POS_STATUS_NARROW_FLOAT = 34, //!< Floating narrow-lane ambiguity solution
00440   NOVATELOEM4_POS_STATUS_L1_INT = 48, //!< Integer L1 ambiguity solution
00441   NOVATELOEM4_POS_STATUS_WIDE_INT = 49, //!< Integer wide-lane ambiguity solution
00442   NOVATELOEM4_POS_STATUS_NARROW_INT = 50, //!< Integer narrow-lane ambiguity solution
00443   NOVATELOEM4_POS_STATUS_RTK_DIRECT_INS = 51, //!< RTK status where the RTK filter is directly initialized from the INS filter *b
00444   NOVATELOEM4_POS_STATUS_INS_52 = 52, //!< INS calculated position types *b
00445   NOVATELOEM4_POS_STATUS_INS_53 = 53, //!< INS calculated position types *b
00446   NOVATELOEM4_POS_STATUS_INS_54 = 54, //!< INS calculated position types *b
00447   NOVATELOEM4_POS_STATUS_INS_55 = 55, //!< INS calculated position types *b
00448   NOVATELOEM4_POS_STATUS_INS_56 = 56, //!< INS calculated position types *b
00449   NOVATELOEM4_POS_STATUS_OMNISTAR_HP = 64, //!< OmniSTAR HP position (L1/L2 decimeter) *a
00450   NOVATELOEM4_POS_STATUS_OMNISTAR_XP = 65, //!< OmniSTAR XP position
00451   NOVATELOEM4_POS_STATUS_CDGPS = 66, //!< Position solution using CDGPS correction *a
00452   // *a. In addition to a NovAtel receiver with L-Band capability, a subscription to the OmniSTAR, or use of the free CDGPS, service is required. Contact NovAtel for details.
00453   // *b. Output only by the BESTPOS and BESTVEL logs when using an inertial navigation system such as NovAtel’s SPAN products. 
00454 } NOVATELOEM4_enumSolutionType;
00455 
00456 /// \brief  A container for the best position, BESTPOS, record.
00457 typedef struct
00458 {
00459   NOVATELOEM4_enumSolutionStatus solution_status;
00460   NOVATELOEM4_enumSolutionType solution_type;
00461   double latitude_in_deg; //!< [deg]
00462   double longitude_in_deg; //!< [deg] 
00463   double height_msl; //!< [m]
00464   float undulation; //!< [m]
00465   unsigned int datum_id; //!< 61 = WGS84, this is the default.
00466   float lat_std; //!< [m]
00467   float lon_std; //!< [m]
00468   float hgt_std; //!< [m]
00469   char station_id[4]; //!< Base station ID
00470   float diff_age; //!< Differential age [s]
00471   float sol_age;  //!< Solution age [s]
00472   unsigned char nr_obs_tracked; //!< Number of observations tracked
00473   unsigned char nr_GPS_L1_ranges; //!< Number of GPS L1 ranges used in computation
00474   unsigned char nr_GPS_L1_ranges_above_RTK_mask_angle; //!< Number of GPS L1 ranges above the RTK mask angle
00475   unsigned char nr_GPS_L2_ranges_above_RTK_mask_angle; //!< Number of GPS L2 ranges above the RTK mask angle
00476   unsigned char reserved[4];
00477 } NOVATELOEM4_structBestPosition;
00478 
00479 typedef enum
00480 {
00481   NOVATELOEM4_CLOCK_STATUS_VALID = 0,      //!< The clock model is valid
00482   NOVATELOEM4_CLOCK_STATUS_CONVERGING = 1, //!< The clock model is near validity
00483   NOVATELOEM4_CLOCK_STATUS_ITERATING = 2,  //!< The clock model is iterating towards validity
00484   NOVATELOEM4_CLOCK_STATUS_INVALID = 3,    //!< The clock model is not valid
00485   NOVATELOEM4_CLOCK_STATUS_ERROR = 4,      //!< Clock model error
00486   NOVATELOEM4_CLOCK_STATUS_UNKNOWN
00487 } NOVATELOEM4_enumClockStatus;
00488 
00489 /// \brief  A container for the TIME message.
00490 typedef struct
00491 {
00492   NOVATELOEM4_enumClockStatus clock_status; //!< Clock model status
00493   double receiver_clock_offset;     //!< Receiver clock offset, in seconds from GPS time. A positive offset implies that the receiver clock is ahead of GPS time. To derive GPS time, use the following formula: GPS time = receiver time - offset
00494   double receiver_clock_offset_std; //!< Receiver clock offset standard deviation [s]. 
00495   double utc_offset;         //!< The offset of GPS time from UTC time [s], computed using almanac parameters. UTC time is GPS time plus the current UTC offset plus the receiver clock offset: UTC time = GPS time + offset + UTC offset 
00496   unsigned int utc_year;     //!< UTC year.
00497   unsigned char utc_month;   //!< UTC month [0-12]. 0 means UTC time is unknown.
00498   unsigned char utc_day;     //!< UTC day [0-31]. 0 means UTC time is unknown.
00499   unsigned char utc_hour;    //!< UTC hour [0-23].
00500   unsigned char utc_minute;  //!< UTC minute [0-59].
00501   unsigned utc_milliseconds; //!< UTC milliseconds [0-60999]. Max of 60999 when leap second is applied.
00502   BOOL isUTCValid;           //!< A boolean to indicate if the UTC time is valid.
00503 
00504 } NOVATELOEM4_structTime;
00505 
00506 
00507 /**
00508 \brief  Find the next NovAtel OEM3 message in an open file.
00509 
00510 Search a file (FILE*), that is already open, for the next
00511 NovAtel OEM3 message. The user must provide a message buffer
00512 with an associated maximum length (8192 bytes recommended ).
00513 
00514 \author   Glenn D. MacGougan (GDM)
00515 \date     2008-12-01
00516 \since    2008-12-01
00517 \return   TRUE(1) if successful, FALSE(0) otherwise.
00518 */
00519 BOOL NOVATELOEM3_FindNextMessageInFile(
00520   FILE *fid,                       //!< A file pointer to an open file (input).
00521   unsigned char *message,          //!< A message buffer in which to place the message found (input/output).
00522   const unsigned maxMessageLength, //!< The maximum size of the message buffer (input).
00523   BOOL *wasEndOfFileReached,       //!< Has the end of the file been reached (output).
00524   BOOL *wasMessageFound,           //!< Was a valid message found (output).
00525   unsigned *filePosition,          //!< The file position for the start of the message found (output).
00526   unsigned *messageLength,         //!< The length of the entire message found and stored in the message buffer (output).
00527   unsigned *messageID,             //!< The message ID of the message found.
00528   unsigned *numberBadChecksums     //!< The number of bad checksum values found. (checksum fails or mistaken messages).
00529   );
00530 
00531 
00532 /**
00533 \brief  Find the next NovAtel OEM3 message in a data buffer.
00534 
00535 Search a valid buffer for the next
00536 NovAtel OEM3 message. The user must provide a message buffer
00537 with an associated maximum length (8192 bytes recommended ).
00538 
00539 \author   Glenn D. MacGougan (GDM)
00540 \date     2008-12-03
00541 \since    2008-12-03
00542 \return   TRUE(1) if successful, FALSE(0) otherwise.
00543 */
00544 BOOL NOVATELOEM3_FindNextMessageInBuffer(
00545   unsigned char *buffer,           //!< A pointer to a buffer containing input data.
00546   const unsigned bufferLength,     //!< The length of the valid data contained in the buffer.
00547   unsigned char *message,          //!< A message buffer in which to place the message found (input/output).
00548   const unsigned maxMessageLength, //!< The maximum size of the message buffer (input).
00549   BOOL *wasEndOfBufferReached,     //!< Has the end of the buffer been reached (output).
00550   BOOL *wasMessageFound,           //!< Was a valid message found (output).
00551   unsigned *startPosition,         //!< The index into the buffer for the start of the message found (output).
00552   unsigned *messageLength,         //!< The length of the entire message found and stored in the message buffer (output).
00553   unsigned *messageID,             //!< The message ID of the message found.
00554   unsigned *numberBadChecksums     //!< The number of bad checksum values found. (checksum fails or mistaken messages).
00555   );
00556 
00557 
00558 
00559 /**
00560 \brief    Decode a NovAtel OEM3 REPB message.
00561 
00562 Given a message buffer with a complete NovAtel OEM3 REPB binary 
00563 message, this function will decode the content into useable ephemeris
00564 information.
00565 
00566 \author   Glenn D. MacGougan (GDM)
00567 \date     2008-12-01
00568 \since    2008-12-01
00569 \return   TRUE(1) if successful, FALSE(0) otherwise.
00570 */
00571 BOOL NOVATELOEM3_DecodeREPB(
00572   const unsigned char *message,           //!< The message buffer containing a complete RANGEB message (input).
00573   const unsigned messageLength,           //!< The length of the entire message (input).
00574   unsigned       *prn,                    //!< The satellite PRN number.
00575   unsigned       *tow,                    //!< The time of week in subframe1, the time of the leading bit edge of subframe 2 [s]
00576   unsigned short *iodc,                   //!< 10 bit issue of data (clock), 8 LSB bits will match the iode                  []    
00577   unsigned char  *iode,                   //!< 8 bit  issue of data (ephemeris)                                              []
00578   unsigned       *toe,                    //!< reference time ephemeris (0-604800)                                           [s]
00579   unsigned       *toc,                    //!< reference time (clock)   (0-604800)                                           [s]      
00580   unsigned short *week,                   //!< 10 bit gps week 0-1023 (user must account for week rollover )                 [week]    
00581   unsigned char  *health,                 //!< 6 bit health parameter, 0 if healthy, unhealth othersize                      [0=healthy]    
00582   unsigned char  *alert_flag,             //!< 1 = URA may be worse than indicated                                           [0,1]
00583   unsigned char  *anti_spoof,             //!< anti-spoof flag from 0=off, 1=on                                              [0,1]    
00584   unsigned char  *code_on_L2,             //!< 0=reserved, 1=P code on L2, 2=C/A on L2                                       [0,1,2]
00585   unsigned char  *ura,                    //!< User Range Accuracy lookup code, 0 is excellent, 15 is use at own risk        [0-15], see p. 83 GPSICD200C
00586   unsigned char  *L2_P_data_flag,         //!< flag indicating if P is on L2 1=true                                          [0,1]
00587   unsigned char  *fit_interval_flag,      //!< fit interval flag (four hour interval or longer) 0=4 fours, 1=greater         [0,1]
00588   unsigned short *age_of_data_offset,     //!< age of data offset                                                            [s]
00589   double *tgd,     //!< group delay                                                                   [s]
00590   double *af2,     //!< polynomial clock correction coefficient (rate of clock drift)                 [s/s^2]
00591   double *af1,     //!< polynomial clock correction coefficient (clock drift)                         [s/s]
00592   double *af0,     //!< polynomial clock correction coefficient (clock bias)                          [s]    
00593   double *m0,      //!< mean anomaly at reference time                                                [rad]
00594   double *delta_n, //!< mean motion difference from computed value                                    [rad/s]
00595   double *ecc,     //!< eccentricity                                                                  []
00596   double *sqrta,   //!< square root of the semi-major axis                                            [m^(1/2)]
00597   double *omega0,  //!< longitude of ascending node of orbit plane at weekly epoch                    [rad]
00598   double *i0,      //!< inclination angle at reference time                                           [rad]
00599   double *w,       //!< argument of perigee                                                           [rad]
00600   double *omegadot,//!< rate of right ascension                                                       [rad/s]
00601   double *idot,    //!< rate of inclination angle                                                     [rad/s]
00602   double *cuc,     //!< amplitude of the cosine harmonic correction term to the argument of latitude  [rad]
00603   double *cus,     //!< amplitude of the sine harmonic correction term to the argument of latitude    [rad]
00604   double *crc,     //!< amplitude of the cosine harmonic correction term to the orbit radius          [m]
00605   double *crs,     //!< amplitude of the sine harmonic correction term to the orbit radius            [m]
00606   double *cic,     //!< amplitude of the cosine harmonic correction term to the angle of inclination  [rad]
00607   double *cis      //!< amplitude of the sine harmonic correction term to the angle of inclination    [rad]
00608   );
00609 
00610 
00611 /**
00612 \brief  Decode a NovAtel OEM3 RGEB message.
00613 
00614 Given a message buffer with a complete NovAtel OEM3 RGEB binary message,
00615 and a user provided array of observation structs, this function will 
00616 decode the binary message into the user provided array.
00617 
00618 \author   Glenn D. MacGougan (GDM)
00619 \date     2008-12-01
00620 \since    2008-12-01
00621 \return   TRUE(1) if successful, FALSE(0) otherwise.
00622 */
00623 BOOL NOVATELOEM3_DecodeRGEB(
00624   const unsigned char *message,            //!< The message buffer containing a complete RGEB message (input).
00625   const unsigned messageLength,            //!< The length of the entire message (input).
00626   NOVATELOEM3_structObservationHeader* obsHeader, //!< A pointer to a user provided struct with obs header info (output).
00627   NOVATELOEM3_structObservation* obsArray, //!< A pointer to a user provided array of NOVATELOEM3_structObservation (output).
00628   const unsigned char maxNrObs,            //!< The maximum number of elements in the array provided (input).
00629   unsigned *nrObs                          //!< The number of valid elements set in the array (output).
00630   );
00631 
00632 
00633 /**
00634 \brief  Decode a NovAtel OEM3 POSB message.
00635 
00636 Given a message buffer with a complete NovAtel OEM3 POSB binary message.
00637 
00638 \author   Glenn D. MacGougan (GDM)
00639 \date     2008-12-08
00640 \since    2008-12-08
00641 \return   TRUE(1) if successful, FALSE(0) otherwise.
00642 */
00643 BOOL NOVATELOEM3_DecodePOSB(
00644   const unsigned char *message,  //!< The message buffer containing a complete RGEB message (input).
00645   const unsigned messageLength,  //!< The length of the entire message (input).
00646   unsigned short* gps_week,      //!< The GPS week number [0-1023], user must account for week rollover (output).
00647   double* gps_tow,               //!< The GPS time of week [0-604800) (output).
00648   double* latitude_degs,         //!< The latitude [deg] (output).
00649   double* longitude_degs,        //!< The longitude [deg] (output).
00650   double* height_msl,            //!< The height (with respect to mean sea level) [m] (output).
00651   double* undulation,            //!< The geoidal undulation [m] (output).
00652   unsigned int* datum_id,        //!< The datum id (61 is WGS84) (output).
00653   double* lat_std,               //!< The estimated solution precision (1-sigma) (output).
00654   double* lon_std,               //!< The estimated solution precision (1-sigma) (output).
00655   double* hgt_std,               //!< The estimated solution precision (1-sigma) (output).
00656   NOVATELOEM3_enumSolutionStatus* status //!< The solution status indicator.
00657   );
00658 
00659 
00660 /**
00661 \brief  Decode a NovAtel OEM3 TM1B message.
00662 
00663 Given a message buffer with a complete NovAtel OEM3 TM1B binary message.
00664 This log provides the time of the GPSCard 1PPS, normally high, active low pulse (1 millisecond), where falling
00665 edge is reference, in GPS week number and seconds into the week. The TM1A/B log follows a 1PPS pulse. It also
00666 includes the receiver clock offset, the standard deviation of the receiver clock offset and clock model status. This
00667 log will output at a maximum rate of 1 Hz.
00668 
00669 \author   Glenn D. MacGougan (GDM)
00670 \date     2008-12-08
00671 \since    2008-12-08
00672 \return   TRUE(1) if successful, FALSE(0) otherwise.
00673 */
00674 BOOL NOVATELOEM3_DecodeTM1B(
00675   const unsigned char *message,  //!< The message buffer containing a complete RGEB message (input).
00676   const unsigned messageLength,  //!< The length of the entire message (input).
00677   unsigned short* gps_week,      //!< The GPS week number [0-1023], user must account for week rollover (output).
00678   double* gps_tow,               //!< The GPS time of week [0-604800) (output).
00679   double* clk_offset,            //!< The receiver clock offset [s] (output). GPSTime = receiver_time - offset.
00680   double* clk_offset_std,        //!< The estimated precision of the clock offset [s] at 1 sigma (output).
00681   double* utc_offset,            //!< The estimated difference between UTC and GPS time. UTC_time = GPS_time + utc_offset. (e.g. -13.0) (output).
00682   BOOL* is_clk_stabilized        //!< A boolean to indicate if the clock is stable (output).
00683   );
00684 
00685 
00686 
00687 /**
00688 \brief  Decode a NovAtel OEM3 IONB message.
00689 
00690 Given a message buffer with a complete NovAtel OEM3 IONB binary message,
00691 extract the alpha and beta values.
00692 
00693 \author   Glenn D. MacGougan (GDM)
00694 \date     2008-12-03
00695 \since    2008-12-03
00696 \return   TRUE(1) if successful, FALSE(0) otherwise.
00697 */
00698 BOOL NOVATELOEM3_DecodeIONB(
00699   const unsigned char *message, //!< The message buffer containing a complete RGEB message (input).
00700   const unsigned messageLength, //!< The length of the entire message (input).
00701   double *alpha0,     //!< coefficients of a cubic equation representing the amplitude of the vertical delay [s] (output).
00702   double *alpha1,     //!< coefficients of a cubic equation representing the amplitude of the vertical delay [s/semi-circle] (output).
00703   double *alpha2,     //!< coefficients of a cubic equation representing the amplitude of the vertical delay [s/semi-circle^2] (output).
00704   double *alpha3,     //!< coefficients of a cubic equation representing the amplitude of the vertical delay [s/semi-circle^3] (output).
00705   double *beta0,      //!< coefficients of a cubic equation representing the period of the model [s] (output).
00706   double *beta1,      //!< coefficients of a cubic equation representing the period of the model [s/semi-circle] (output).
00707   double *beta2,      //!< coefficients of a cubic equation representing the period of the model [s/semi-circle^2] (output).
00708   double *beta3       //!< coefficients of a cubic equation representing the period of the model [s/semi-circle^3] (output).
00709   );
00710 
00711 
00712 /**
00713 \brief  Find the next NovAtel OEM4 message in an open file.
00714 
00715 Search a file (FILE*), that is already open, for the next
00716 NovAtel OEM4 message. The user must provide a message buffer
00717 with an associated maximum length (8192 bytes recommended ).
00718 
00719 \author   Glenn D. MacGougan (GDM)
00720 \date     2007-11-29
00721 \since    2006-11-09
00722 \return   TRUE(1) if successful, FALSE(0) otherwise.
00723 */
00724 BOOL NOVATELOEM4_FindNextMessageInFile(
00725   FILE *fid,                       //!< A file pointer to an open file (input).
00726   unsigned char *message,          //!< A message buffer in which to place the message found (input/output).
00727   const unsigned maxMessageLength, //!< The maximum size of the message buffer (input).
00728   BOOL *wasEndOfFileReached,       //!< Has the end of the file been reached (output).
00729   BOOL *wasMessageFound,           //!< Was a valid message found (output).
00730   unsigned *filePosition,          //!< The file position for the start of the message found (output).
00731   unsigned short *messageLength,   //!< The length of the entire message found and stored in the message buffer (output).
00732   unsigned short *messageID,       //!< The message ID of the message found.
00733   unsigned *numberBadCRC           //!< The number of bad crc values found. (crc fails or mistaken messages).
00734   );
00735 
00736 
00737 /**
00738 \brief  Find the next NovAtel OEM4 message in a buffer.
00739 
00740 Search a valid buffer for the next
00741 NovAtel OEM4 message. The user must provide a message buffer
00742 with an associated maximum length (8192 bytes recommended ).
00743 
00744 \author   Glenn D. MacGougan (GDM)
00745 \date     2008-12-19
00746 \since    2008-12-19
00747 \return   TRUE(1) if successful, FALSE(0) otherwise.
00748 */
00749 BOOL NOVATELOEM4_FindNextMessageInBuffer(
00750   unsigned char *buffer,           //!< A pointer to a buffer containing input data.
00751   const unsigned bufferLength,     //!< The length of the valid data contained in the buffer.
00752   unsigned char *message,          //!< A message buffer in which to place the message found (input/output).
00753   const unsigned maxMessageLength, //!< The maximum size of the message buffer (input).
00754   BOOL *wasEndOfBufferReached,     //!< Has the end of the buffer been reached (output).
00755   BOOL *wasMessageFound,           //!< Was a valid message found (output).
00756   unsigned *startPosition,         //!< The index into the buffer for the start of the message found (output).
00757   unsigned short *messageLength,   //!< The length of the entire message found and stored in the message buffer (output).
00758   unsigned short *messageID,       //!< The message ID of the message found.
00759   unsigned *numberBadCRC           //!< The number of bad crc values found. (crc fails or mistaken messages).  
00760   );
00761 
00762 /**
00763 \brief    Decode a Novatel OEM4 binary message header given a complete binary message.
00764 \author   Glenn D. MacGougan (GDM)
00765 \date     2007-11-29
00766 \since    2006-11-10
00767 \return   TRUE(1) if successful, FALSE(0) otherwise.
00768 */
00769 BOOL NOVATELOEM4_DecodeBinaryMessageHeader(
00770   const unsigned char *message,            //!< The message buffer containing a complete NOVATEL OEM4 binary message (input).
00771   const unsigned short messageLength,      //!< The length of the entire message (input).
00772   NOVATELOEM4_structBinaryHeader *header   //!< A pointer to a NovAtel OEM4 header information struct (output).
00773   );
00774   
00775 
00776 
00777 /**
00778 \brief  Decode a NovAtel OEM4 RANGEB message.
00779 
00780 Given a message buffer with a complete NovAtel OEM4 RANGEB binary message,
00781 and a user provided array of observation structs, this function will 
00782 decode the binary message into the user provided array.
00783 
00784 \author   Glenn D. MacGougan (GDM)
00785 \date     2007-11-29
00786 \since    2006-11-10
00787 \return   TRUE(1) if successful, FALSE(0) otherwise.
00788 */
00789 BOOL NOVATELOEM4_DecodeRANGEB(
00790   const unsigned char *message,            //!< The message buffer containing a complete RANGEB message (input).
00791   const unsigned short messageLength,      //!< The length of the entire message (input).
00792   NOVATELOEM4_structBinaryHeader* header,  //!< A pointer to a NovAtel OEM4 header information struct (output).
00793   NOVATELOEM4_structObservation* obsArray, //!< A pointer to a user provided array of struct_NOVATELOEM4_RANGE (output).
00794   const unsigned char maxNrObs,            //!< The maximum number of elements in the array provided (input).
00795   unsigned *nrObs                          //!< The number of valid elements set in the array (output).
00796   );
00797 
00798 
00799 /**
00800 \brief  Decode a NovAtel OEM4 BESTPOSB message.
00801 
00802 Given a message buffer with a complete NovAtel OEM4 BESTPOSB binary message,
00803 and a user provided array of observation structs, this function will 
00804 decode the binary message.
00805 
00806 \author   Glenn D. MacGougan (GDM)
00807 \date     2008-12-18
00808 \since    2008-12-18
00809 \return   TRUE(1) if successful, FALSE(0) otherwise.
00810 */
00811 BOOL NOVATELOEM4_DecodeBESTPOSB(
00812   const unsigned char *message,            //!< The message buffer containing a complete RANGEB message (input).
00813   const unsigned short messageLength,      //!< The length of the entire message (input).
00814   NOVATELOEM4_structBinaryHeader* header,  //!< A pointer to a NovAtel OEM4 header information struct (output).
00815   NOVATELOEM4_structBestPosition* bestpos  //!< A pointer to a NovAtel OEM4 best position information struct (output).
00816   );
00817 
00818 
00819 /**
00820 \brief  Decode a NovAtel OEM4 TIMEB message.
00821 
00822 Given a message buffer with a complete NovAtel OEM4 TIMEB binary message,
00823 and a user provided array of observation structs, this function will 
00824 decode the binary message.
00825 
00826 \author   Glenn D. MacGougan (GDM)
00827 \date     2008-12-18
00828 \since    2008-12-18
00829 \return   TRUE(1) if successful, FALSE(0) otherwise.
00830 */
00831 BOOL NOVATELOEM4_DecodeTIMEB(
00832   const unsigned char *message,            //!< The message buffer containing a complete RANGEB message (input).
00833   const unsigned short messageLength,      //!< The length of the entire message (input).
00834   NOVATELOEM4_structBinaryHeader* header,  //!< A pointer to a NovAtel OEM4 header information struct (output).
00835   NOVATELOEM4_structTime* time_data        //!< A pointer to a NovAtel OEM4 best position information struct (output).
00836   );
00837 
00838 
00839 
00840 
00841 /**
00842 \brief    Decode the raw 32 bit value that contains tracking status information.
00843 
00844 \author   Glenn D. MacGougan (GDM)
00845 \date     2007-11-29
00846 \since    2006-11-10
00847 \return   TRUE(1) if successful, FALSE(0) otherwise.
00848 */
00849 BOOL NOVATELOEM4_DecodeTrackingStatus(
00850   const unsigned rawTrackingStatus,                 //!< The raw 32 bit tracking status value (input).
00851   NOVATELOEM4_structTrackingStatus *trackingStatus  //!< The decoded tracking status information (output).
00852   );
00853 
00854 
00855 /**
00856 \brief    Decode a NovAtel OEM4 RAWEPHEMB message.
00857 
00858 Given a message buffer with a complete NovAtel OEM4 RAWEPHEMB binary 
00859 message, this function will decode the content into useable ephemeris
00860 information.
00861 
00862 \author   Glenn D. MacGougan (GDM)
00863 \date     2007-11-29
00864 \since    2006-11-10
00865 \return   TRUE(1) if successful, FALSE(0) otherwise.
00866 */
00867 BOOL NOVATELOEM4_DecodeRAWEPHEMB(
00868   const unsigned char *message,           //!< The message buffer containing a complete RANGEB message (input).
00869   const unsigned short messageLength,     //!< The length of the entire message (input).
00870   NOVATELOEM4_structBinaryHeader* header, //!< A pointer to a NovAtel OEM4 header information struct (output).
00871   unsigned *prn,                          //!< The satellite PRN number.
00872   unsigned *reference_week,               //!< The reference GPS week (0-1024+) [weeks].
00873   unsigned *reference_time,               //!< The reference GPS time of week (0-604800) [s].
00874   unsigned       *tow,                    //!< The time of week in subframe1, the time of the leading bit edge of subframe 2 [s]
00875   unsigned short *iodc,                   //!< 10 bit issue of data (clock), 8 LSB bits will match the iode                  []    
00876   unsigned char  *iode,                   //!< 8 bit  issue of data (ephemeris)                                              []
00877   unsigned       *toe,                    //!< reference time ephemeris (0-604800)                                           [s]
00878   unsigned       *toc,                    //!< reference time (clock)   (0-604800)                                           [s]      
00879   unsigned short *week,                   //!< 10 bit gps week 0-1023 (user must account for week rollover )                 [week]    
00880   unsigned char  *health,                 //!< 6 bit health parameter, 0 if healthy, unhealth othersize                      [0=healthy]    
00881   unsigned char  *alert_flag,             //!< 1 = URA may be worse than indicated                                           [0,1]
00882   unsigned char  *anti_spoof,             //!< anti-spoof flag from 0=off, 1=on                                              [0,1]    
00883   unsigned char  *code_on_L2,             //!< 0=reserved, 1=P code on L2, 2=C/A on L2                                       [0,1,2]
00884   unsigned char  *ura,                    //!< User Range Accuracy lookup code, 0 is excellent, 15 is use at own risk        [0-15], see p. 83 GPSICD200C
00885   unsigned char  *L2_P_data_flag,         //!< flag indicating if P is on L2 1=true                                          [0,1]
00886   unsigned char  *fit_interval_flag,      //!< fit interval flag (four hour interval or longer) 0=4 fours, 1=greater         [0,1]
00887   unsigned short *age_of_data_offset,     //!< age of data offset                                                            [s]
00888   double *tgd,     //!< group delay                                                                   [s]
00889   double *af2,     //!< polynomial clock correction coefficient (rate of clock drift)                 [s/s^2]
00890   double *af1,     //!< polynomial clock correction coefficient (clock drift)                         [s/s]
00891   double *af0,     //!< polynomial clock correction coefficient (clock bias)                          [s]    
00892   double *m0,      //!< mean anomaly at reference time                                                [rad]
00893   double *delta_n, //!< mean motion difference from computed value                                    [rad/s]
00894   double *ecc,     //!< eccentricity                                                                  []
00895   double *sqrta,   //!< square root of the semi-major axis                                            [m^(1/2)]
00896   double *omega0,  //!< longitude of ascending node of orbit plane at weekly epoch                    [rad]
00897   double *i0,      //!< inclination angle at reference time                                           [rad]
00898   double *w,       //!< argument of perigee                                                           [rad]
00899   double *omegadot,//!< rate of right ascension                                                       [rad/s]
00900   double *idot,    //!< rate of inclination angle                                                     [rad/s]
00901   double *cuc,     //!< amplitude of the cosine harmonic correction term to the argument of latitude  [rad]
00902   double *cus,     //!< amplitude of the sine harmonic correction term to the argument of latitude    [rad]
00903   double *crc,     //!< amplitude of the cosine harmonic correction term to the orbit radius          [m]
00904   double *crs,     //!< amplitude of the sine harmonic correction term to the orbit radius            [m]
00905   double *cic,     //!< amplitude of the cosine harmonic correction term to the angle of inclination  [rad]
00906   double *cis      //!< amplitude of the sine harmonic correction term to the angle of inclination    [rad]
00907   );
00908    
00909 
00910 /**
00911 \brief  Decode a NovAtel OEM4 RANGEBCMPB message.
00912 
00913 Given a message buffer with a complete NovAtel OEM4 RANGECMPB binary message,
00914 and a user provided array of observation structs, this function will 
00915 decode the compressed binary message into the user provided array.
00916 
00917 \author   Ossama Al-Fanek (OA-F)
00918 \date     March 17, 2007
00919 \remarks  Reviewed by GDM, March 17, 2007.
00920 \return   TRUE(1) if successful, FALSE(0) otherwise.
00921 */
00922 BOOL NOVATELOEM4_DecodeRANGECMPB(
00923   const unsigned char *message,            //!< The message buffer containing a complete RANGEB message (input).
00924   const unsigned short messageLength,      //!< The length of the entire message (input).
00925   NOVATELOEM4_structBinaryHeader* header,  //!< A pointer to a NovAtel OEM4 header information struct (output).
00926   NOVATELOEM4_structObservation* obsArray, //!< A pointer to a user provided array of struct_NOVATELOEM4_RANGE (output).
00927   const unsigned char maxNrObs,            //!< The maximum number of elements in the array provided (input).
00928   unsigned *nrObs                          //!< The number of valid elements set in the array (output).
00929   );
00930                        
00931 
00932 #ifdef __cplusplus
00933 }
00934 #endif
00935 
00936 
00937 #endif // _C_NOVATEL_H_
SourceForge.net Logo