+#ifndef USE_USB
+/**********************************************************/
+
+/* this structure is filled when cmd_baudrate is parsed successfully */
+struct cmd_baudrate_result {
+ fixed_string_t arg0;
+ uint32_t arg1;
+};
+
+/* function called when cmd_baudrate is parsed successfully */
+static void cmd_baudrate_parsed(void * parsed_result, __attribute__((unused)) void *data)
+{
+ struct cmd_baudrate_result *res = parsed_result;
+ struct uart_config c;
+
+ uart_getconf(XBEE_UART, &c);
+ c.baudrate = res->arg1;
+ uart_setconf(XBEE_UART, &c);
+}
+
+prog_char str_baudrate_arg0[] = "baudrate";
+parse_pgm_token_string_t cmd_baudrate_arg0 =
+ TOKEN_STRING_INITIALIZER(struct cmd_baudrate_result, arg0,
+ str_baudrate_arg0);
+parse_pgm_token_num_t cmd_baudrate_arg1 =
+ TOKEN_NUM_INITIALIZER(struct cmd_baudrate_result, arg1,
+ UINT32);
+
+prog_char help_baudrate[] = "Change xbee baudrate";
+parse_pgm_inst_t cmd_baudrate = {
+ .f = cmd_baudrate_parsed, /* function to call */
+ .data = NULL, /* 2nd arg of func */
+ .help_str = help_baudrate,
+ .tokens = { /* token list, NULL terminated */
+ (prog_void *)&cmd_baudrate_arg0,
+ (prog_void *)&cmd_baudrate_arg1,
+ NULL,
+ },
+};
+#endif