PicoWAN SDK Documentation
console.h
Go to the documentation of this file.
1 
31 #ifndef _CONSOLE_H_
32 #define _CONSOLE_H_
33 
34 #include <os.h>
35 
36 typedef enum {
37  CMD_OK = 0, // Command has been successful
38  CMD_ERROR = 1, // Command has failed
39  CMD_DELAYED = 2, // Result is delayed (a call to console_return_ok() or console_return_error() is mandatory)
40 } cmd_ret_val_t;
41 
42 struct command {
43  char *name;
44  cmd_ret_val_t (*cb)(char *args); // Returns 0 on success, 1 otherwise
45 };
46 
47 
53 void console_init(uint8_t usart);
54 
63 void console_enable_commands(uint8_t en);
64 
75 cmd_ret_val_t console_commands_help(char *args);
76 
83 void console_return_ok(void);
84 
91 void console_return_error(void);
92 
100 void console_register_cmds(struct command *list);
101 
109 void console_register_raw_callback(void (*cb)(uint8_t *args, uint16_t length));
110 
111 #endif
Definition: console.h:42
void console_init(uint8_t usart)
Initializes the console.
Definition: console.c:72
void console_return_error(void)
Explicitly returns that the previously called AT command has failed.
Definition: console.c:114
void console_enable_commands(uint8_t en)
Enables the AT command interface.
Definition: console.c:81
Implementation of a Low-Power scheduler.
cmd_ret_val_t console_commands_help(char *args)
Built-in command that lists the available commands.
Definition: console.c:86
void console_return_ok(void)
Explicitly returns that the previously called AT command has succeeded.
Definition: console.c:104
void console_register_raw_callback(void(*cb)(uint8_t *args, uint16_t length))
Registers a RAW callback.
Definition: console.c:218
void console_register_cmds(struct command *list)
Registers a list of AT commands.
Definition: console.c:213