This adds the number of sats in view (as opposed to the number of sats
in solution) to the APRS packet.
Signed-off-by: Keith Packard <keithp@keithp.com>
+static int ao_num_sats(void)
+{
+ int i;
+ int n = 0;
+
+ for (i = 0; i < ao_gps_tracking_data.channels; i++) {
+ if (ao_gps_tracking_data.sats[i].svid)
+ n++;
+ }
+ return n;
+}
+
static int tncComment(uint8_t *buf)
{
static int tncComment(uint8_t *buf)
{
struct ao_data packet;
ao_arch_critical(ao_data_get(&packet););
struct ao_data packet;
ao_arch_critical(ao_data_get(&packet););
int16_t main = ao_ignite_decivolt(AO_SENSE_MAIN(&packet));
return sprintf((char *) buf,
int16_t main = ao_ignite_decivolt(AO_SENSE_MAIN(&packet));
return sprintf((char *) buf,
- "B:%d.%d A:%d.%d M:%d.%d",
+ "S: %d B:%d.%d A:%d.%d M:%d.%d",
+ ao_num_sats(),
battery/10,
battery % 10,
apogee/10,
apogee%10,
main/10,
main%10);
battery/10,
battery % 10,
apogee/10,
apogee%10,
main/10,
main%10);
+#else
+ return sprintf((char *) buf,
+ "S: %d", ao_num_sats());
/**
* Generate the plain text position packet.
/**
* Generate the plain text position packet.
*buf++ = 33 + ((1 << 5) | (2 << 3));
*buf++ = 33 + ((1 << 5) | (2 << 3));
-#else
- *buf = '\0';
-#endif
return buf - tncBuffer;
}
return buf - tncBuffer;
}