gnss-js 1.17.0 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ubx.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as Ephemeris } from './nav-BAI1a9vK.cjs';
1
+ import { E as Ephemeris, C as CnavEphemeris } from './nav-DImXUdbp.cjs';
2
2
 
3
3
  /**
4
4
  * u-blox UBX framing shared by the measurement and navigation decoders:
@@ -117,6 +117,36 @@ interface UbxIonoUtcResult {
117
117
  */
118
118
  declare function parseUbxIonoUtc(data: Uint8Array): UbxIonoUtcResult;
119
119
 
120
+ /**
121
+ * u-blox UBX raw CNAV decoding: GPS L2C CNAV messages from RXM-SFRBX
122
+ * (class 0x02, id 0x13), gnssId 0 with sigId 3 (L2 CL) or 4 (L2 CM).
123
+ *
124
+ * Word packing: the u-blox interface description delivers the 300-bit
125
+ * CNAV message as 10 32-bit `dwrd` words (little-endian in the
126
+ * stream) with the message bits left-justified MSB-first — message
127
+ * bit 0 is bit 31 of dwrd[0], and the low 20 bits of dwrd[9] are
128
+ * padding. Verified empirically on a ZED-F9P capture: this unpacking
129
+ * yields a valid CRC-24Q (and the 0x8B preamble in the top byte of
130
+ * dwrd[0], the same property `readLnavSubframe` in ./nav uses to skip
131
+ * CNAV frames) on effectively every message. RTKLIB demo5 does not
132
+ * decode CNAV from u-blox receivers; the field decoding lives in
133
+ * `src/navbits/cnav.ts`, working from IS-GPS-200 directly.
134
+ */
135
+
136
+ interface UbxCnavResult {
137
+ /** Assembled CNAV ephemerides in stream order, repeats suppressed. */
138
+ ephemerides: CnavEphemeris[];
139
+ /** Raw messages whose CRC-24Q check failed (dropped). */
140
+ badCrc: number;
141
+ /** Total GPS L2C RXM-SFRBX messages seen (checksum-valid frames). */
142
+ messages: number;
143
+ }
144
+ /**
145
+ * Decode every GPS L2C CNAV message in a UBX byte stream (RXM-SFRBX,
146
+ * gnssId 0, sigId 3/4) and assemble them into ephemerides.
147
+ */
148
+ declare function parseUbxCnav(data: Uint8Array): UbxCnavResult;
149
+
120
150
  /**
121
151
  * u-blox UBX raw-measurement decoding (RXM-RAWX) — the path from a
122
152
  * receiver log to RINEX-grade observables.
@@ -173,4 +203,4 @@ interface UbxParseResult {
173
203
  */
174
204
  declare function parseUbxRawx(data: Uint8Array): UbxParseResult;
175
205
 
176
- export { type UbxFrame, type UbxIonoUtcResult, type UbxMeasurement, type UbxNavOptions, type UbxNavResult, type UbxParseResult, type UbxRawxEpoch, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames };
206
+ export { type UbxCnavResult, type UbxFrame, type UbxIonoUtcResult, type UbxMeasurement, type UbxNavOptions, type UbxNavResult, type UbxParseResult, type UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames };
package/dist/ubx.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { E as Ephemeris } from './nav-BAI1a9vK.js';
1
+ import { E as Ephemeris, C as CnavEphemeris } from './nav-DImXUdbp.js';
2
2
 
3
3
  /**
4
4
  * u-blox UBX framing shared by the measurement and navigation decoders:
@@ -117,6 +117,36 @@ interface UbxIonoUtcResult {
117
117
  */
118
118
  declare function parseUbxIonoUtc(data: Uint8Array): UbxIonoUtcResult;
119
119
 
