Functions
RTCM v3
Input / Output
Collaboration diagram for RTCM v3:

Functions

static u32 from_lock_ind (u8 lock)
static void gen_obs_gps (navigation_measurement_t *nm, u8 *amb, u32 *pr, s32 *ppr, u8 *lock, u8 *cnr)
s16 rtcm3_check_frame (u8 *buff)
s8 rtcm3_decode_1002 (u8 *buff, u16 *id, double *tow, u8 *n_sat, navigation_measurement_t *nm, u8 *sync)
u16 rtcm3_encode_1002 (u8 *buff, u16 id, gps_time_t t, u8 n_sat, navigation_measurement_t *nm, u8 sync)
void rtcm3_read_header (u8 *buff, u16 *type, u16 *id, double *tow, u8 *sync, u8 *n_sat, u8 *div_free, u8 *smooth)
s8 rtcm3_write_frame (u16 len, u8 *buff)
void rtcm3_write_header (u8 *buff, u16 type, u16 id, gps_time_t t, u8 sync, u8 n_sat, u8 div_free, u8 smooth)
static u8 to_lock_ind (u32 time)

Detailed Description

RTCM v3.1 Format message encoding and decoding.

Implements RTCM Standard 10403.1

DFxxx codes indicate a corresponding Data Field as described in RTCM 10403.1 Table 3.4-1.


Function Documentation

static u32 from_lock_ind ( u8  lock) [static]

Convert a RTCMv3 Lock Time Indicator value into a minimum lock time in seconds. See RTCM 10403.1, Table 3.4-2.

Parameters:
lockLock Time Indicator value.
Returns:
Minimum lock time in seconds.

Definition at line 218 of file rtcm3.c.

static void gen_obs_gps ( navigation_measurement_t nm,
u8 amb,
u32 pr,
s32 ppr,
u8 lock,
u8 cnr 
) [static]

Generate RTCMv3 formatted GPS observation fields. Currently L1 only.

Parameters:
nmStruct containing the observation.
ambThe GPS Integer L1 Pseudorange Modulus Ambiguity (DF014).
prThe GPS L1 Pseudorange (DF011).
pprThe GPS L1 PhaseRange – L1 Pseudorange (DF012).
lockThe GPS L1 Lock Time Indicator (DF013).
cnrThe GPS L1 CNR (DF015).

Definition at line 245 of file rtcm3.c.

s16 rtcm3_check_frame ( u8 buff)

Check RTCM frame header and CRC valid.

Parameters:
buffA pointer to the RTCM message buffer to check.
Returns:
If valid then return length of the data message in range 0-1023. Returns a negative number if the frame is invalid:
  • `-1` : Preamble not valid
  • `-2` : CRC mismatch

Definition at line 46 of file rtcm3.c.

s8 rtcm3_decode_1002 ( u8 buff,
u16 id,
double *  tow,
u8 n_sat,
navigation_measurement_t nm,
u8 sync 
)

Decode an RTCMv3 message type 1002 (Extended L1-Only GPS RTK Observables)

Parameters:
buffA pointer to the RTCM data message buffer.
idReference station ID (DF003).
towGPS time of week of epoch (DF004).
n_satNumber of GPS satellites included in the message (DF006).
nmStruct containing the observation.
syncSynchronous GNSS Flag (DF005).
Returns:
If valid then return 0. Returns a negative number if the message is invalid:
  • `-1` : Message type mismatch
  • `-2` : Message uses unsupported P(Y) code

Definition at line 337 of file rtcm3.c.

u16 rtcm3_encode_1002 ( u8 buff,
u16  id,
gps_time_t  t,
u8  n_sat,
navigation_measurement_t nm,
u8  sync 
)

Encode an RTCMv3 message type 1002 (Extended L1-Only GPS RTK Observables) Message type 1002 has length `64 + n_sat*74` bits. Returned message length is rounded up to the nearest whole byte.

Parameters:
buffA pointer to the RTCM data message buffer.
idReference station ID (DF003).
tGPS time of epoch (DF004).
n_satNumber of GPS satellites included in the message (DF006).
nmStruct containing the observation.
syncSynchronous GNSS Flag (DF005).
Returns:
The message length in bytes.

