From d05946426e3c5aeb48405ad345152dd8ba7f3ca6 Mon Sep 17 00:00:00 2001 From: bert hubert Date: Thu, 16 Jan 2020 14:54:21 +0000 Subject: [PATCH] add survey-in commands for M8T and F9 --- ubxtool.cc | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 88 insertions(+), 4 deletions(-) diff --git a/ubxtool.cc b/ubxtool.cc index 37e05cb..194c289 100644 --- a/ubxtool.cc +++ b/ubxtool.cc @@ -573,6 +573,11 @@ int main(int argc, char** argv) app.add_option("--owner,-o", owner, "Name/handle/nick of owner/operator"); app.add_option("--remark", remark, "Remark for this station"); + int surveyMinSeconds = 0; + int surveyMinCM = 0; + app.add_option("--survey-min-seconds", surveyMinSeconds, "Survey minimally this amount of seconds"); + app.add_option("--survey-min-cm", surveyMinCM, "Survey until accuracy is better (lower) than this setting"); + app.add_flag("--debug", doDEBUG, "Display debug information"); app.add_flag("--logfile", doLOGFILE, "Create logfile"); try { @@ -741,12 +746,8 @@ int main(int argc, char** argv) 0x25,0x00,0x31,0x10, doGlonass, 0x18,0x00,0x31,0x10, doGlonass, 0x1a,0x00,0x31,0x10, doGlonass - - - }); - if (doDEBUG) { cerr<set_payload(string((char*)&payload[0], payload.size())); ns.emitNMM( nmm); } + else if(msg.getClass() == 0x01 && msg.getType() == 0x3B) { // UBX-NAV-SVIN + struct NavSin + { + uint8_t ver; + uint8_t res[3]; + uint32_t iTow; + uint32_t dur; + int32_t meanXCM, meanYCM, meanZCM; + int8_t meanXHP, meanYHP, meanZHP; + uint8_t res2; + int32_t meanAcc; + int32_t obs; + int8_t valid; + int8_t active; + uint8_t res3[2]; + } __attribute__((packed)); + NavSin NS; + static NavSin lastNS; + + if(payload.size() != sizeof(NS)) { + cerr<<"Wrong NAV-SVIN message size, skipping"<