120
+ /**
121
+ * u-blox UBX raw CNAV decoding: GPS L2C CNAV messages from RXM-SFRBX
122
+ * (class 0x02, id 0x13), gnssId 0 with sigId 3 (L2 CL) or 4 (L2 CM).
123
+ *
124
+ * Word packing: the u-blox interface description delivers the 300-bit
125
+ * CNAV message as 10 32-bit `dwrd` words (little-endian in the
126
+ * stream) with the message bits left-justified MSB-first — message
127
+ * bit 0 is bit 31 of dwrd[0], and the low 20 bits of dwrd[9] are
128
+ * padding. Verified empirically on a ZED-F9P capture: this unpacking
129
+ * yields a valid CRC-24Q (and the 0x8B preamble in the top byte of
130
+ * dwrd[0], the same property `readLnavSubframe` in ./nav uses to skip
131
+ * CNAV frames) on effectively every message. RTKLIB demo5 does not
132
+ * decode CNAV from u-blox receivers; the field decoding lives in
133
+ * `src/navbits/cnav.ts`, working from IS-GPS-200 directly.
134
+ */
135
+
136
+ interface UbxCnavResult {
137
+ /** Assembled CNAV ephemerides in stream order, repeats suppressed. */
138
+ ephemerides: CnavEphemeris[];
139
+ /** Raw messages whose CRC-24Q check failed (dropped). */
140
+ badCrc: number;
141
+ /** Total GPS L2C RXM-SFRBX messages seen (checksum-valid frames). */
142
+ messages: number;
143
+ }
144
+ /**
145
+ * Decode every GPS L2C CNAV message in a UBX byte stream (RXM-SFRBX,
146
+ * gnssId 0, sigId 3/4) and assemble them into ephemerides.
147
+ */
148
+ declare function parseUbxCnav(data: Uint8Array): UbxCnavResult;
149
+
120
150
  /**
121
151
  * u-blox UBX raw-measurement decoding (RXM-RAWX) — the path from a
122
152
  * receiver log to RINEX-grade observables.
@@ -173,4 +203,4 @@ interface UbxParseResult {
173
203
  */
174
204
  declare function parseUbxRawx(data: Uint8Array): UbxParseResult;
175
205
 
