MT7687 API Reference  LinkIt SDK v4
Typedef

Overview

Typedefs

typedef int(* getchar_fptr_t) (void)
 A function pointer prototype to get a characeter from an input source. More...
 
typedef int(* putchar_fptr_t) (int)
 A function pointer prototype to write a character to the output. More...
 
typedef uint8_t(* knock_fptr_t) (char *id, char *pass)
 This is the callback function to authenticate the user, if login is enabled and the credentials are not hardcoded. More...
 
typedef uint8_t(* cli_cmd_handler_t) (uint8_t len, char *param[])
 Function pointer type of CLI command handlers. More...
 

Typedef Documentation

typedef uint8_t(* cli_cmd_handler_t) (uint8_t len, char *param[])

Function pointer type of CLI command handlers.

All CLI handlers must follow this prototype. An example is cli_logout().

Note
Currently, the return value of CLI handlers are ignored. However, to keep backward compatiblity, CLI handlers must return 0.
typedef int(* getchar_fptr_t) (void)

A function pointer prototype to get a characeter from an input source.

Generally, standard getchar() can be used for this purpose. But other implementation can also be used. For example, in semihosting mode, the standard getchar() function is replaced by a debug adapter. But to run CLI over telnet, a custom-defined getchar() function can be used.

Note
The standard getchar() returns an integer value. To reduce the CPU consumption of MiniCLI, the input source must be configured or written carefully to avoid returning non-character values.
typedef uint8_t(* knock_fptr_t) (char *id, char *pass)

This is the callback function to authenticate the user, if login is enabled and the credentials are not hardcoded.

Return values
0,ifvalidation of the combination of 'id' and 'pass' failed. other values, if authentication completed successfully.
typedef int(* putchar_fptr_t) (int)

A function pointer prototype to write a character to the output.

Generally, standard putchar() can be used for this purpose. But other implementations can also be used. For example, in semihosting mode, the standard putchar() is replaced by a debug adapter. But to run CLI over telnet, a replacement putchar function can be used.

Note