Example command line interface (CLI) over UART.
- Note
- It is assumed that you have followed the steps in the Getting Started guide and are therefore familiar with how to build, flash, and monitor an application using the MM-IoT-SDK framework.
Definition in file cli.c.
#include "mmconfig.h"
#include "mmhal_uart.h"
#include "mmutils.h"
#include "mmagic.h"
#include "mm_app_regdb.h"
#include "mbedtls/mbedtls_config.h"
Go to the source code of this file.
◆ app_init()
Main entry point to the application.
This will be invoked in a thread once operating system and hardware initialization has completed. It may return, but it does not have to.
Definition at line 107 of file cli.c.
◆ cli_set_deep_sleep_mode_handler()
Handler for the CLI set deep sleep mode callback.
- Parameters
-
| mode | The deep sleep mode to set. |
| arg | Opaque argument (unused). |
- Returns
- true on success, false on failure.
Definition at line 78 of file cli.c.
◆ cli_tx_handler()
| void cli_tx_handler |
( |
const char * |
data, |
|
|
size_t |
length, |
|
|
void * |
arg |
|
) |
| |
Handler for the CLI transmit callback.
- Parameters
-
| data | Data to transmit. |
| length | Length of data to transmit. |
| arg | Opaque argument (unused). |
Definition at line 64 of file cli.c.
◆ cli_uart_rx_handler()
| void cli_uart_rx_handler |
( |
const uint8_t * |
data, |
|
|
size_t |
length, |
|
|
void * |
arg |
|
) |
| |
Handler for the UART receive callback.
- Parameters
-
| data | Received data. |
| length | Length of received data. |
| arg | Opaque argument (unused). |
Definition at line 47 of file cli.c.
◆ mmagic_cli_ctx
| struct mmagic_cli* mmagic_cli_ctx |
Pointer to context for CLI receive callback.
Definition at line 38 of file cli.c.