RUI3 (RAK Unified Interface 3) - RAK4631
service_mode_cli.h
Go to the documentation of this file.
1 #ifndef __SERVICE_MODE_CLI_HANDLER_H__
2 #define __SERVICE_MODE_CLI_HANDLER_H__
3 
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7 
8 //standard libary include
9 #include <stdio.h>
10 #include <string.h>
11 #include <stdlib.h>
12 #include <stdbool.h>
13 #include "atcmd.h"
14 
15 #define CLI_BUFFER_SIZE (2048)//FIXME Consider AT+LPSEND
16 #define CLI_HISTORY_NUM (5)
17 #define CLI_ARG_SIZE (20)
18 #define CLI_PROMPT ("")
19 
20 inline int get_cli_buffer_len(void);
21 
22 //typedef void (*CliCmdFunc) ( s32, char ** );
23 typedef int (*CliCmdFunc) ( int32_t, char* argv[] );
24 
25 typedef struct CLICmds_st
26 {
27  const char *Cmd;
29  const char *CmdUsage;
30 
31 } CLICmds, *PCLICmds;
32 
35 void service_mode_cli_handler(SERIAL_PORT port, uint8_t ch);
36 #ifndef RUI_BOOTLOADER
37 bool service_mode_cli_register(const char *cmd, const char *title, PF_handle handle, uint8_t maxargu, const char *usage, uint8_t perm);
38 #else
39 int Cli_RAK(SERIAL_PORT port, uint8_t ch);
40 #endif
41 
42 int At_Parser (SERIAL_PORT port, char *buff, int len);
43 
44 #ifdef __cplusplus
45 }
46 #endif
47 
48 #endif /* __SERVICE_MODE_CLI_HANDLER_H__ */
49 
void service_mode_cli_handler(SERIAL_PORT port, uint8_t ch)
int At_Parser(SERIAL_PORT port, char *buff, int len)
const char * Cmd
Definition: service_mode_cli.h:27
Definition: service_mode_cli.h:25
bool service_mode_cli_register(const char *cmd, const char *title, PF_handle handle, uint8_t maxargu, const char *usage, uint8_t perm)
struct CLICmds_st * PCLICmds
const char * CmdUsage
Definition: service_mode_cli.h:29
int(* CliCmdFunc)(int32_t, char *argv[])
Definition: service_mode_cli.h:23
void service_mode_cli_init(SERIAL_PORT port)
int get_cli_buffer_len(void)
CliCmdFunc CmdHandler
Definition: service_mode_cli.h:28
int(* PF_handle)(SERIAL_PORT port, char *cmd, stParam *param)
Definition: atcmd.h:65
struct CLICmds_st CLICmds
enum _SERIAL_PORT SERIAL_PORT
void service_mode_cli_deinit(SERIAL_PORT port)