]> git.droids-corp.org - protos/xbee-avr.git/commitdiff
add a command to dump xbee stats
authorOlivier Matz <zer0@droids-corp.org>
Tue, 12 Nov 2013 18:58:03 +0000 (19:58 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Sun, 9 Mar 2014 21:13:02 +0000 (22:13 +0100)
commands.c

index c9619ac2da48e3fdc284d0416dbf1f5a9d17be6c..319e1faf439807fff88f8227da03a57c7e208264 100644 (file)
@@ -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,