Class that interfaces with the simulation API via a terminal UI.
More...
#include <app_terminal.h>
|
std::string | toLower (const std::string &input) |
| Convert a string input to lower case. More...
|
|
void | handleGpioCommands (const std::string &action, std::vector< std::string > &tokens) |
| Handle GPIO commands provoidede an action statement and tokenized parameters. More...
|
|
void | parseCommand (std::vector< std::string > &tokens) |
| Parse the tokens and branch to the appropiate handler function. More...
|
|
Class that interfaces with the simulation API via a terminal UI.
This class is responsible packaging commands based on terminal inputs This class is the lightest application-layer, and should be replaced in the future with a GUI
◆ Terminal()
Constructs a Terminal object.
Initializes the Terminal. The constructor sets up internal variables The constructor shall bind to the server
- Parameters
-
server | Pointer to a server instance |
◆ handleGpioCommands()
void handleGpioCommands |
( |
const std::string & |
action, |
|
|
std::vector< std::string > & |
tokens |
|
) |
| |
|
private |
Handle GPIO commands provoidede an action statement and tokenized parameters.
- Parameters
-
action | Action statement to select the Remote procedure call |
tokens | List containing action parameters to format the Remote procedure call |
◆ parseCommand()
void parseCommand |
( |
std::vector< std::string > & |
tokens | ) |
|
|
private |
Parse the tokens and branch to the appropiate handler function.
This shall branch to handleGpioCommands, handleI2CCommands, handleSPICommands and handleInterruptCommands
- Parameters
-
tokens | List containing tokenized input string |
◆ run()
While true spin-loop to handle shell inputs.
This function must be called after server initialization This function will never return. To exit safely, you must enter 'exit'
Create tokens out of input string Input = "GPIO GET_PIN_STATE A9" tokens = ["GPIO", "GET_PIN_STATE", "A9"]
◆ toLower()
std::string toLower |
( |
const std::string & |
input | ) |
|
|
private |
Convert a string input to lower case.
- Parameters
-
input | String input to be converted |
- Returns
- Lower-case version of the input string
◆ m_Server
Pointer to the server instance
◆ m_targetClient
Pointer to a target client instance
The documentation for this class was generated from the following files:
- simulation/server/app/inc/app_terminal.h
- simulation/server/app/src/app_terminal.cc