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) |
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.
static u32 from_lock_ind | ( | u8 | lock | ) | [static] |
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.
nm | Struct containing the observation. |
amb | The GPS Integer L1 Pseudorange Modulus Ambiguity (DF014). |
pr | The GPS L1 Pseudorange (DF011). |
ppr | The GPS L1 PhaseRange – L1 Pseudorange (DF012). |
lock | The GPS L1 Lock Time Indicator (DF013). |
cnr | The GPS L1 CNR (DF015). |
s16 rtcm3_check_frame | ( | u8 * | buff | ) |
Check RTCM frame header and CRC valid.
buff | A pointer to the RTCM message buffer to check. |
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)
buff | A pointer to the RTCM data message buffer. |
id | Reference station ID (DF003). |
tow | GPS time of week of epoch (DF004). |
n_sat | Number of GPS satellites included in the message (DF006). |
nm | Struct containing the observation. |
sync | Synchronous GNSS Flag (DF005). |
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.
buff | A pointer to the RTCM data message buffer. |
id | Reference station ID (DF003). |
t | GPS time of epoch (DF004). |
n_sat | Number of GPS satellites included in the message (DF006). |
nm | Struct containing the observation. |
sync | Synchronous GNSS Flag (DF005). |
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.
buff | A pointer to the RTCM data message buffer. |
type | Message type number, i.e. 1001..1004 (DF002). |
id | Reference station ID (DF003). |
tow | GPS time of week of the epoch (DF004). |
sync | Synchronous GNSS Flag (DF005). |
n_sat | Number of GPS satellites included in the message (DF006). |
div_free | GPS Divergence-free Smoothing Indicator (DF007). |
smooth | GPS Smoothing Interval indicator (DF008). |
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.
len | The length of the data message contained in the buffer. |
buff | A pointer to the RTCM message buffer. |
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
buff | A pointer to the RTCM data message buffer. |
type | Message type number, i.e. 1001..1004 (DF002). |
id | Reference station ID (DF003). |
t | GPS time of epoch (DF004). |
sync | Synchronous GNSS Flag (DF005). |
n_sat | Number of GPS satellites included in the message (DF006). |
div_free | GPS Divergence-free Smoothing Indicator (DF007). |
smooth | GPS Smoothing Interval indicator (DF008). |
static u8 to_lock_ind | ( | u32 | time | ) | [static] |