altos: Add sat info to GPS report command
[fw/altos] / src / ao_monitor.c
index ac1929db1aea5ee2563ff5bb295fe53868970069..e5e9159f0bcc4cce71c75d4e210e8d330e52dd93 100644 (file)
@@ -36,6 +36,7 @@ ao_monitor(void)
 #define recv_tiny      (u.tiny)
 
        uint8_t state;
+       uint8_t sum, byte;
        int16_t rssi;
 
        for (;;) {
@@ -189,11 +190,16 @@ ao_monitor(void)
                default:
                        if (ao_monitoring > AO_MAX_TELEMETRY)
                                ao_monitoring = AO_MAX_TELEMETRY;
-                       if (!ao_radio_recv(&recv_raw, ao_monitoring))
+                       if (!ao_radio_recv(&recv_raw, ao_monitoring + 2))
                                continue;
-                       for (state = 0; state < ao_monitoring + 1; state++)
-                               printf("%02x ", recv_raw.packet[state]);
-                       printf("%02x\n", recv_raw.packet[state]);
+                       printf ("TELEM %02x", ao_monitoring + 2);
+                       sum = 0x5a;
+                       for (state = 0; state < ao_monitoring + 2; state++) {
+                               byte = recv_raw.packet[state];
+                               sum += byte;
+                               printf("%02x", byte);
+                       }
+                       printf("%02x\n", sum);
                        break;
                }
                ao_usb_flush();