parse rx hello frames
[protos/xbee-avr.git] / main.c
diff --git a/main.c b/main.c
index 20d368b..c3511b5 100644 (file)
--- a/main.c
+++ b/main.c
@@ -266,6 +266,16 @@ int xbee_recv_data(struct xbee_recv_hdr *recvframe, unsigned len)
                        break;
                }
 #endif
+               case RC_PROTO_HELLO: {
+                       struct rc_proto_hello *rch =
+                               (struct rc_proto_hello *) recvframe->data;
+
+                       if (xbee_debug)
+                               printf_P(PSTR("recv hello len=%d\r\n"),
+                                        rch->datalen);
+
+                       break;
+               }
                default:
                        return -1;
        }
@@ -646,9 +656,6 @@ int main(void)
        spi_servo_init();
        beep_init();
 
-       printf_P(PSTR("\r\n"));
-       rdline_newline(&xbeeboard.rdl, xbeeboard.prompt);
-
        callout_manager_init(&cm, get_time_ms);
        //callout_reset(&cm, &t1, 500, PERIODICAL, do_led_blink, NULL);
 
@@ -672,6 +679,10 @@ int main(void)
        sei();
 
        eeprom_load_config();
+
+       printf_P(PSTR("\r\n"));
+       rdline_newline(&xbeeboard.rdl, xbeeboard.prompt);
+
        xbee_mainloop();
        return 0;
 }