gnss-js 1.52.0 → 1.53.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.
@@ -486,6 +486,58 @@ function parseSbfReceiverSetup(data) {
486
486
  return out;
487
487
  }
488
488
 
489
+ // src/sbf/pvt.ts
490
+ var GPS_EPOCH_MS2 = Date.UTC(1980, 0, 6);
491
+ var RAD2DEG = 180 / Math.PI;
492
+ var DNU_F8 = -2e10;
493
+ var MODE_LABELS = {
494
+ 0: "no-pvt",
495
+ 1: "standalone",
496
+ 2: "differential",
497
+ 3: "fixed-location",
498
+ 4: "rtk-fixed",
499
+ 5: "rtk-float",
500
+ 6: "sbas-aided",
501
+ 7: "moving-base-rtk-fixed",
502
+ 8: "moving-base-rtk-float",
503
+ 10: "ppp"
504
+ };
505
+ function parseSbfPvt(data) {
506
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
507
+ const records = [];
508
+ let messages = 0;
509
+ scanSbfFrames(data, view, (id, b, len) => {
510
+ if (id !== 4007 || len < 96) return;
511
+ messages++;
512
+ const tow = view.getUint32(b + 8, true);
513
+ const wnc = view.getUint16(b + 12, true);
514
+ if (tow === 4294967295 || wnc === 65535) return;
515
+ const modeByte = view.getUint8(b + 14);
516
+ const modeType = modeByte & 15;
517
+ const lat = view.getFloat64(b + 16, true);
518
+ const lon = view.getFloat64(b + 24, true);
519
+ const hgt = view.getFloat64(b + 32, true);
520
+ const nrSV = view.getUint8(b + 74);
521
+ const hAcc = view.getUint16(b + 90, true);
522
+ const vAcc = view.getUint16(b + 92, true);
523
+ const hasFix = lat > DNU_F8 && lon > DNU_F8 && hgt > DNU_F8;
524
+ records.push({
525
+ timeMs: GPS_EPOCH_MS2 + wnc * 6048e5 + tow,
526
+ week: wnc,
527
+ tow: tow / 1e3,
528
+ modeType,
529
+ mode: MODE_LABELS[modeType] ?? `mode-${modeType}`,
530
+ latDeg: hasFix ? lat * RAD2DEG : null,
531
+ lonDeg: hasFix ? lon * RAD2DEG : null,
532
+ heightM: hasFix ? hgt : null,
533
+ nrSV: nrSV === 255 ? null : nrSV,
534
+ hAccuracyM: hAcc === 65535 ? null : hAcc / 100,
535
+ vAccuracyM: vAcc === 65535 ? null : vAcc / 100
536
+ });
537
+ });
538
+ return { records, messages };
539
+ }
540
+
489
541
  // src/sbf/rawnav-gps.ts
490
542
  var WNC_DNU = 65535;
491
543
  function extractSbfLnavSubframe(view, b) {
@@ -621,7 +673,7 @@ function isFnavDummy(page) {
621
673
  }
622
674
 
623
675
  // src/sbf/rawnav-bds.ts
624
- var GPS_EPOCH_MS2 = Date.UTC(1980, 0, 6);
676
+ var GPS_EPOCH_MS3 = Date.UTC(1980, 0, 6);
625
677
  var MS_PER_WEEK2 = 7 * 86400 * 1e3;
626
678
  var TOW_DNU = 4294967295;
627
679
  var WNC_DNU2 = 65535;
@@ -682,7 +734,7 @@ function feedGloBlock(view, b, assembler) {
682
734
  const eph = assembler.push(
683
735
  prn,
684
736
  str2,
685
- new Date(GPS_EPOCH_MS2 + wnc * MS_PER_WEEK2 + towMs),
737
+ new Date(GPS_EPOCH_MS3 + wnc * MS_PER_WEEK2 + towMs),
686
738
  view.getUint8(b + 18) - 8
687
739
  // FreqNr, offset by 8
688
740
  );
@@ -1432,7 +1484,7 @@ function parseSbfHas(data) {
1432
1484
 
1433
1485
  // src/sbf/index.ts
1434
1486
  var CLIGHT = 299792458;
1435
- var GPS_EPOCH_MS3 = Date.UTC(1980, 0, 6);
1487
+ var GPS_EPOCH_MS4 = Date.UTC(1980, 0, 6);
1436
1488
  var MS_PER_WEEK3 = 7 * 864e5;
1437
1489
  var M3_SYS = ["G", "R", "E", "C", "S", "J", "I"];
1438
1490
  var M3_PR_BASE = [19e6, 19e6, 22e6, 2e7, 34e6, 34e6, 34e6];
@@ -2086,7 +2138,7 @@ function parseSbfMeas(data) {
2086
2138
  const tow = view.getUint32(i + 8, true);
2087
2139
  const wnc = view.getUint16(i + 12, true);
2088
2140
  if (tow !== 4294967295 && wnc !== 65535) {
2089
- ensureEpoch(GPS_EPOCH_MS3 + wnc * MS_PER_WEEK3 + tow);
2141
+ ensureEpoch(GPS_EPOCH_MS4 + wnc * MS_PER_WEEK3 + tow);
2090
2142
  if (id === 4109) decodeMeas3Ranges(i, tow);
2091
2143
  else if (id === 4110) decodeMeas3CN0(i, len);
2092
2144
  else if (id === 4111) decodeMeas3Doppler(i, len);
@@ -2105,6 +2157,7 @@ export {
2105
2157
  parseSbfAlmanac,
2106
2158
  parseSbfIonoUtc,
2107
2159
  parseSbfReceiverSetup,
2160
+ parseSbfPvt,
2108
2161
  parseSbfGpsNav,
2109
2162
  parseSbfCnav,
2110
2163
  parseSbfGalNav,
package/dist/index.cjs CHANGED
@@ -269,6 +269,7 @@ __export(src_exports, {
269
269
  parseSbfIonoUtc: () => parseSbfIonoUtc,
270
270
  parseSbfMeas: () => parseSbfMeas,
271
271
  parseSbfNav: () => parseSbfNav,
272
+ parseSbfPvt: () => parseSbfPvt,
272
273
  parseSbfReceiverSetup: () => parseSbfReceiverSetup,
273
274
  parseSinexBiasDcb: () => parseSinexBiasDcb,
274
275
  parseSourcetable: () => parseSourcetable,
@@ -7509,6 +7510,58 @@ function parseSbfReceiverSetup(data) {
7509
7510
  return out;
7510
7511
  }
7511
7512
 
7513
+ // src/sbf/pvt.ts
7514
+ var GPS_EPOCH_MS11 = Date.UTC(1980, 0, 6);
7515
+ var RAD2DEG = 180 / Math.PI;
7516
+ var DNU_F8 = -2e10;
7517
+ var MODE_LABELS = {
7518
+ 0: "no-pvt",
7519
+ 1: "standalone",
7520
+ 2: "differential",
7521
+ 3: "fixed-location",
7522
+ 4: "rtk-fixed",
7523
+ 5: "rtk-float",
7524
+ 6: "sbas-aided",
7525
+ 7: "moving-base-rtk-fixed",
7526
+ 8: "moving-base-rtk-float",
7527
+ 10: "ppp"
7528
+ };
7529
+ function parseSbfPvt(data) {
7530
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
7531
+ const records = [];
7532
+ let messages = 0;
7533
+ scanSbfFrames(data, view, (id, b, len) => {
7534
+ if (id !== 4007 || len < 96) return;
7535
+ messages++;
7536
+ const tow = view.getUint32(b + 8, true);
7537
+ const wnc = view.getUint16(b + 12, true);
7538
+ if (tow === 4294967295 || wnc === 65535) return;
7539
+ const modeByte = view.getUint8(b + 14);
7540
+ const modeType = modeByte & 15;
7541
+ const lat = view.getFloat64(b + 16, true);
7542
+ const lon = view.getFloat64(b + 24, true);
7543
+ const hgt = view.getFloat64(b + 32, true);
7544
+ const nrSV = view.getUint8(b + 74);
7545
+ const hAcc = view.getUint16(b + 90, true);
7546
+ const vAcc = view.getUint16(b + 92, true);
7547
+ const hasFix = lat > DNU_F8 && lon > DNU_F8 && hgt > DNU_F8;
7548
+ records.push({
7549
+ timeMs: GPS_EPOCH_MS11 + wnc * 6048e5 + tow,
7550
+ week: wnc,
7551
+ tow: tow / 1e3,
7552
+ modeType,
7553
+ mode: MODE_LABELS[modeType] ?? `mode-${modeType}`,
7554
+ latDeg: hasFix ? lat * RAD2DEG : null,
7555
+ lonDeg: hasFix ? lon * RAD2DEG : null,
7556
+ heightM: hasFix ? hgt : null,
7557
+ nrSV: nrSV === 255 ? null : nrSV,
7558
+ hAccuracyM: hAcc === 65535 ? null : hAcc / 100,
7559
+ vAccuracyM: vAcc === 65535 ? null : vAcc / 100
7560
+ });
7561
+ });
7562
+ return { records, messages };
7563
+ }
7564
+
7512
7565
  // src/sbf/rawnav-gps.ts
7513
7566
  var WNC_DNU = 65535;
7514
7567
  function extractSbfLnavSubframe(view, b) {
@@ -7644,7 +7697,7 @@ function isFnavDummy(page) {
7644
7697
  }
7645
7698
 
7646
7699
  // src/sbf/rawnav-bds.ts
7647
- var GPS_EPOCH_MS11 = Date.UTC(1980, 0, 6);
7700
+ var GPS_EPOCH_MS12 = Date.UTC(1980, 0, 6);
7648
7701
  var MS_PER_WEEK6 = 7 * 86400 * 1e3;
7649
7702
  var TOW_DNU = 4294967295;
7650
7703
  var WNC_DNU2 = 65535;
@@ -7705,7 +7758,7 @@ function feedGloBlock(view, b, assembler) {
7705
7758
  const eph = assembler.push(
7706
7759
  prn,
7707
7760
  str2,
7708
- new Date(GPS_EPOCH_MS11 + wnc * MS_PER_WEEK6 + towMs),
7761
+ new Date(GPS_EPOCH_MS12 + wnc * MS_PER_WEEK6 + towMs),
7709
7762
  view.getUint8(b + 18) - 8
7710
7763
  // FreqNr, offset by 8
7711
7764
  );
@@ -8455,7 +8508,7 @@ function parseSbfHas(data) {
8455
8508
 
8456
8509
  // src/sbf/index.ts
8457
8510
  var CLIGHT = 299792458;
8458
- var GPS_EPOCH_MS12 = Date.UTC(1980, 0, 6);
8511
+ var GPS_EPOCH_MS13 = Date.UTC(1980, 0, 6);
8459
8512
  var MS_PER_WEEK7 = 7 * 864e5;
8460
8513
  var M3_SYS = ["G", "R", "E", "C", "S", "J", "I"];
8461
8514
  var M3_PR_BASE = [19e6, 19e6, 22e6, 2e7, 34e6, 34e6, 34e6];
@@ -9109,7 +9162,7 @@ function parseSbfMeas(data) {
9109
9162
  const tow = view.getUint32(i + 8, true);
9110
9163
  const wnc = view.getUint16(i + 12, true);
9111
9164
  if (tow !== 4294967295 && wnc !== 65535) {
9112
- ensureEpoch(GPS_EPOCH_MS12 + wnc * MS_PER_WEEK7 + tow);
9165
+ ensureEpoch(GPS_EPOCH_MS13 + wnc * MS_PER_WEEK7 + tow);
9113
9166
  if (id === 4109) decodeMeas3Ranges(i, tow);
9114
9167
  else if (id === 4110) decodeMeas3CN0(i, len);
9115
9168
  else if (id === 4111) decodeMeas3Doppler(i, len);
@@ -9176,15 +9229,15 @@ var ID_GPSEPHEM = 7;
9176
9229
  var ID_BDSEPHEMERIS = 1696;
9177
9230
  var ID_RAWWAASFRAME = 287;
9178
9231
  var ID_RAWSBASFRAME = 973;
9179
- var GPS_EPOCH_MS13 = Date.UTC(1980, 0, 6);
9232
+ var GPS_EPOCH_MS14 = Date.UTC(1980, 0, 6);
9180
9233
  var BDT_EPOCH_MS3 = Date.UTC(2006, 0, 1);
9181
9234
  var SEC_PER_WEEK9 = 7 * 86400;
9182
9235
  var SEC_PER_DAY2 = 86400;
9183
9236
  var MS_PER_WEEK8 = SEC_PER_WEEK9 * 1e3;
9184
- var gpsMs2 = (week, sec) => GPS_EPOCH_MS13 + week * MS_PER_WEEK8 + sec * 1e3;
9237
+ var gpsMs2 = (week, sec) => GPS_EPOCH_MS14 + week * MS_PER_WEEK8 + sec * 1e3;
9185
9238
  var sowOf3 = (dateMs) => dateMs / 1e3 % SEC_PER_WEEK9;
9186
9239
  function nearWeekMs(refMs, sow) {
9187
- const refWeek = Math.floor((refMs - GPS_EPOCH_MS13) / MS_PER_WEEK8);
9240
+ const refWeek = Math.floor((refMs - GPS_EPOCH_MS14) / MS_PER_WEEK8);
9188
9241
  let ms = gpsMs2(refWeek, sow);
9189
9242
  if (ms < refMs - MS_PER_WEEK8 / 2) ms += MS_PER_WEEK8;
9190
9243
  else if (ms > refMs + MS_PER_WEEK8 / 2) ms -= MS_PER_WEEK8;
@@ -9211,9 +9264,9 @@ function decodeGloEphemeris(view, p) {
9211
9264
  tof += Math.floor(tow / SEC_PER_DAY2) * SEC_PER_DAY2;
9212
9265
  if (tof < tow - 43200) tof += SEC_PER_DAY2;
9213
9266
  else if (tof > tow + 43200) tof -= SEC_PER_DAY2;
9214
- const toeGpsMs = GPS_EPOCH_MS13 + (week * SEC_PER_WEEK9 + tow) * 1e3;
9215
- const tofGpsMs = GPS_EPOCH_MS13 + (week * SEC_PER_WEEK9 + tof) * 1e3;
9216
- const tofUtcSec = (getUtcDate(new Date(tofGpsMs)).getTime() - GPS_EPOCH_MS13) / 1e3;
9267
+ const toeGpsMs = GPS_EPOCH_MS14 + (week * SEC_PER_WEEK9 + tow) * 1e3;
9268
+ const tofGpsMs = GPS_EPOCH_MS14 + (week * SEC_PER_WEEK9 + tof) * 1e3;
9269
+ const tofUtcSec = (getUtcDate(new Date(tofGpsMs)).getTime() - GPS_EPOCH_MS14) / 1e3;
9217
9270
  return {
9218
9271
  system: "R",
9219
9272
  prn: `R${String(slot).padStart(2, "0")}`,
@@ -9278,7 +9331,7 @@ function decodeGalEphemeris(view, p, headerMs) {
9278
9331
  omega: view.getFloat64(p + 60, true),
9279
9332
  omegaDot: view.getFloat64(p + 140, true),
9280
9333
  idot: view.getFloat64(p + 124, true),
9281
- week: Math.floor((toeMs - GPS_EPOCH_MS13) / MS_PER_WEEK8),
9334
+ week: Math.floor((toeMs - GPS_EPOCH_MS14) / MS_PER_WEEK8),
9282
9335
  // RINEX Galileo SVH bit layout (E1B DVS/HS in bits 0-2, E5a in
9283
9336
  // 3-5, E5b in 6-8) — same packing as RTKLIB.
9284
9337
  svHealth: svhE5b << 7 | dvsE5b << 6 | svhE5a << 4 | dvsE5a << 3 | svhE1b << 1 | dvsE1b,
@@ -9465,7 +9518,7 @@ function parseNovatelNav(data, opts = {}) {
9465
9518
  }
9466
9519
 
9467
9520
  // src/novatel/index.ts
9468
- var GPS_EPOCH_MS14 = Date.UTC(1980, 0, 6);
9521
+ var GPS_EPOCH_MS15 = Date.UTC(1980, 0, 6);
9469
9522
  var MS_PER_WEEK9 = 7 * 864e5;
9470
9523
  var HDR = 28;
9471
9524
  var ID_RANGE = 43;
@@ -9635,7 +9688,7 @@ function parseNovatelRange(data) {
9635
9688
  if (!codes.includes(code)) codes.push(code);
9636
9689
  }
9637
9690
  epochs.push({
9638
- timeMs: GPS_EPOCH_MS14 + week * MS_PER_WEEK9 + towMs,
9691
+ timeMs: GPS_EPOCH_MS15 + week * MS_PER_WEEK9 + towMs,
9639
9692
  meas
9640
9693
  });
9641
9694
  }
@@ -9687,7 +9740,7 @@ function parseNovatelRange(data) {
9687
9740
  if (!codes.includes(code)) codes.push(code);
9688
9741
  }
9689
9742
  epochs.push({
9690
- timeMs: GPS_EPOCH_MS14 + week * MS_PER_WEEK9 + towMs,
9743
+ timeMs: GPS_EPOCH_MS15 + week * MS_PER_WEEK9 + towMs,
9691
9744
  meas
9692
9745
  });
9693
9746
  }
@@ -9738,14 +9791,14 @@ function* trimbleFrames(data, stats) {
9738
9791
  }
9739
9792
 
9740
9793
  // src/trimble/nav.ts
9741
- var GPS_EPOCH_MS15 = Date.UTC(1980, 0, 6);
9794
+ var GPS_EPOCH_MS16 = Date.UTC(1980, 0, 6);
9742
9795
  var BDT_EPOCH_MS4 = Date.UTC(2006, 0, 1);
9743
9796
  var SEC_PER_WEEK10 = 7 * 86400;
9744
9797
  var MS_PER_WEEK10 = SEC_PER_WEEK10 * 1e3;
9745
9798
  var GPS_PI2 = 3.1415926535898;
9746
9799
  var BDS_WEEK_OFFSET = 1356;
9747
9800
  var BDS_LEAP_SEC = 14;
9748
- var gpsMs3 = (week, sec) => GPS_EPOCH_MS15 + week * MS_PER_WEEK10 + sec * 1e3;
9801
+ var gpsMs3 = (week, sec) => GPS_EPOCH_MS16 + week * MS_PER_WEEK10 + sec * 1e3;
9749
9802
  var sowOf4 = (dateMs) => dateMs / 1e3 % SEC_PER_WEEK10;
9750
9803
  var SUB_GPS_EPHEMERIS = 1;
9751
9804
  var SUB_ION_UTC = 3;
@@ -9898,7 +9951,7 @@ function decodeGloEphemeris2(view, base) {
9898
9951
  // RINEX stores −τn as the clock bias; the record carries τn (ICD sign).
9899
9952
  tauN: -view.getFloat64(base + 113, false),
9900
9953
  gammaN: view.getFloat64(base + 121, false),
9901
- messageFrameTime: (tocMs - GPS_EPOCH_MS15) / 1e3 % SEC_PER_WEEK10,
9954
+ messageFrameTime: (tocMs - GPS_EPOCH_MS16) / 1e3 % SEC_PER_WEEK10,
9902
9955
  // State vector: metres / m·s⁻¹ / m·s⁻² → km / km·s⁻¹ / km·s⁻².
9903
9956
  x: view.getFloat64(base + 33, false) / 1e3,
9904
9957
  xDot: view.getFloat64(base + 41, false) / 1e3,
@@ -9969,7 +10022,7 @@ function parseTrimbleNav(data) {
9969
10022
  }
9970
10023
 
9971
10024
  // src/trimble/index.ts
9972
- var GPS_EPOCH_MS16 = Date.UTC(1980, 0, 6);
10025
+ var GPS_EPOCH_MS17 = Date.UTC(1980, 0, 6);
9973
10026
  var MS_PER_WEEK11 = 7 * 864e5;
9974
10027
  var REC_TYPE_27 = 6;
9975
10028
  var SYS = {
@@ -10167,7 +10220,7 @@ function decodeEpoch(epoch, epochs, obsCodes) {
10167
10220
  o += c.length;
10168
10221
  }
10169
10222
  const dv = new DataView(M.buffer, M.byteOffset, M.byteLength);
10170
- const timeMs = GPS_EPOCH_MS16 + epoch.week * MS_PER_WEEK11 + epoch.towMs;
10223
+ const timeMs = GPS_EPOCH_MS17 + epoch.week * MS_PER_WEEK11 + epoch.towMs;
10171
10224
  const meas = [];
10172
10225
  let q = 0;
10173
10226
  for (let sv = 0; sv < epoch.nsv && q + 8 <= M.length; sv++) {
@@ -10348,13 +10401,13 @@ function* binexRecords(data, view, stats) {
10348
10401
  }
10349
10402
 
10350
10403
  // src/binex/nav.ts
10351
- var GPS_EPOCH_MS17 = Date.UTC(1980, 0, 6);
10404
+ var GPS_EPOCH_MS18 = Date.UTC(1980, 0, 6);
10352
10405
  var GLO_DAY0_MS = Date.UTC(1980, 0, 1);
10353
10406
  var BDT_EPOCH_MS5 = Date.UTC(2006, 0, 1);
10354
10407
  var SEC_PER_WEEK11 = 7 * 86400;
10355
10408
  var MS_PER_WEEK12 = SEC_PER_WEEK11 * 1e3;
10356
10409
  var SC2RAD = GPS_PI;
10357
- var gpsMs4 = (week, sec) => GPS_EPOCH_MS17 + week * MS_PER_WEEK12 + sec * 1e3;
10410
+ var gpsMs4 = (week, sec) => GPS_EPOCH_MS18 + week * MS_PER_WEEK12 + sec * 1e3;
10358
10411
  var sowOf5 = (dateMs) => (dateMs / 1e3 % SEC_PER_WEEK11 + SEC_PER_WEEK11) % SEC_PER_WEEK11;
10359
10412
  var two6 = (n) => String(n).padStart(2, "0");
10360
10413
  var Reader = class {
@@ -10642,7 +10695,7 @@ function decodeBinexEph(view, body, len, le) {
10642
10695
  }
10643
10696
 
10644
10697
  // src/binex/index.ts
10645
- var GPS_EPOCH_MS18 = Date.UTC(1980, 0, 6);
10698
+ var GPS_EPOCH_MS19 = Date.UTC(1980, 0, 6);
10646
10699
  var CLIGHT2 = 299792458;
10647
10700
  var OBS_CODES = {
10648
10701
  0: [
@@ -10900,7 +10953,7 @@ function decodeObsRecord(data, view, body, len, obsCodes) {
10900
10953
  p += 4;
10901
10954
  const msec = view.getUint16(p);
10902
10955
  p += 2;
10903
- const timeMs = GPS_EPOCH_MS18 + min * 6e4 + msec;
10956
+ const timeMs = GPS_EPOCH_MS19 + min * 6e4 + msec;
10904
10957
  const flag = data[p++];
10905
10958
  const nsat = (flag & 63) + 1;
10906
10959
  if (flag & 128) p += 3;
@@ -10986,7 +11039,7 @@ function parseBinex(data) {
10986
11039
  var GM_GPS = 3986005e8;
10987
11040
  var GM_GAL = 3986004418e5;
10988
11041
  var GM_BDS = 3986004418e5;
10989
- var GPS_EPOCH_MS19 = Date.UTC(1980, 0, 6);
11042
+ var GPS_EPOCH_MS20 = Date.UTC(1980, 0, 6);
10990
11043
  var BDT_EPOCH_MS6 = Date.UTC(2006, 0, 1);
10991
11044
  var WEEK_MS = 6048e5;
10992
11045
  var BDT_MINUS_GPST_MS = 14e3;
@@ -10995,7 +11048,7 @@ function almanacEpochMs(alm) {
10995
11048
  if (alm.system === "C") {
10996
11049
  return BDT_EPOCH_MS6 + alm.weekAlm * WEEK_MS + alm.toaSec * 1e3 + BDT_MINUS_GPST_MS;
10997
11050
  }
10998
- return GPS_EPOCH_MS19 + alm.weekAlm * WEEK_MS + alm.toaSec * 1e3;
11051
+ return GPS_EPOCH_MS20 + alm.weekAlm * WEEK_MS + alm.toaSec * 1e3;
10999
11052
  }
11000
11053
  function almanacSatPosition(alm, timeMs) {
11001
11054
  const GM = alm.system === "E" ? GM_GAL : alm.system === "C" ? GM_BDS : GM_GPS;
@@ -11504,10 +11557,10 @@ function selectBest(ephs, timeMs) {
11504
11557
  }
11505
11558
  return best;
11506
11559
  }
11507
- var GPS_EPOCH_MS20 = START_GPS_TIME.getTime();
11560
+ var GPS_EPOCH_MS21 = START_GPS_TIME.getTime();
11508
11561
  var MS_PER_WEEK13 = 7 * 864e5;
11509
11562
  var BDS_EPOCH_MS = START_BDS_TIME.getTime();
11510
- var GAL_EPOCH_MS = GPS_EPOCH_MS20 + 1024 * MS_PER_WEEK13;
11563
+ var GAL_EPOCH_MS = GPS_EPOCH_MS21 + 1024 * MS_PER_WEEK13;
11511
11564
  function ephInfoToEphemeris(info) {
11512
11565
  const sys = info.prn.charAt(0);
11513
11566
  if (sys === "R") {
@@ -11558,8 +11611,8 @@ function ephInfoToEphemeris(info) {
11558
11611
  } else if (sys === "E") {
11559
11612
  epochMs = GAL_EPOCH_MS;
11560
11613
  } else {
11561
- epochMs = GPS_EPOCH_MS20;
11562
- const weeksNow = (info.lastReceived - GPS_EPOCH_MS20) / MS_PER_WEEK13;
11614
+ epochMs = GPS_EPOCH_MS21;
11615
+ const weeksNow = (info.lastReceived - GPS_EPOCH_MS21) / MS_PER_WEEK13;
11563
11616
  week += 1024 * Math.round((weeksNow - week) / 1024);
11564
11617
  }
11565
11618
  const tocDate = new Date(epochMs + week * MS_PER_WEEK13 + tocSec * 1e3);
@@ -17779,6 +17832,7 @@ function computePsdDb(centerMHz, halfSpanChips, numPoints, psdFn, f0 = 1023e3, f
17779
17832
  parseSbfIonoUtc,
17780
17833
  parseSbfMeas,
17781
17834
  parseSbfNav,
17835
+ parseSbfPvt,
17782
17836
  parseSbfReceiverSetup,
17783
17837
  parseSinexBiasDcb,
17784
17838
  parseSourcetable,
package/dist/index.d.cts CHANGED
@@ -11,7 +11,7 @@ export { C as ClkFile, I as IonexGrid, S as Sp3File, a as Sp3Sample, c as clkBia
11
11
  export { B as BitReader, E as EphemerisInfo, R as Rtcm3DebugHandler, a as Rtcm3Decoder, b as Rtcm3Frame, d as decodeEphemeris, r as readString, c as reportDecodeError, s as setRtcm3DebugHandler } from './ephemeris-Ohl6NAfw.cjs';
12
12
  export { MessageTypeStats, MsmEpoch, MsmSatObs, MsmSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, StationMeta, StreamStats, createStationMeta, createStreamStats, decodeMsmFull, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.cjs';
13
13
  export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawNavOptions, UbxRawNavResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawNav, parseUbxRawx, ubxFrames } from './ubx.cjs';
14
- export { HasMessage, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGeoNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavigation, SbfParseResult, SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfReceiverSetup, sbfCrc16, scanSbfFrames } from './sbf.cjs';
14
+ export { HasMessage, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGeoNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavigation, SbfParseResult, SbfPvt, SbfPvtResult, SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfPvt, parseSbfReceiverSetup, sbfCrc16, scanSbfFrames } from './sbf.cjs';
15
15
  export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelRange } from './novatel.cjs';
16
16
  export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, TrimbleParseResult, parseTrimble, parseTrimbleNav, trimbleFrames } from './trimble.cjs';
17
17
  export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.cjs';
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export { C as ClkFile, I as IonexGrid, S as Sp3File, a as Sp3Sample, c as clkBia
11
11
  export { B as BitReader, E as EphemerisInfo, R as Rtcm3DebugHandler, a as Rtcm3Decoder, b as Rtcm3Frame, d as decodeEphemeris, r as readString, c as reportDecodeError, s as setRtcm3DebugHandler } from './ephemeris-Ohl6NAfw.js';
12
12
  export { MessageTypeStats, MsmEpoch, MsmSatObs, MsmSignal, RTCM3_MESSAGE_NAMES, SatCn0, SignalCn0, StationMeta, StreamStats, createStationMeta, createStreamStats, decodeMsmFull, msmEpochToDate, resetGloFreqCache, rtcm3Constellation, setGloFreqNumber, updateStationMeta, updateStreamStats } from './rtcm3.js';
13
13
  export { UbxCnavResult, UbxFrame, UbxIonoUtcResult, UbxMeasurement, UbxNavOptions, UbxNavResult, UbxParseResult, UbxRawNavOptions, UbxRawNavResult, UbxRawxEpoch, parseUbxCnav, parseUbxIonoUtc, parseUbxNav, parseUbxRawNav, parseUbxRawx, ubxFrames } from './ubx.js';
14
- export { HasMessage, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGeoNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavigation, SbfParseResult, SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfReceiverSetup, sbfCrc16, scanSbfFrames } from './sbf.js';
14
+ export { HasMessage, SbfBdsNavResult, SbfCnavEphemeris, SbfCnavResult, SbfGalEphemeris, SbfGalNavResult, SbfGeoNavResult, SbfGloNavResult, SbfGpsNavResult, SbfHasMessage, SbfHasResult, SbfIonoUtcResult, SbfMeasEpoch, SbfMeasurement, SbfNavCounts, SbfNavigation, SbfParseResult, SbfPvt, SbfPvtResult, SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfPvt, parseSbfReceiverSetup, sbfCrc16, scanSbfFrames } from './sbf.js';
15
15
  export { NovatelEpoch, NovatelMeasurement, NovatelNavResult, NovatelParseResult, OEM4_HLEN, Oem4Frame, crc32, oem4Frames, parseNovatelNav, parseNovatelRange } from './novatel.js';
16
16
  export { TrimbleEpoch, TrimbleFrame, TrimbleMeasurement, TrimbleNavResult, TrimbleParseResult, parseTrimble, parseTrimbleNav, trimbleFrames } from './trimble.js';
17
17
  export { BinexEpoch, BinexMeasurement, BinexParseResult, BinexRecord, binexCrc16, binexCrc32, binexCsum8, binexRecords, decodeBinexEph, getBnxi, parseBinex } from './binex.js';
package/dist/index.js CHANGED
@@ -66,9 +66,10 @@ import {
66
66
  parseSbfIonoUtc,
67
67
  parseSbfMeas,
68
68
  parseSbfNav,
69
+ parseSbfPvt,
69
70
  parseSbfReceiverSetup,
70
71
  scanSbfFrames
71
- } from "./chunk-DE5IUULR.js";
72
+ } from "./chunk-ZPNMIUNZ.js";
72
73
  import "./chunk-FA2UTLEQ.js";
73
74
  import {
74
75
  OEM4_HLEN,
@@ -606,6 +607,7 @@ export {
606
607
  parseSbfIonoUtc,
607
608
  parseSbfMeas,
608
609
  parseSbfNav,
610
+ parseSbfPvt,
609
611
  parseSbfReceiverSetup,
610
612
  parseSinexBiasDcb,
611
613
  parseSourcetable,
package/dist/sbf.cjs CHANGED
@@ -33,6 +33,7 @@ __export(sbf_exports, {
33
33
  parseSbfIonoUtc: () => parseSbfIonoUtc,
34
34
  parseSbfMeas: () => parseSbfMeas,
35
35
  parseSbfNav: () => parseSbfNav,
36
+ parseSbfPvt: () => parseSbfPvt,
36
37
  parseSbfReceiverSetup: () => parseSbfReceiverSetup,
37
38
  sbfCrc16: () => crc16,
38
39
  scanSbfFrames: () => scanSbfFrames
@@ -601,9 +602,61 @@ function parseSbfReceiverSetup(data) {
601
602
  return out;
602
603
  }
603
604
 
605
+ // src/sbf/pvt.ts
606
+ var GPS_EPOCH_MS2 = Date.UTC(1980, 0, 6);
607
+ var RAD2DEG = 180 / Math.PI;
608
+ var DNU_F8 = -2e10;
609
+ var MODE_LABELS = {
610
+ 0: "no-pvt",
611
+ 1: "standalone",
612
+ 2: "differential",
613
+ 3: "fixed-location",
614
+ 4: "rtk-fixed",
615
+ 5: "rtk-float",
616
+ 6: "sbas-aided",
617
+ 7: "moving-base-rtk-fixed",
618
+ 8: "moving-base-rtk-float",
619
+ 10: "ppp"
620
+ };
621
+ function parseSbfPvt(data) {
622
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
623
+ const records = [];
624
+ let messages = 0;
625
+ scanSbfFrames(data, view, (id, b, len) => {
626
+ if (id !== 4007 || len < 96) return;
627
+ messages++;
628
+ const tow = view.getUint32(b + 8, true);
629
+ const wnc = view.getUint16(b + 12, true);
630
+ if (tow === 4294967295 || wnc === 65535) return;
631
+ const modeByte = view.getUint8(b + 14);
632
+ const modeType = modeByte & 15;
633
+ const lat = view.getFloat64(b + 16, true);
634
+ const lon = view.getFloat64(b + 24, true);
635
+ const hgt = view.getFloat64(b + 32, true);
636
+ const nrSV = view.getUint8(b + 74);
637
+ const hAcc = view.getUint16(b + 90, true);
638
+ const vAcc = view.getUint16(b + 92, true);
639
+ const hasFix = lat > DNU_F8 && lon > DNU_F8 && hgt > DNU_F8;
640
+ records.push({
641
+ timeMs: GPS_EPOCH_MS2 + wnc * 6048e5 + tow,
642
+ week: wnc,
643
+ tow: tow / 1e3,
644
+ modeType,
645
+ mode: MODE_LABELS[modeType] ?? `mode-${modeType}`,
646
+ latDeg: hasFix ? lat * RAD2DEG : null,
647
+ lonDeg: hasFix ? lon * RAD2DEG : null,
648
+ heightM: hasFix ? hgt : null,
649
+ nrSV: nrSV === 255 ? null : nrSV,
650
+ hAccuracyM: hAcc === 65535 ? null : hAcc / 100,
651
+ vAccuracyM: vAcc === 65535 ? null : vAcc / 100
652
+ });
653
+ });
654
+ return { records, messages };
655
+ }
656
+
604
657
  // src/navbits/index.ts
605
658
  var GPS_PI = 3.1415926535898;
606
- var GPS_EPOCH_MS2 = Date.UTC(1980, 0, 6);
659
+ var GPS_EPOCH_MS3 = Date.UTC(1980, 0, 6);
607
660
  var SEC_PER_WEEK2 = 7 * 86400;
608
661
  function getBitU(buff, pos, len) {
609
662
  let bits = 0;
@@ -733,13 +786,13 @@ function decodeGpsLnavFrame(subframes, opts = {}) {
733
786
  const iodc = iodc0 * 256 + iodc1;
734
787
  if (id1 !== 1 || id2 !== 2 || id3 !== 3) return null;
735
788
  if (iode3 !== iode || iode !== (iodc & 255)) return null;
736
- const ref = opts.refWeek ?? Math.floor((Date.now() - GPS_EPOCH_MS2) / 1e3 / SEC_PER_WEEK2);
789
+ const ref = opts.refWeek ?? Math.floor((Date.now() - GPS_EPOCH_MS3) / 1e3 / SEC_PER_WEEK2);
737
790
  let week = week10 + 1024 * Math.round((ref - week10) / 1024);
738
791
  if (toes < tow1 - 302400) week++;
739
792
  else if (toes > tow1 + 302400) week--;
740
793
  const prn = opts.prn ?? "G00";
741
794
  const tocDate = new Date(
742
- GPS_EPOCH_MS2 + (week * SEC_PER_WEEK2 + tocSec) * 1e3
795
+ GPS_EPOCH_MS3 + (week * SEC_PER_WEEK2 + tocSec) * 1e3
743
796
  );
744
797
  return {
745
798
  system: prn[0] === "J" ? "J" : "G",
@@ -812,7 +865,7 @@ function parseSbfGpsNav(data) {
812
865
  }
813
866
 
814
867
  // src/navbits/cnav.ts
815
- var GPS_EPOCH_MS3 = Date.UTC(1980, 0, 6);
868
+ var GPS_EPOCH_MS4 = Date.UTC(1980, 0, 6);
816
869
  var SEC_PER_WEEK3 = 7 * 86400;
817
870
  var HALF_WEEK = 302400;
818
871
  var CNAV_PREAMBLE = 139;
@@ -917,7 +970,7 @@ function resolveWeek(week, towSec, sec) {
917
970
  return week;
918
971
  }
919
972
  function gpsDate(week, sec) {
920
- return new Date(GPS_EPOCH_MS3 + (week * SEC_PER_WEEK3 + sec) * 1e3);
973
+ return new Date(GPS_EPOCH_MS4 + (week * SEC_PER_WEEK3 + sec) * 1e3);
921
974
  }
922
975
  var CnavAssembler = class {
923
976
  sats = /* @__PURE__ */ new Map();
@@ -1047,7 +1100,7 @@ function parseSbfCnav(data) {
1047
1100
  }
1048
1101
 
1049
1102
  // src/navbits/gal.ts
1050
- var GPS_EPOCH_MS4 = Date.UTC(1980, 0, 6);
1103
+ var GPS_EPOCH_MS5 = Date.UTC(1980, 0, 6);
1051
1104
  var SEC_PER_WEEK4 = 7 * 86400;
1052
1105
  var HALF_WEEK2 = 302400;
1053
1106
  var GST_GPS_WEEK_OFFSET = 1024;
@@ -1060,7 +1113,7 @@ function galFnavPageCrcOk(page) {
1060
1113
  return crc24q(page, 214) === getBitU(page, 214, 24);
1061
1114
  }
1062
1115
  function gpsDate2(week, sec) {
1063
- return new Date(GPS_EPOCH_MS4 + (week * SEC_PER_WEEK4 + sec) * 1e3);
1116
+ return new Date(GPS_EPOCH_MS5 + (week * SEC_PER_WEEK4 + sec) * 1e3);
1064
1117
  }
1065
1118
  function weekOfToe(week, tow, toe) {
1066
1119
  if (toe - tow > HALF_WEEK2) return week - 1;
@@ -1691,7 +1744,7 @@ var BdsAssembler = class {
1691
1744
  };
1692
1745
 
1693
1746
  // src/navbits/glo.ts
1694
- var GPS_EPOCH_MS5 = Date.UTC(1980, 0, 6);
1747
+ var GPS_EPOCH_MS6 = Date.UTC(1980, 0, 6);
1695
1748
  var SEC_PER_WEEK6 = 7 * 86400;
1696
1749
  var SEC_PER_DAY = 86400;
1697
1750
  var GLO_STRING_BYTES = 10;
@@ -1785,7 +1838,7 @@ function decodeGloStrings(strings, refDate, opts = {}) {
1785
1838
  const slot = getBitU(b, i, 5);
1786
1839
  if (frn1 !== 1 || frn2 !== 2 || frn3 !== 3 || frn4 !== 4) return null;
1787
1840
  if (slot < 1 || slot > 27) return null;
1788
- const utcSec = (getUtcDate(refDate).getTime() - GPS_EPOCH_MS5) / 1e3;
1841
+ const utcSec = (getUtcDate(refDate).getTime() - GPS_EPOCH_MS6) / 1e3;
1789
1842
  const week = Math.floor(utcSec / SEC_PER_WEEK6);
1790
1843
  let tow = utcSec - week * SEC_PER_WEEK6;
1791
1844
  const tod = tow % SEC_PER_DAY;
@@ -1800,7 +1853,7 @@ function decodeGloStrings(strings, refDate, opts = {}) {
1800
1853
  system: "R",
1801
1854
  prn: `R${String(slot).padStart(2, "0")}`,
1802
1855
  // RINEX GLONASS epochs are UTC: build the UTC toe Date directly.
1803
- tocDate: new Date(GPS_EPOCH_MS5 + (week * SEC_PER_WEEK6 + tow + toe) * 1e3),
1856
+ tocDate: new Date(GPS_EPOCH_MS6 + (week * SEC_PER_WEEK6 + tow + toe) * 1e3),
1804
1857
  tauN: -tauN,
1805
1858
  // RINEX stores −τn; the SIS carries τn (ICD sign)
1806
1859
  gammaN,
@@ -1854,7 +1907,7 @@ var GloStringAssembler = class {
1854
1907
  };
1855
1908
 
1856
1909
  // src/sbf/rawnav-bds.ts
1857
- var GPS_EPOCH_MS6 = Date.UTC(1980, 0, 6);
1910
+ var GPS_EPOCH_MS7 = Date.UTC(1980, 0, 6);
1858
1911
  var MS_PER_WEEK3 = 7 * 86400 * 1e3;
1859
1912
  var TOW_DNU = 4294967295;
1860
1913
  var WNC_DNU2 = 65535;
@@ -1915,7 +1968,7 @@ function feedGloBlock(view, b, assembler) {
1915
1968
  const eph = assembler.push(
1916
1969
  prn,
1917
1970
  str2,
1918
- new Date(GPS_EPOCH_MS6 + wnc * MS_PER_WEEK3 + towMs),
1971
+ new Date(GPS_EPOCH_MS7 + wnc * MS_PER_WEEK3 + towMs),
1919
1972
  view.getUint8(b + 18) - 8
1920
1973
  // FreqNr, offset by 8
1921
1974
  );
@@ -1938,7 +1991,7 @@ function parseSbfGloNav(data) {
1938
1991
  }
1939
1992
 
1940
1993
  // src/navbits/sbas.ts
1941
- var GPS_EPOCH_MS7 = Date.UTC(1980, 0, 6);
1994
+ var GPS_EPOCH_MS8 = Date.UTC(1980, 0, 6);
1942
1995
  var MS_PER_WEEK4 = 7 * 86400 * 1e3;
1943
1996
  var two3 = (n) => String(n).padStart(2, "0");
1944
1997
  var SBAS_MT_GEO_NAV = 9;
@@ -1960,7 +2013,7 @@ function decodeSbasGeoNav(msg, prn, week, tow) {
1960
2013
  return {
1961
2014
  system: "S",
1962
2015
  prn: `S${two3(prn - 100)}`,
1963
- tocDate: new Date(GPS_EPOCH_MS7 + week * MS_PER_WEEK4 + t0Sec * 1e3),
2016
+ tocDate: new Date(GPS_EPOCH_MS8 + week * MS_PER_WEEK4 + t0Sec * 1e3),
1964
2017
  tauN: getBitS(msg, 206, 12) * 2 ** -31,
1965
2018
  // a_Gf0, clock offset (s)
1966
2019
  gammaN: getBitS(msg, 218, 8) * 2 ** -39 / 2,
@@ -2708,7 +2761,7 @@ function parseSbfHas(data) {
2708
2761
 
2709
2762
  // src/sbf/index.ts
2710
2763
  var CLIGHT = 299792458;
2711
- var GPS_EPOCH_MS8 = Date.UTC(1980, 0, 6);
2764
+ var GPS_EPOCH_MS9 = Date.UTC(1980, 0, 6);
2712
2765
  var MS_PER_WEEK5 = 7 * 864e5;
2713
2766
  var M3_SYS = ["G", "R", "E", "C", "S", "J", "I"];
2714
2767
  var M3_PR_BASE = [19e6, 19e6, 22e6, 2e7, 34e6, 34e6, 34e6];
@@ -3362,7 +3415,7 @@ function parseSbfMeas(data) {
3362
3415
  const tow = view.getUint32(i + 8, true);
3363
3416
  const wnc = view.getUint16(i + 12, true);
3364
3417
  if (tow !== 4294967295 && wnc !== 65535) {
3365
- ensureEpoch(GPS_EPOCH_MS8 + wnc * MS_PER_WEEK5 + tow);
3418
+ ensureEpoch(GPS_EPOCH_MS9 + wnc * MS_PER_WEEK5 + tow);
3366
3419
  if (id === 4109) decodeMeas3Ranges(i, tow);
3367
3420
  else if (id === 4110) decodeMeas3CN0(i, len);
3368
3421
  else if (id === 4111) decodeMeas3Doppler(i, len);
@@ -3388,6 +3441,7 @@ function parseSbfMeas(data) {
3388
3441
  parseSbfIonoUtc,
3389
3442
  parseSbfMeas,
3390
3443
  parseSbfNav,
3444
+ parseSbfPvt,
3391
3445
  parseSbfReceiverSetup,
3392
3446
  sbfCrc16,
3393
3447
  scanSbfFrames
package/dist/sbf.d.cts CHANGED
@@ -124,6 +124,35 @@ interface SbfReceiverSetup {
124
124
  */
125
125
  declare function parseSbfReceiverSetup(data: Uint8Array): SbfReceiverSetup | null;
126
126
 
127
+ interface SbfPvt {
128
+ /** GPS-scale epoch time (ms). */
129
+ timeMs: number;
130
+ week: number;
131
+ /** Time of week (s). */
132
+ tow: number;
133
+ /** PVT solution type (Mode & 0x0F). */
134
+ modeType: number;
135
+ /** Human label for `modeType` ('standalone', 'sbas-aided', 'rtk-fixed', …). */
136
+ mode: string;
137
+ /** Geodetic position, or null when the receiver has no fix this epoch. */
138
+ latDeg: number | null;
139
+ lonDeg: number | null;
140
+ heightM: number | null;
141
+ /** Satellites used in the receiver's solution. */
142
+ nrSV: number | null;
143
+ /** Receiver 2-σ horizontal accuracy estimate (m), or null. */
144
+ hAccuracyM: number | null;
145
+ /** Receiver 2-σ vertical accuracy estimate (m), or null. */
146
+ vAccuracyM: number | null;
147
+ }
148
+ interface SbfPvtResult {
149
+ records: SbfPvt[];
150
+ /** PVTGeodetic blocks seen (with valid framing). */
151
+ messages: number;
152
+ }
153
+ /** Decode every PVTGeodetic (4007) block in an SBF byte stream. */
154
+ declare function parseSbfPvt(data: Uint8Array): SbfPvtResult;
155
+
127
156
  /**
128
157
  * Septentrio SBF raw GPS / QZSS LNAV navigation-bit blocks: GPSRawCA
129
158
  * (4017) and QZSRawL1CA (4066) each carry one 300-bit L1 C/A (LNAV)
@@ -634,4 +663,4 @@ interface SbfParseResult {
634
663
  */
635
664
  declare function parseSbfMeas(data: Uint8Array): SbfParseResult;
636
665
 
637
- export { CnavEphemeris, type HasMessage, type SbfBdsNavResult, type SbfCnavEphemeris, type SbfCnavResult, type SbfGalEphemeris, type SbfGalNavResult, type SbfGeoNavResult, type SbfGloNavResult, type SbfGpsNavResult, type SbfHasMessage, type SbfHasResult, type SbfIonoUtcResult, type SbfMeasEpoch, type SbfMeasurement, type SbfNavCounts, type SbfNavigation, type SbfParseResult, type SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfReceiverSetup, crc16 as sbfCrc16, scanSbfFrames };
666
+ export { CnavEphemeris, type HasMessage, type SbfBdsNavResult, type SbfCnavEphemeris, type SbfCnavResult, type SbfGalEphemeris, type SbfGalNavResult, type SbfGeoNavResult, type SbfGloNavResult, type SbfGpsNavResult, type SbfHasMessage, type SbfHasResult, type SbfIonoUtcResult, type SbfMeasEpoch, type SbfMeasurement, type SbfNavCounts, type SbfNavigation, type SbfParseResult, type SbfPvt, type SbfPvtResult, type SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfPvt, parseSbfReceiverSetup, crc16 as sbfCrc16, scanSbfFrames };
package/dist/sbf.d.ts CHANGED
@@ -124,6 +124,35 @@ interface SbfReceiverSetup {
124
124
  */
125
125
  declare function parseSbfReceiverSetup(data: Uint8Array): SbfReceiverSetup | null;
126
126
 
127
+ interface SbfPvt {
128
+ /** GPS-scale epoch time (ms). */
129
+ timeMs: number;
130
+ week: number;
131
+ /** Time of week (s). */
132
+ tow: number;
133
+ /** PVT solution type (Mode & 0x0F). */
134
+ modeType: number;
135
+ /** Human label for `modeType` ('standalone', 'sbas-aided', 'rtk-fixed', …). */
136
+ mode: string;
137
+ /** Geodetic position, or null when the receiver has no fix this epoch. */
138
+ latDeg: number | null;
139
+ lonDeg: number | null;
140
+ heightM: number | null;
141
+ /** Satellites used in the receiver's solution. */
142
+ nrSV: number | null;
143
+ /** Receiver 2-σ horizontal accuracy estimate (m), or null. */
144
+ hAccuracyM: number | null;
145
+ /** Receiver 2-σ vertical accuracy estimate (m), or null. */
146
+ vAccuracyM: number | null;
147
+ }
148
+ interface SbfPvtResult {
149
+ records: SbfPvt[];
150
+ /** PVTGeodetic blocks seen (with valid framing). */
151
+ messages: number;
152
+ }
153
+ /** Decode every PVTGeodetic (4007) block in an SBF byte stream. */
154
+ declare function parseSbfPvt(data: Uint8Array): SbfPvtResult;
155
+
127
156
  /**
128
157
  * Septentrio SBF raw GPS / QZSS LNAV navigation-bit blocks: GPSRawCA
129
158
  * (4017) and QZSRawL1CA (4066) each carry one 300-bit L1 C/A (LNAV)
@@ -634,4 +663,4 @@ interface SbfParseResult {
634
663
  */
635
664
  declare function parseSbfMeas(data: Uint8Array): SbfParseResult;
636
665
 
637
- export { CnavEphemeris, type HasMessage, type SbfBdsNavResult, type SbfCnavEphemeris, type SbfCnavResult, type SbfGalEphemeris, type SbfGalNavResult, type SbfGeoNavResult, type SbfGloNavResult, type SbfGpsNavResult, type SbfHasMessage, type SbfHasResult, type SbfIonoUtcResult, type SbfMeasEpoch, type SbfMeasurement, type SbfNavCounts, type SbfNavigation, type SbfParseResult, type SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfReceiverSetup, crc16 as sbfCrc16, scanSbfFrames };
666
+ export { CnavEphemeris, type HasMessage, type SbfBdsNavResult, type SbfCnavEphemeris, type SbfCnavResult, type SbfGalEphemeris, type SbfGalNavResult, type SbfGeoNavResult, type SbfGloNavResult, type SbfGpsNavResult, type SbfHasMessage, type SbfHasResult, type SbfIonoUtcResult, type SbfMeasEpoch, type SbfMeasurement, type SbfNavCounts, type SbfNavigation, type SbfParseResult, type SbfPvt, type SbfPvtResult, type SbfReceiverSetup, decodeSbfNavigation, feedGeoBlock, parseSbfBdsNav, parseSbfCnav, parseSbfGalNav, parseSbfGeoNav, parseSbfGloNav, parseSbfGpsNav, parseSbfHas, parseSbfIonoUtc, parseSbfMeas, parseSbfPvt, parseSbfReceiverSetup, crc16 as sbfCrc16, scanSbfFrames };
package/dist/sbf.js CHANGED
@@ -13,9 +13,10 @@ import {
13
13
  parseSbfIonoUtc,
14
14
  parseSbfMeas,
15
15
  parseSbfNav,
16
+ parseSbfPvt,
16
17
  parseSbfReceiverSetup,
17
18
  scanSbfFrames
18
- } from "./chunk-DE5IUULR.js";
19
+ } from "./chunk-ZPNMIUNZ.js";
19
20
  import "./chunk-FA2UTLEQ.js";
20
21
  import "./chunk-WQX354KD.js";
21
22
  import "./chunk-37QNKGTC.js";
@@ -38,6 +39,7 @@ export {
38
39
  parseSbfIonoUtc,
39
40
  parseSbfMeas,
40
41
  parseSbfNav,
42
+ parseSbfPvt,
41
43
  parseSbfReceiverSetup,
42
44
  crc16 as sbfCrc16,
43
45
  scanSbfFrames
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gnss-js",
3
- "version": "1.52.0",
3
+ "version": "1.53.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,