Definition at line 296 of file rtcm3.c.

void rtcm3_read_header ( u8 buff,
u16 type,
u16 id,
double *  tow,
u8 sync,
u8 n_sat,
u8 div_free,
u8 smooth 
)

Read RTCM header for observation message types 1001..1004.

The data message header will be read starting from byte zero of the buffer. If the buffer also contains a frame header then be sure to pass a pointer to the start of the data message rather than a pointer to the start of the frame buffer. The RTCM observation header is 8 bytes (64 bits) long.

All return values are written into the parameters passed by reference.

Parameters:
buffA pointer to the RTCM data message buffer.
typeMessage type number, i.e. 1001..1004 (DF002).
idReference station ID (DF003).
towGPS time of week of the epoch (DF004).
syncSynchronous GNSS Flag (DF005).
n_satNumber of GPS satellites included in the message (DF006).
div_freeGPS Divergence-free Smoothing Indicator (DF007).
smoothGPS Smoothing Interval indicator (DF008).

Definition at line 177 of file rtcm3.c.

s8 rtcm3_write_frame ( u16  len,
u8 buff 
)

Write RTCM frame header and CRC into a buffer.

The buffer should already contain the data message starting at the 4th byte of the buffer, i.e.

data_message = &buff[3]

The buffer must have 3 bytes free at the start to contain the header and must leave 3 bytes past the end free to contain the CRC. The total length of the buffer should be `len+6` bytes.

`len` should be in the range 0-1023 as per the RTCM v3 standard.

Parameters:
lenThe length of the data message contained in the buffer.
buffA pointer to the RTCM message buffer.
Returns:
Zero on success, -1 if `len` is too large.

Definition at line 84 of file rtcm3.c.

void rtcm3_write_header ( u8 buff,
u16  type,
u16  id,
gps_time_t  t,
u8  sync,
u8  n_sat,
u8  div_free,
u8  smooth 
)

Write RTCM header for observation message types 1001..1004.

The data message header will be written starting from byte zero of the buffer. If the buffer also contains a frame header then be sure to pass a pointer to the start of the data message rather than a pointer to the start of the frame buffer. The RTCM observation header is 8 bytes (64 bits) long.

If the Synchronous GNSS Message Flag is set to `0`, it means that no further GNSS observables referenced to the same Epoch Time will be transmitted. This enables the receiver to begin processing the data immediately after decoding the message. If it is set to `1`, it means that the next message will contain observables of another GNSS source referenced to the same Epoch Time.

Divergence-free Smoothing Indicator values:

Indicator | Meaning --------- | ---------------------------------- 0 | Divergence-free smoothing not used 1 | Divergence-free smoothing used

GPS Smoothing Interval indicator values are listed in RTCM 10403.1 Table 3.4-4, reproduced here:

Indicator | Smoothing Interval --------- | ------------------ 000 (0) | No smoothing 001 (1) | < 30 s 010 (2) | 30-60 s 011 (3) | 1-2 min 100 (4) | 2-4 min 101 (5) | 4-8 min 110 (6) | >8 min 111 (7) | Unlimited

Parameters:
buffA pointer to the RTCM data message buffer.
typeMessage type number, i.e. 1001..1004 (DF002).
idReference station ID (DF003).
tGPS time of epoch (DF004).
syncSynchronous GNSS Flag (DF005).
n_satNumber of GPS satellites included in the message (DF006).
div_freeGPS Divergence-free Smoothing Indicator (DF007).
smoothGPS Smoothing Interval indicator (DF008).

Definition at line 147 of file rtcm3.c.

static u8 to_lock_ind ( u32  time) [static]

Convert a lock time in seconds into a RTCMv3 Lock Time Indicator value. See RTCM 10403.1, Table 3.4-2.

Parameters:
timeLock time in seconds.
Returns:
Lock Time Indicator value.

Definition at line 195 of file rtcm3.c.



swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:57:01