send "ATCN" when exiting from xbee raw mode
[protos/xbee-avr.git] / main.c
diff --git a/main.c b/main.c
index 2d1dd15..0e52717 100644 (file)
--- a/main.c
+++ b/main.c
 #include <rdline.h>
 #include <timer.h>
 
-#include "xbee_neighbor.h"
-#include "xbee_atcmd.h"
-#include "xbee_stats.h"
-#include "xbee_buf.h"
-#include "xbee_proto.h"
-#include "xbee.h"
-#include "cmdline.h"
-#include "callout.h"
-#include "rc_proto.h"
-#include "spi_servo.h"
 #include "main.h"
 
 struct xbeeboard xbeeboard;
@@ -562,6 +552,11 @@ void xbee_mainloop(void)
                        /* from cmdline to xbee */
                        c = cmdline_dev_recv(NULL);
                        if (c == 4) { /* CTRL-d */
+                               xbee_dev_send('A', NULL);
+                               xbee_dev_send('T', NULL);
+                               xbee_dev_send('C', NULL);
+                               xbee_dev_send('N', NULL);
+                               xbee_dev_send('\n', NULL);
                                xbee_raw = 0;
                                rdline_newline(&xbeeboard.rdl,
                                               xbeeboard.prompt);