176
- export { type UbxFrame, type UbxIonoUtcResult, type UbxMeasurement, type UbxNavOptions, type UbxNavResult, type UbxParseResult, type UbxRawxEpoch, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames };
206
+ export { type UbxCnavResult, type UbxFrame, type UbxIonoUtcResult, type UbxMeasurement, type UbxNavOptions, type UbxNavResult, type UbxParseResult, type UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawx, ubxFrames };
package/dist/ubx.js CHANGED
@@ -1,11 +1,14 @@
1
1
  import {
2
+ parseUbxCnav,
2
3
  parseUbxIonoUtc,
3
4
  parseUbxNav,
4
5
  parseUbxRawx,
5
6
  ubxFrames
6
- } from "./chunk-IG5CDNDS.js";
7
- import "./chunk-REYOYF7O.js";
7
+ } from "./chunk-JW2ICDR7.js";
8
+ import "./chunk-6NCMACDO.js";
9
+ import "./chunk-IQ5OIMQD.js";
8
10
  export {
11
+ parseUbxCnav,
9
12
  parseUbxIonoUtc,
10
13
  parseUbxNav,
11
14
  parseUbxRawx,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gnss-js",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "description": "Comprehensive GNSS library for JavaScript — time scales, coordinates, RINEX parsing, RTCM3 decoding, orbit computation, and signal analysis",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,108 +0,0 @@
1
- /**
2
- * RINEX 3.x/4.x navigation file parser.
3
- * Parses GPS, Galileo, BeiDou (Keplerian), and GLONASS (state vector) ephemerides.
4
- */
5
- interface NavHeader {
6
- version: number;
7
- type: string;
8
- leapSeconds: number | null;
9
- ionoCorrections: Record<string, number[]>;
10
- }
11
- /** GPS / Galileo / BeiDou / QZSS / NavIC Keplerian ephemeris. */
12
- interface KeplerEphemeris {
13
- system: 'G' | 'E' | 'C' | 'J' | 'I';
14
- /** Satellite PRN, e.g. "G14". */
15
- prn: string;
16
- /** Epoch of clock in seconds of GPS week. */
17
- toc: number;
18
- /** Epoch of clock as a Date. */
19
- tocDate: Date;
20
- /** SV clock bias in seconds. */
21
- af0: number;
22
- /** SV clock drift in s/s. */
23
- af1: number;
24
- /** SV clock drift rate in s/s². */
25
- af2: number;
26
- /** Issue of data (ephemeris). */
27
- iode: number;
28
- /** Amplitude of sine correction to orbit radius in meters. */
29
- crs: number;
30
- /** Mean motion difference in rad/s. */
31
- deltaN: number;
32
- /** Mean anomaly at reference time in radians. */
33
- m0: number;
34
- /** Amplitude of cosine correction to argument of latitude in radians. */
35
- cuc: number;
36
- /** Eccentricity (dimensionless). */
37
- e: number;
38
- /** Amplitude of sine correction to argument of latitude in radians. */
39
- cus: number;
40
- /** Square root of semi-major axis in m^(1/2). */
41
- sqrtA: number;
42
- /** Time of ephemeris in seconds of GPS week. */
43
- toe: number;
44
- /** Amplitude of cosine correction to inclination in radians. */
45
- cic: number;
46
- /** Right ascension of ascending node at reference time in radians. */
47
- omega0: number;
48
- /** Amplitude of sine correction to inclination in radians. */
49
- cis: number;
50
- /** Inclination at reference time in radians. */
51
- i0: number;
52
- /** Amplitude of cosine correction to orbit radius in meters. */
53
- crc: number;
54
- /** Argument of perigee in radians. */
55
- omega: number;
56
- /** Rate of right ascension in rad/s. */
57
- omegaDot: number;
58
- /** Rate of inclination in rad/s. */
59
- idot: number;
60
- /** GPS week number. */
61
- week: number;
62
- /** SV health flag. */
63
- svHealth: number;
64
- /** Total group delay in seconds. */
65
- tgd: number;
66
- }
67
- /** GLONASS / SBAS state-vector ephemeris. Positions in km, velocities in km/s, accelerations in km/s². */
68
- interface GlonassEphemeris {
69
- system: 'R' | 'S';
70
- prn: string;
71
- tocDate: Date;
72
- /** Clock bias (seconds). */
73
- tauN: number;
74
- /** Relative frequency bias (dimensionless). */
75
- gammaN: number;
76
- /** Message frame time (seconds of UTC day). */
77
- messageFrameTime: number;
78
- /** X position in km (PZ-90). */
79
- x: number;
80
- /** X velocity in km/s. */
81
- xDot: number;
82
- /** X acceleration in km/s² (luni-solar). */
83
- xAcc: number;
84
- /** Y position in km (PZ-90). */
85
- y: number;
86
- /** Y velocity in km/s. */
87
- yDot: number;
88
- /** Y acceleration in km/s² (luni-solar). */
89
- yAcc: number;
90
- /** Z position in km (PZ-90). */
91
- z: number;
92
- /** Z velocity in km/s. */
93
- zDot: number;
94
- /** Z acceleration in km/s² (luni-solar). */
95
- zAcc: number;
96
- /** Health flag (0 = healthy). */
97
- health: number;
98
- /** GLONASS frequency channel number (-7 to +6). */
99
- freqNum: number;
100
- }
101
- type Ephemeris = KeplerEphemeris | GlonassEphemeris;
102
- interface NavResult {
103
- header: NavHeader;
104
- ephemerides: Ephemeris[];
105
- }
106
- declare function parseNavFile(text: string): NavResult;
107
-
108
- export { type Ephemeris as E, type GlonassEphemeris as G, type KeplerEphemeris as K, type NavHeader as N, type NavResult as a, parseNavFile as p };
@@ -1,108 +0,0 @@
1
- /**
2
- * RINEX 3.x/4.x navigation file parser.
3
- * Parses GPS, Galileo, BeiDou (Keplerian), and GLONASS (state vector) ephemerides.
4
- */
5
- interface NavHeader {
6
- version: number;
7
- type: string;
8
- leapSeconds: number | null;
9
- ionoCorrections: Record<string, number[]>;
10
- }
11
- /** GPS / Galileo / BeiDou / QZSS / NavIC Keplerian ephemeris. */
12
- interface KeplerEphemeris {
13
- system: 'G' | 'E' | 'C' | 'J' | 'I';
14
- /** Satellite PRN, e.g. "G14". */
15
- prn: string;
16
- /** Epoch of clock in seconds of GPS week. */
17
- toc: number;
18
- /** Epoch of clock as a Date. */
19
- tocDate: Date;
20
- /** SV clock bias in seconds. */
21
- af0: number;
22
- /** SV clock drift in s/s. */
23
- af1: number;
24
- /** SV clock drift rate in s/s². */
25
- af2: number;
26
- /** Issue of data (ephemeris). */
27
- iode: number;
28
- /** Amplitude of sine correction to orbit radius in meters. */
29
- crs: number;
30
- /** Mean motion difference in rad/s. */
31
- deltaN: number;
32
- /** Mean anomaly at reference time in radians. */
33
- m0: number;
34
- /** Amplitude of cosine correction to argument of latitude in radians. */
35
- cuc: number;
36
- /** Eccentricity (dimensionless). */
37
- e: number;
38
- /** Amplitude of sine correction to argument of latitude in radians. */
39
- cus: number;
40
- /** Square root of semi-major axis in m^(1/2). */
41
- sqrtA: number;
42
- /** Time of ephemeris in seconds of GPS week. */
43
- toe: number;
44
- /** Amplitude of cosine correction to inclination in radians. */
45
- cic: number;
46
- /** Right ascension of ascending node at reference time in radians. */
47
- omega0: number;
48
- /** Amplitude of sine correction to inclination in radians. */
49
- cis: number;
50
- /** Inclination at reference time in radians. */
51
- i0: number;
52
- /** Amplitude of cosine correction to orbit radius in meters. */
53
- crc: number;
54
- /** Argument of perigee in radians. */
55
- omega: number;
56
- /** Rate of right ascension in rad/s. */
57
- omegaDot: number;
58
- /** Rate of inclination in rad/s. */
59
- idot: number;
60
- /** GPS week number. */
61
- week: number;
62
- /** SV health flag. */
63
- svHealth: number;
64
- /** Total group delay in seconds. */
65
- tgd: number;
66
- }
67
- /** GLONASS / SBAS state-vector ephemeris. Positions in km, velocities in km/s, accelerations in km/s². */
68
- interface GlonassEphemeris {
69
- system: 'R' | 'S';
70
- prn: string;
71
- tocDate: Date;
72
- /** Clock bias (seconds). */
73
- tauN: number;
74
- /** Relative frequency bias (dimensionless). */
75
- gammaN: number;
76
- /** Message frame time (seconds of UTC day). */
77
- messageFrameTime: number;
78
- /** X position in km (PZ-90). */
79
- x: number;
80
- /** X velocity in km/s. */
81
- xDot: number;
82
- /** X acceleration in km/s² (luni-solar). */
83
- xAcc: number;
84
- /** Y position in km (PZ-90). */
85
- y: number;
86
- /** Y velocity in km/s. */
87
- yDot: number;
88
- /** Y acceleration in km/s² (luni-solar). */
89
- yAcc: number;
90
- /** Z position in km (PZ-90). */
91
- z: number;
92
- /** Z velocity in km/s. */
93
- zDot: number;
94
- /** Z acceleration in km/s² (luni-solar). */
95
- zAcc: number;
96
- /** Health flag (0 = healthy). */
97
- health: number;
98
- /** GLONASS frequency channel number (-7 to +6). */
99
- freqNum: number;
100
- }
101
- type Ephemeris = KeplerEphemeris | GlonassEphemeris;
102
- interface NavResult {
103
- header: NavHeader;
104
- ephemerides: Ephemeris[];
105
- }
106
- declare function parseNavFile(text: string): NavResult;
107
-
108
- export { type Ephemeris as E, type GlonassEphemeris as G, type KeplerEphemeris as K, type NavHeader as N, type NavResult as a, parseNavFile as p };