Project 8
Bluetooth
|
Neff Site |
This module implements a command line interface for the Bluetooth click. More...
Go to the source code of this file.
Functions | |
cli_state_t | cli_parse_command (char token, cli_command_t *command) |
Parse command. More... | |
cli_state_t | cli_parse_led_argument (char token, uint8_t *argument) |
Parse LED argument. More... | |
cli_state_t | cli_parse_blink_argument1 (char token, uint8_t *argument) |
Parse first blink argument. More... | |
cli_state_t | cli_parse_blink_argument2 (char token, uint8_t *argument) |
Parse second blink argument. More... | |
cli_state_t | cli_parse_terminal (char token) |
Parse terminal. More... | |
cli_state_t | cli_execute (cli_command_t command, uint8_t argument1, uint8_t argument2) |
Execute command. More... | |
cli_state_t | cli_error (void) |
Print error message. More... | |
This module implements a command line interface for the Bluetooth click.
enum cli_command_t |
enum cli_state_t |
cli_state_t cli_error | ( | void | ) |
Print error message.
Prints an error message if an error occured. The subsequent state is CLI_STATE_GET_COMMAND
.
cli_state_t cli_execute | ( | cli_command_t | command, |
uint8_t | argument1, | ||
uint8_t | argument2 | ||
) |
Execute command.
Executes the provided command with the given argument. It returns CLI_STATE_GET_COMMAND
if no error occured.
command | The command to be executed. |
argument1 | The first argument for the command. |
argument2 | The second argument for the command. |
cli_state_t cli_parse_blink_argument1 | ( | char | token, |
uint8_t * | argument | ||
) |
Parse first blink argument.
This routine parses the first argument that follows the CLI_CMD_BLINK
command. The subsequent state is returnd. It will be CLI_STATE_PARSE_ERROR
if the argument is not valid. This argument is the LED which shall blink. Valid LED numbers are [0-7].
token | The input token. |
argument | The number of the LED. |
cli_state_t cli_parse_blink_argument2 | ( | char | token, |
uint8_t * | argument | ||
) |
Parse second blink argument.
This routine parses the second argument that follows the CLI_CMD_BLINK
command. The subsequent state is returnd. It will be CLI_STATE_PARSE_ERROR
if the argument is not valid. This argument is the number of blinkings.
token | The input token. |
argument | The number of blinkings. |
cli_state_t cli_parse_command | ( | char | token, |
cli_command_t * | command | ||
) |
Parse command.
A parser analyzes input tokens and determins their meaning. Their meaning is defined by the protocol. This routine parses the input token and determins the specified command. It also returns the subsequent state. A CLI_STATE_PARSE_ERROR
is returned if no valid command is found.
token | The input token. |
command | The parsed command. |
cli_state_t cli_parse_led_argument | ( | char | token, |
uint8_t * | argument | ||
) |
Parse LED argument.
This routine parses the argument that follows the CLI_CMD_ON
or the CLI_CMD_OFF
command. The subsequent state is returnd. It will be CLI_STATE_PARSE_ERROR
if the the argument is not valid. The argument is the LED which shall be turned on or off. Valid LED numbers are [0-7].
token | The input token. |
argument | The number of the LED. |
cli_state_t cli_parse_terminal | ( | char | token | ) |
Parse terminal.
Terminal symbols are symbols which terminate a command. This routine checks if the token passed is a terminal. It returns CLI_STATE_EXECUTE
if a terminal symbol was found or CLI_STATE_PARSE_ERROR
otherwise.
token | The input token. |
Contact | Generated by 1.8.13 |