![]() |
Shellminator
V1.1.1
Simple Terminal
|
Shellminator object. More...
#include <Shellminator.hpp>
Public Types | |
enum | { BLACK = 30 , RED = 31 , GREEN = 32 , YELLOW = 33 , BLUE = 34 , MAGENTA = 35 , CYAN = 36 , WHITE = 37 } |
VT100 color codes. More... | |
enum | { REGULAR = 0 , BOLD = 1 , LOW_INTENSITY = 2 , ITALIC = 3 , UNDERLINE = 4 , BLINKING = 5 , REVERSE = 6 , BACKGROUND = 7 , INVISIBLE = 8 } |
VT100 font sytles. More... | |
Public Member Functions | |
Shellminator (HardwareSerial *serialPort_p) | |
Shellminator Constructor. More... | |
Shellminator (HardwareSerial *serialPort_p, void(*execution_fn_p)(char *)) | |
Shellminator Constructor. More... | |
Shellminator (Serial_ *serialPort_p) | |
Shellminator Constructor. More... | |
Shellminator (Serial_ *serialPort_p, void(*execution_fn_p)(char *)) | |
Shellminator Constructor. More... | |
Shellminator (WiFiClient *resp) | |
Shellminator Constructor. More... | |
Shellminator (WiFiClient *resp, void(*execution_fn_p)(char *)) | |
Shellminator Constructor. More... | |
void | addExecFunc (void(*execution_fn_p)(char *)) |
Execution function adder function. More... | |
void | begin (char *banner_p) |
Shellminator initialization function. More... | |
void | begin (const char *banner_p) |
Shellminator initialization function. More... | |
void | sendBackspace () |
Sends a backspace. More... | |
void | clear () |
Clear screen. More... | |
void | update () |
Update function. More... | |
void | setTerminalCharacterColor (uint8_t style, uint8_t color) |
Bring some color into your code. More... | |
void | drawLogo () |
Draws the startup logo. More... | |
void | setBannerText (char *banner_p) |
This function sets the banner text. More... | |
void | attachLogo (char *logo_p) |
This function attaches a logo to the terminal. More... | |
void | attachLogo (const char *logo_p) |
This function attaches a logo to the terminal. More... | |
void | overrideUpArrow (void(*func)(void)) |
Override up arrow key behaviour. More... | |
void | overrideDownArrow (void(*func)(void)) |
Override down arrow key behaviour. More... | |
void | overrideLeftArrow (void(*func)(void)) |
Override left arrow key behaviour. More... | |
void | overrideRightArrow (void(*func)(void)) |
Override right arrow key behaviour. More... | |
void | overrideAbortKey (void(*func)(void)) |
Override abort key behaviour. More... | |
void | freeUpArrow () |
Reset up arrow key functionality to default. More... | |
void | freeDownArrow () |
Reset down arrow key functionality to default. More... | |
void | freeLeftArrow () |
Reset left arrow key functionality to default. More... | |
void | freeRightArrow () |
Reset right arrow key functionality to default. More... | |
void | freeAbortKey () |
Reset abort key functionality to default. More... | |
Static Public Member Functions | |
static void | setTerminalCharacterColor (HardwareSerial *serialPort, uint8_t style, uint8_t color) |
Bring some color into your code. More... | |
Public Attributes | |
bool | enableFormatting = true |
This flag enables or disables character formatting. More... | |
Static Public Attributes | |
static const char * | version = SHELLMINATOR_VERSION |
String that holds the version information. More... | |
Shellminator object.
It can be used to interface with a VT100 compatible terminal like PuTTY, Terra Term or minicom. The module requires an Arduino-like Serial object.
Definition at line 121 of file Shellminator.hpp.
anonymous enum |
VT100 color codes.
This enum holds all of the VT100 compatible color codes.
Enumerator | |
---|---|
BLACK | |
RED | |
GREEN | |
YELLOW | |
BLUE | |
MAGENTA | |
CYAN | |
WHITE |
Definition at line 128 of file Shellminator.hpp.
anonymous enum |
VT100 font sytles.
This enum holds all of the VT100 compatible font styles.
Enumerator | |
---|---|
REGULAR | |
BOLD | |
LOW_INTENSITY | |
ITALIC | |
UNDERLINE | |
BLINKING | |
REVERSE | |
BACKGROUND | |
INVISIBLE |
Definition at line 142 of file Shellminator.hpp.
Shellminator::Shellminator | ( | HardwareSerial * | serialPort_p | ) |
Shellminator Constructor.
Constructor for a Shellminator object.
serialPort_p | pointer to an Arduino-like Serial object. |
Definition at line 45 of file Shellminator.cpp.
Shellminator::Shellminator | ( | HardwareSerial * | serialPort_p, |
void(*)(char *) | execution_fn_p | ||
) |
Shellminator Constructor.
Constructor for a Shellminator object with an execution function.
serialPort_p | pointer to an Arduino-like Serial object. |
execution_fn_p | function pointer to the execution function. It has to be a void return type, with one argument, and that argument is a char*type. |
Definition at line 67 of file Shellminator.cpp.
Shellminator::Shellminator | ( | Serial_ * | serialPort_p | ) |
Shellminator Constructor.
Constructor for a Shellminator object.
serialPort_p | pointer to an Arduino-like Serial object. |
Definition at line 91 of file Shellminator.cpp.
Shellminator::Shellminator | ( | Serial_ * | serialPort_p, |
void(*)(char *) | execution_fn_p | ||
) |
Shellminator Constructor.
Constructor for a Shellminator object with an execution function.
serialPort_p | pointer to an Arduino-like Serial object. |
execution_fn_p | function pointer to the execution function. It has to be a void return type, with one argument, and that argument is a char*type. |
Definition at line 113 of file Shellminator.cpp.
Shellminator::Shellminator | ( | WiFiClient * | resp | ) |
Shellminator Constructor.
Constructor for a Shellminator object.
resp | pointer to a WiFiClient object. |
Definition at line 137 of file Shellminator.cpp.
Shellminator::Shellminator | ( | WiFiClient * | resp, |
void(*)(char *) | execution_fn_p | ||
) |
Shellminator Constructor.
Constructor for a Shellminator object with an execution function.
resp | pointer to a WiFiClient object. |
execution_fn_p | function pointer to the execution function. It has to be a void return type, with one argument, and that argument is a char*type. |
Definition at line 159 of file Shellminator.cpp.
void Shellminator::addExecFunc | ( | void(*)(char *) | execution_fn_p | ) |
Execution function adder function.
This function allows you to add or replace the execution function after the constructor.
execution_fn_p | function pointer to the execution function. It has to be a void return type, with one argument, and that argument is a char*type. |
Definition at line 195 of file Shellminator.cpp.
void Shellminator::attachLogo | ( | char * | logo_p | ) |
This function attaches a logo to the terminal.
The logo is just a character array. To create costum startup logo: https://patorjk.com/software/taag/#p=display&f=Slant&t=Arduino To make it to a c-string: https://tomeko.net/online_tools/cpp_text_escape.php?lang=en Add '\r' to all line end.
logo_p | Pointer to the logo's address. |
Definition at line 183 of file Shellminator.cpp.
void Shellminator::attachLogo | ( | const char * | logo_p | ) |
This function attaches a logo to the terminal.
The logo is just a character array. To create costum startup logo: https://patorjk.com/software/taag/#p=display&f=Slant&t=Arduino To make it to a c-string: https://tomeko.net/online_tools/cpp_text_escape.php?lang=en Add '\r' to all line end.
logo_p | Pointer to the logo's address. |
Definition at line 189 of file Shellminator.cpp.
void Shellminator::begin | ( | char * | banner_p | ) |
Shellminator initialization function.
This function initializes the object and prints the startup logo.
banner_p | this is equivalent to a user name in linux like terminals. It is just a visual thing. |
Definition at line 231 of file Shellminator.cpp.
void Shellminator::begin | ( | const char * | banner_p | ) |
Shellminator initialization function.
This function initializes the object and prints the startup logo.
banner_p | this is equivalent to a user name in linux like terminals. It is just a visual thing. |
Definition at line 250 of file Shellminator.cpp.
void Shellminator::clear | ( | ) |
Clear screen.
This function clears the terminal screen.
Definition at line 202 of file Shellminator.cpp.
void Shellminator::drawLogo | ( | ) |
Draws the startup logo.
Draws the startup logo in the terminal
Definition at line 1137 of file Shellminator.cpp.
void Shellminator::freeAbortKey | ( | ) |
Reset abort key functionality to default.
This function resets the abort key functionality to default. If you want to detach the override function for the key, you have to call this function.
Definition at line 1010 of file Shellminator.cpp.
void Shellminator::freeDownArrow | ( | ) |
Reset down arrow key functionality to default.
This function resets the down arrow functionality to default. If you want to detach the override function for the key, you have to call this function.
Definition at line 992 of file Shellminator.cpp.
void Shellminator::freeLeftArrow | ( | ) |
Reset left arrow key functionality to default.
This function resets the left arrow functionality to default. If you want to detach the override function for the key, you have to call this function.
Definition at line 998 of file Shellminator.cpp.
void Shellminator::freeRightArrow | ( | ) |
Reset right arrow key functionality to default.
This function resets the right arrow functionality to default. If you want to detach the override function for the key, you have to call this function.
Definition at line 1004 of file Shellminator.cpp.
void Shellminator::freeUpArrow | ( | ) |
Reset up arrow key functionality to default.
This function resets the up arrow functionality to default. If you want to detach the override function for the key, you have to call this function.
Definition at line 986 of file Shellminator.cpp.
void Shellminator::overrideAbortKey | ( | void(*)(void) | func | ) |
Override abort key behaviour.
With this function you can attach a function that will be called every time when the abort key is pressed. The default abort key is usually a Ctrl + C combo.
func | Pointer to the function that will be called on keypress. |
Definition at line 980 of file Shellminator.cpp.
void Shellminator::overrideDownArrow | ( | void(*)(void) | func | ) |
Override down arrow key behaviour.
With this function you can attach a function that will be called every time when the down arrow key is pressed.
func | Pointer to the function that will be called on keypress. |
Definition at line 962 of file Shellminator.cpp.
void Shellminator::overrideLeftArrow | ( | void(*)(void) | func | ) |
Override left arrow key behaviour.
With this function you can attach a function that will be called every time when the left arrow key is pressed.
func | Pointer to the function that will be called on keypress. |
Definition at line 968 of file Shellminator.cpp.
void Shellminator::overrideRightArrow | ( | void(*)(void) | func | ) |
Override right arrow key behaviour.
With this function you can attach a function that will be called every time when the right arrow key is pressed.
func | Pointer to the function that will be called on keypress. |
Definition at line 974 of file Shellminator.cpp.
void Shellminator::overrideUpArrow | ( | void(*)(void) | func | ) |
Override up arrow key behaviour.
With this function you can attach a function that will be called every time when the up arrow key is pressed.
func | Pointer to the function that will be called on keypress. |
Definition at line 956 of file Shellminator.cpp.
void Shellminator::sendBackspace | ( | ) |
Sends a backspace.
This function makes a backspace in the terminal application. Basically it deletes the last character in the terminal screen.
Definition at line 269 of file Shellminator.cpp.
void Shellminator::setBannerText | ( | char * | banner_p | ) |
This function sets the banner text.
It can be used when you want to change the banner text runtime.
banner_p | String that contains the new banner text. |
|
static |
Bring some color into your code.
This function changes the color and style of the terminal application characters. This function can be used outside of a Shellminator object.
style | Arduino Serial object to print the style code. |
style | VT100 compatible font styles |
color | VT100 compatible color code |
Definition at line 1125 of file Shellminator.cpp.
void Shellminator::setTerminalCharacterColor | ( | uint8_t | style, |
uint8_t | color | ||
) |
Bring some color into your code.
This function changes the color and style of the terminal application characters.
style | VT100 compatible font styles |
color | VT100 compatible color code |
Definition at line 1107 of file Shellminator.cpp.
void Shellminator::update | ( | ) |
Update function.
This function handles all of the communication related stuff between the code and the terminal application.
Definition at line 1016 of file Shellminator.cpp.
bool Shellminator::enableFormatting = true |
This flag enables or disables character formatting.
It can be usefull when VT100 format parser is not available on the host device.
Definition at line 368 of file Shellminator.hpp.
|
static |
String that holds the version information.
Definition at line 155 of file Shellminator.hpp.