aboutsummaryrefslogtreecommitdiff
path: root/projects/cli-test/mgmt-cli.h
diff options
context:
space:
mode:
Diffstat (limited to 'projects/cli-test/mgmt-cli.h')
-rw-r--r--projects/cli-test/mgmt-cli.h47
1 files changed, 5 insertions, 42 deletions
diff --git a/projects/cli-test/mgmt-cli.h b/projects/cli-test/mgmt-cli.h
index 16c9fbd98..0b9c40c 100644
--- a/projects/cli-test/mgmt-cli.h
+++ b/projects/cli-test/mgmt-cli.h
@@ -35,52 +35,15 @@
#ifndef __STM32_MGMT_CLI_H
#define __STM32_MGMT_CLI_H
-#include "stm-init.h"
#include <libcli.h>
-
-/* A bunch of defines to make it easier to add/maintain the CLI commands.
- *
- */
-#define _cli_cmd_struct(name, fullname, func, help) \
- static struct cli_command cmd_##fullname##_s = \
- {(char *) #name, func, 0, help, \
- PRIVILEGE_UNPRIVILEGED, MODE_EXEC, NULL, NULL, NULL}
-
-/* ROOT is a top-level label with no command */
-#define cli_command_root(name) \
- _cli_cmd_struct(name, name, NULL, NULL); \
- cli_register_command2(cli, &cmd_##name##_s, NULL)
-
-/* BRANCH is a label with a parent, but no command */
-#define cli_command_branch(parent, name) \
- _cli_cmd_struct(name, parent##_##name, NULL, NULL); \
- cli_register_command2(cli, &cmd_##parent##_##name##_s, &cmd_##parent##_s)
-
-/* NODE is a label with a parent and with a command associated with it */
-#define cli_command_node(parent, name, help) \
- _cli_cmd_struct(name, parent##_##name, cmd_##parent##_##name, (char *) help); \
- cli_register_command2(cli, &cmd_##parent##_##name##_s, &cmd_##parent##_s)
-
-/* ROOT NODE is a label without a parent, but with a command associated with it */
-#define cli_command_root_node(name, help) \
- _cli_cmd_struct(name, name, cmd_##name, (char *) help); \
- cli_register_command2(cli, &cmd_##name##_s, NULL)
-
-
-#define CLI_UART_RECVBUF_SIZE 256 /* This must be a power of 2 */
-#define CLI_UART_RECVBUF_MASK (CLI_UART_RECVBUF_SIZE - 1)
-
-enum mgmt_cli_dma_state {
+typedef enum {
DMA_RX_STOP,
DMA_RX_START,
-};
+} mgmt_cli_dma_state_t;
+
+extern int control_mgmt_uart_dma_rx(mgmt_cli_dma_state_t state);
-extern void uart_cli_print(struct cli_def *cli __attribute__ ((unused)), const char *buf);
-extern int uart_cli_read(struct cli_def *cli __attribute__ ((unused)), void *buf, size_t count);
-extern int uart_cli_write(struct cli_def *cli __attribute__ ((unused)), const void *buf, size_t count);
-extern int embedded_cli_loop(struct cli_def *cli);
-extern void mgmt_cli_init(struct cli_def *cli);
-extern int control_mgmt_uart_dma_rx(enum mgmt_cli_dma_state state);
+extern int cli_main(void);
#endif /* __STM32_MGMT_CLI_H */