move xbee user code in a separate file
[protos/xbee-avr.git] / commands.c
index 54e56d7..446d92d 100644 (file)
 #include <parse_num.h>
 #include <uart.h>
 #include <xbee.h>
+#include <callout.h>
 
-#include "callout.h"
 #include "parse_atcmd.h"
 #include "parse_neighbor.h"
 #include "parse_monitor.h"
 
 #include "spi_servo.h"
 #include "rc_proto.h"
+#include "xbee_user.h"
 #include "main.h"
 #include "cmdline.h"
 #include "beep.h"
@@ -1247,6 +1248,11 @@ static void cmd_raw_parsed(void *parsed_result, void *data)
 {
        (void)parsed_result;
        (void)data;
+
+       if (range_running || monitor_running) {
+               printf_P(PSTR("stop running range or monitor first\r\n"));
+               return;
+       }
        printf_P(PSTR("switched to raw mode, CTRL-D to exit\r\n"));
        rdline_stop(&xbeeboard.rdl); /* don't display prompt when return */
        xbee_raw = 1;