27#ifndef PROTOCORE_RTCM3_H
28#define PROTOCORE_RTCM3_H
32#if PROTOCORE_ENABLE_NTRIP_CASTER
36#define RTCM3_PREAMBLE 0xD3u
37#define RTCM3_HDR_LEN 3
38#define RTCM3_CRC_LEN 3
39#define RTCM3_MAX_PAYLOAD 1023
40#define RTCM3_MAX_FRAME (RTCM3_HDR_LEN + RTCM3_MAX_PAYLOAD + RTCM3_CRC_LEN)
47uint32_t protocore_rtcm3_crc24q(
const uint8_t *data,
size_t len);
63void protocore_rtcm_bw_init(RtcmBitWriter *w, uint8_t *buf,
size_t cap);
65void protocore_rtcm_bw_u(RtcmBitWriter *w, uint64_t val, uint8_t nbits);
67void protocore_rtcm_bw_s(RtcmBitWriter *w, int64_t val, uint8_t nbits);
70uint64_t protocore_rtcm_br_u(
const uint8_t *buf,
size_t *pos, uint8_t nbits);
72int64_t protocore_rtcm_br_s(
const uint8_t *buf,
size_t *pos, uint8_t nbits);
82 const uint8_t *payload;
94size_t protocore_rtcm3_frame_parse(
const uint8_t *buf,
size_t len, Rtcm3Frame *out);
97size_t protocore_rtcm3_sync(
const uint8_t *buf,
size_t len);
103size_t protocore_rtcm3_frame_build(uint8_t *out,
size_t cap,
const uint8_t *payload, uint16_t payload_len);
116 uint16_t antenna_height_01mm;
121size_t protocore_rtcm3_build_1005(uint8_t *out,
size_t cap, uint16_t station_id, int64_t ecef_x_01mm,
122 int64_t ecef_y_01mm, int64_t ecef_z_01mm);
125size_t protocore_rtcm3_build_1006(uint8_t *out,
size_t cap, uint16_t station_id, int64_t ecef_x_01mm,
126 int64_t ecef_y_01mm, int64_t ecef_z_01mm, uint16_t antenna_height_01mm);
132proto_bool protocore_rtcm3_parse_1005(
const uint8_t *payload, uint16_t payload_len, Rtcm3StationArp *out);
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS