From 31360724bd8e1f5f776b5bebae89b176b89c103c Mon Sep 17 00:00:00 2001 From: bert hubert Date: Thu, 9 Jul 2020 17:18:35 +0200 Subject: [PATCH] first part of the timegal timegps etc stuff --- navdump.cc | 7 +++ navmon.proto | 26 +++++++++- navparse.cc | 41 +++++++++++++++- ubxtool.cc | 134 ++++++++++++++++++++++++++++++++++++++++++++++++--- 4 files changed, 197 insertions(+), 11 deletions(-) diff --git a/navdump.cc b/navdump.cc index 9f8fa4b..b456746 100644 --- a/navdump.cc +++ b/navdump.cc @@ -1171,6 +1171,13 @@ try cout<<" SAR RLM type "<< nmm.sr().type() <<" from gal sv "; cout<< nmm.sr().gnsssv() << " beacon "< payload) payload[8]); } +// these are four structs to capture Ublox F9P time offset stats +namespace { +struct TIMEGAL +{ + uint32_t itow; + uint32_t galTow; + int32_t fGalTow; + int16_t galWno; + int8_t leapS; + uint8_t valid; + uint32_t tAcc; +} __attribute__((packed)); + +struct TIMEBDS +{ + uint32_t itow; + uint32_t sow; + int32_t fSow; + int16_t week; + int8_t leapS; + uint8_t valid; + uint32_t tAcc; +} __attribute__((packed)); + +struct TIMEGLO +{ + uint32_t itow; + uint32_t tod; + int32_t fTod; + uint16_t nT; + uint8_t n4; + uint8_t valid; + uint32_t tAcc; +} __attribute__((packed)); + +struct TIMEGPS +{ + uint32_t itow; + int32_t ftow; + int16_t week; + int8_t leapS; + uint8_t valid; + uint32_t tAcc; +} __attribute__((packed)); + +} + // ubxtool device srcid int main(int argc, char** argv) { @@ -672,9 +719,9 @@ int main(int argc, char** argv) } } else { // UBX-CFG-VALSET - + // vers ram res res msg = buildUbxMessage(0x06, 0x8a, {0x00, 0x01, 0x00, 0x00, - 0x1f,0x00,0x31,0x10, doGPS, + 0x1f,0x00,0x31,0x10, doGPS, // 0x01,0x00,0x31,0x10, doGPS, 0x03,0x00,0x31,0x10, doGPS, @@ -899,7 +946,20 @@ int main(int argc, char** argv) if (doDEBUG) { cerr<set_itow(gps.itow); + + auto no = nmm.mutable_to()->add_offsets(); + no->set_gnssid(0); + no->set_offsetns(gps.ftow); + no->set_tacc(gps.tAcc); + no->set_tow(gps.itow); // this is for consistency + no->set_leaps(gps.leapS); + no->set_wn(gps.week); + no->set_valid(gps.valid); + + no = nmm.mutable_to()->add_offsets(); + no->set_gnssid(2); + no->set_offsetns(gal.fGalTow); + no->set_tacc(gal.tAcc); + no->set_leaps(gal.leapS); + no->set_wn(gal.galWno); + no->set_valid(gal.valid); + no->set_tow(gal.galTow); + + no = nmm.mutable_to()->add_offsets(); + no->set_gnssid(3); + no->set_offsetns(bds.fSow); + no->set_tacc(bds.tAcc); + no->set_leaps(bds.leapS); + no->set_wn(bds.week); + no->set_valid(bds.valid); + no->set_tow(bds.sow); + + no = nmm.mutable_to()->add_offsets(); + no->set_gnssid(6); + no->set_offsetns(glo.fTod); + no->set_tacc(glo.tAcc); + no->set_nt(glo.nT); + no->set_n4(glo.n4); + no->set_valid(glo.valid); + no->set_tow(glo.tod); + + ns.emitNMM(nmm); + gal.itow = 0; + } + } tstate; + for(;;) { try { auto [msg, timestamp] = getUBXMessage(fd, nullptr); (void)timestamp; auto payload = msg.getPayload(); - + if(msg.getClass() == 0x01 && msg.getType() == 0x07) { // UBX-NAV-PVT struct PVT { @@ -1042,10 +1163,7 @@ int main(int argc, char** argv) if(doDEBUG) cerr<