-/* ************* */
-
-/* this structure is filled when cmd_dump is parsed successfully */
-struct cmd_dump_result {
- fixed_string_t dump;
- fixed_string_t onoff;
-};
-
-/* function called when cmd_dump is parsed successfully */
-static void cmd_dump_parsed(void *parsed_result, void *data)
-{
- struct cmd_dump_result *res = parsed_result;
-
- (void)data;
- if (!strcmp(res->onoff, "on"))
- xbee_hexdump = 1;
- else
- xbee_hexdump = 0;
-}
-
-const char PROGMEM str_dump[] = "dump";
-const char PROGMEM str_dump_onoff[] = "on#off";
-
-const parse_token_string_t PROGMEM cmd_dump_dump =
- TOKEN_STRING_INITIALIZER(struct cmd_dump_result, dump,
- str_dump);
-
-const parse_token_string_t PROGMEM cmd_dump_onoff =
- TOKEN_STRING_INITIALIZER(struct cmd_dump_result, onoff,
- str_dump_onoff);
-
-const char PROGMEM help_dump[] = "enable/disable hexdump of received packets";
-
-const parse_inst_t PROGMEM cmd_dump = {
- .f = cmd_dump_parsed, /* function to call */
- .data = NULL, /* 2nd arg of func */
- .help_str = help_dump,
- .tokens = { /* token list, NULL terminated */
- (PGM_P)&cmd_dump_dump,
- (PGM_P)&cmd_dump_onoff,
- NULL,
- },
-};
-
-/* ************* */
-
-/* this structure is filled when cmd_debug is parsed successfully */
-struct cmd_debug_result {
- fixed_string_t debug;
- fixed_string_t onoff;
-};
-
-/* function called when cmd_debug is parsed successfully */
-static void cmd_debug_parsed(void *parsed_result, void *data)
-{
- struct cmd_debug_result *res = parsed_result;
-
- (void)data;
- if (!strcmp(res->onoff, "on"))
- xbee_debug = 1;
- else
- xbee_debug = 0;
-}
-
-const char PROGMEM str_debug[] = "debug";
-const char PROGMEM str_debug_onoff[] = "on#off";
-
-const parse_token_string_t PROGMEM cmd_debug_debug =
- TOKEN_STRING_INITIALIZER(struct cmd_debug_result, debug,
- str_debug);
-
-const parse_token_string_t PROGMEM cmd_debug_onoff =
- TOKEN_STRING_INITIALIZER(struct cmd_debug_result, onoff,
- str_debug_onoff);
-
-const char PROGMEM help_debug[] = "enable/disable additionnal debug";
-
-const parse_inst_t PROGMEM cmd_debug = {
- .f = cmd_debug_parsed, /* function to call */
- .data = NULL, /* 2nd arg of func */
- .help_str = help_debug,
- .tokens = { /* token list, NULL terminated */
- (PGM_P)&cmd_debug_debug,
- (PGM_P)&cmd_debug_onoff,
- NULL,
- },
-};
-