From: Olivier Matz Date: Tue, 12 Nov 2013 18:58:03 +0000 (+0100) Subject: add a command to dump xbee stats X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=c552a01853bea12a3cd44e35be8c0df49ed7d7d0;p=protos%2Fxbee-avr.git add a command to dump xbee stats --- diff --git a/commands.c b/commands.c index c9619ac..319e1fa 100644 --- a/commands.c +++ b/commands.c @@ -1553,6 +1553,37 @@ const parse_inst_t PROGMEM cmd_test_spi = { /**********************************************************/ +/* this structure is filled when cmd_dump_xbee_stats is parsed successfully */ +struct cmd_dump_xbee_stats_result { + fixed_string_t arg0; +}; + +static void cmd_dump_xbee_stats_parsed(void *parsed_result, void *data) +{ + (void)parsed_result; + (void)data; + + xbee_dump_stats(xbee_dev); +} + +const char PROGMEM str_dump_xbee_stats_arg0[] = "dump_xbee_stats"; +const parse_token_string_t PROGMEM cmd_dump_xbee_stats_arg0 = + TOKEN_STRING_INITIALIZER(struct cmd_dump_xbee_stats_result, arg0, + str_dump_xbee_stats_arg0); + +const char PROGMEM help_dump_xbee_stats[] = "Test the spi"; +const parse_inst_t PROGMEM cmd_dump_xbee_stats = { + .f = cmd_dump_xbee_stats_parsed, /* function to call */ + .data = NULL, /* 2nd arg of func */ + .help_str = help_dump_xbee_stats, + .tokens = { /* token list, NULL terminated */ + (PGM_P)&cmd_dump_xbee_stats_arg0, + NULL, + }, +}; + +/**********************************************************/ + /* this structure is filled when cmd_test_eeprom_config is parsed successfully */ struct cmd_test_eeprom_config_result { fixed_string_t arg0; @@ -1798,6 +1829,7 @@ const parse_ctx_t PROGMEM main_ctx[] = { &cmd_servo_bypassppm, &cmd_servo_show, &cmd_test_spi, + &cmd_dump_xbee_stats, &cmd_test_eeprom_config, &cmd_eeprom_del, &cmd_eeprom_add,