diff options
author | Michael Tatarinov <kukabu@gmail.com> | 2011-02-14 16:05:31 +0300 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-02-14 08:59:50 -0500 |
commit | 1385c3d80c5766bf15e8dfdd9e28898308fe1232 (patch) | |
tree | 4b0106ffb0091167108f996fb266bfd1ae0b9353 /monitor_sirf.c | |
parent | 29907febf2cfd6485e8ede80f1d4b230ce778afa (diff) | |
download | gpsd-1385c3d80c5766bf15e8dfdd9e28898308fe1232.tar.gz |
Some tweaks for the GPS monitor.
1. The gpsdata.dev.path is filled only in JSON mode,
but we in super-raw mode. Fill it.
2. Toggle subframe_enabled flag when we toggle subframe mode.
3. Disable update mid6win, mid7win, mid9win, mid13win, mid27win
when we display navigation parameters.
Diffstat (limited to 'monitor_sirf.c')
-rw-r--r-- | monitor_sirf.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/monitor_sirf.c b/monitor_sirf.c index f0df59a9..f9d5cf10 100644 --- a/monitor_sirf.c +++ b/monitor_sirf.c @@ -397,8 +397,8 @@ static void sirf_update(void) case 0x08: /* 50 BPS data */ ch = (int)getub(buf, 1); display(mid4win, ch + 2, 27, "Y"); - monitor_log("50B 0x08="); subframe_enabled = true; + monitor_log("50B 0x08="); break; case 0x09: /* Throughput */ @@ -462,6 +462,7 @@ static void sirf_update(void) display(mid19win, 13, 42, "%d", getub(buf, 63)); /* Response Time Max */ display(mid19win, 14, 42, "%d", getub(buf, 64)); /* Time/Accu & Duty Cycle Priority */ #undef YESNO + monitor_log("NP 0x13="); break; case 0x1b: @@ -657,9 +658,10 @@ static int sirf_command(char line[]) case 'A': /* toggle 50bps subframe data */ (void)memset(buf, '\0', sizeof(buf)); putbyte(buf, 0, 0x80); - putbyte(buf, 23, 12); + putbyte(buf, 23, 0x0c); putbyte(buf, 24, subframe_enabled ? 0x00 : 0x10); (void)monitor_control_send(buf, 25); + subframe_enabled = !subframe_enabled; return COMMAND_MATCH; case 'M': /* static navigation */ @@ -685,6 +687,24 @@ static int sirf_command(char line[]) case 'P': /* poll navigation params */ dispmode = !dispmode; + if (dispmode) { + (void)syncok(mid6win, false); + (void)syncok(mid7win, false); + (void)syncok(mid9win, false); + (void)syncok(mid13win, false); + (void)syncok(mid27win, false); + } else { + (void)syncok(mid6win, true); + (void)wsyncup(mid6win); + (void)syncok(mid7win, true); + (void)wsyncup(mid7win); + (void)syncok(mid9win, true); + (void)wsyncup(mid9win); + (void)syncok(mid13win, true); + (void)wsyncup(mid13win); + (void)syncok(mid27win, true); + (void)wsyncup(mid27win); + } return COMMAND_MATCH; } |