altos: ao_radio_recv needs byte count *including* rssi and status
authorKeith Packard <keithp@keithp.com>
Tue, 28 Jun 2011 08:01:08 +0000 (01:01 -0700)
committerKeith Packard <keithp@keithp.com>
Tue, 28 Jun 2011 08:01:08 +0000 (01:01 -0700)
That's two more than the actual packet length.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao_monitor.c

index 1d083c59eff4de019647ccaf7ca565946cb975ed..e5e9159f0bcc4cce71c75d4e210e8d330e52dd93 100644 (file)
@@ -190,9 +190,9 @@ ao_monitor(void)
                default:
                        if (ao_monitoring > AO_MAX_TELEMETRY)
                                ao_monitoring = AO_MAX_TELEMETRY;
                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;
                                continue;
-                       printf ("TELEM %02x", ao_monitoring+2);
+                       printf ("TELEM %02x", ao_monitoring + 2);
                        sum = 0x5a;
                        for (state = 0; state < ao_monitoring + 2; state++) {
                                byte = recv_raw.packet[state];
                        sum = 0x5a;
                        for (state = 0; state < ao_monitoring + 2; state++) {
                                byte = recv_raw.packet[state];