summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2014-02-09 22:54:31 -0800
committerKeith Packard <keithp@keithp.com>2014-02-09 22:54:31 -0800
commite76948d382cf6980c3a5b6c48405d71c8811780b (patch)
tree7d9ca6b3cf0264516887d865057309fd2f3da69a /src
parent5001a0f882af53dde33fc531215944c9d727baf4 (diff)
altos: Put locked/unlocked GPS status in APRS comments
Replace the 'S' (which marks the field showing sats in view) with either 'L' or 'U' to tell the user whether the GPS receiver is locked or unlocked. This also removes the colons in the comment field to shorten it. This makes it fit on one line of my FT1D display. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/ao_aprs.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/drivers/ao_aprs.c b/src/drivers/ao_aprs.c
index d472af4e..0a6c72ce 100644
--- a/src/drivers/ao_aprs.c
+++ b/src/drivers/ao_aprs.c
@@ -500,6 +500,14 @@ static int ao_num_sats(void)
return n;
}
+static char ao_gps_locked(void)
+{
+ if (ao_gps_data.flags & AO_GPS_VALID)
+ return 'L';
+ else
+ return 'U';
+}
+
static int tncComment(uint8_t *buf)
{
#if HAS_ADC
@@ -512,7 +520,8 @@ static int tncComment(uint8_t *buf)
int16_t main = ao_ignite_decivolt(AO_SENSE_MAIN(&packet));
return sprintf((char *) buf,
- "S: %d B:%d.%d A:%d.%d M:%d.%d",
+ "%c%d B%d.%d A%d.%d M%d.%d",
+ ao_gps_locked(),
ao_num_sats(),
battery/10,
battery % 10,
@@ -522,7 +531,9 @@ static int tncComment(uint8_t *buf)
main%10);
#else
return sprintf((char *) buf,
- "S: %d", ao_num_sats());
+ "%c%d",
+ ao_gps_locked(),
+ ao_num_sats());
#endif
}