Midnight Sun Firmware
Loading...
Searching...
No Matches
app_terminal.h
1#pragma once
2
3/************************************************************************************************
4 * @file app_terminal.h
5 *
6 * @brief Header file defining the Application Terminal class
7 *
8 * @date 2025-01-04
9 * @author Aryan Kashem
10 ************************************************************************************************/
11
12/* Standard library Headers */
13
14/* Inter-component Headers */
15#include "client_connection.h"
16#include "server.h"
17
18/* Intra-component Headers */
19
32class Terminal {
33 private:
42 std::string toLower(const std::string &input);
43
49 void handleGpioCommands(const std::string &action, std::vector<std::string> &tokens);
50
56 void parseCommand(std::vector<std::string> &tokens);
57
58 public:
65 Terminal(Server *server);
66
72 void run();
73};
74
Class that represents a connection between the server and a client.
Definition: client_connection.h:37
Class that represents the central server that connects to multiple clients.
Definition: server.h:39
Class that interfaces with the simulation API via a terminal UI.
Definition: app_terminal.h:32
void run()
While true spin-loop to handle shell inputs.
Definition: app_terminal.cc:85
void parseCommand(std::vector< std::string > &tokens)
Parse the tokens and branch to the appropiate handler function.
Definition: app_terminal.cc:63
ClientConnection * m_targetClient
Definition: app_terminal.h:35
void handleGpioCommands(const std::string &action, std::vector< std::string > &tokens)
Handle GPIO commands provoidede an action statement and tokenized parameters.
Definition: app_terminal.cc:33
Server * m_Server
Definition: app_terminal.h:34
std::string toLower(const std::string &input)
Convert a string input to lower case.
Definition: app_terminal.cc:27