15#include <circle/sched/task.h>
16#include <circle/string.h>
39 unsigned int *variable;
40 unsigned int defaultValue;
41 const char *description;
56 static constexpr unsigned int TabStopsMax = 160U;
154 EFontSelection
GetFontSelection(
void)
const {
return static_cast<EFontSelection
>(m_FontSelection); }
271 bool IsTabStop(
unsigned int column)
const;
274 void SetTabStop(
unsigned int column,
bool enabled);
282 boolean LoadConfigFromFile(
void);
284 void LoadDefaults(
void);
288 boolean ParseConfigLine(
const char *pLine);
291 void TrimWhitespace(
char *pString);
294 unsigned int m_LineEnding;
295 unsigned int m_BaudRate;
296 unsigned int m_CursorType;
297 unsigned int m_CursorBlinking;
298 unsigned int m_VTTestEnabled;
299 unsigned int m_VT52Mode;
300 unsigned int m_LogOutput;
301 EColorSelection m_TextColorIndex;
302 EColorSelection m_BackgroundColorIndex;
303 unsigned int m_FontSelection;
304 unsigned int m_BuzzerVolume;
305 unsigned int m_KeyClick;
306 unsigned int m_SwitchTxRx;
307 unsigned int m_WlanHostAutoStart;
308 unsigned int m_KeyAutoRepeat;
309 unsigned int m_KeyRepeatDelayMs;
310 unsigned int m_KeyRepeatRateCps;
311 unsigned int m_ScreenInverted;
312 unsigned int m_SmoothScrollEnabled;
313 unsigned int m_WrapAroundEnabled;
314 unsigned int m_SerialDataBits;
315 unsigned int m_SerialParityMode;
316 unsigned int m_SoftwareFlowControl;
317 unsigned int m_MarginBellEnabled;
318 char m_LogFileName[64];
319 bool m_TabStops[TabStopsMax];
321 static const char ConfigFileName[];
Declares shared color selection enums for the VT100 renderer stack.
Declares the task that prepares VT100 font assets for rendering.
Central coordinator for hardware bring-up and runtime control.
Definition kernel.h:73
Cooperative task responsible for configuration persistence and lookup.
Definition TConfig.h:54
unsigned int GetKeyClick(void) const
Check whether key click feedback is enabled.
Definition TConfig.h:168
EColorSelection GetBackgroundColor(void) const
Retrieve the configured background color index.
Definition TConfig.h:147
void SetVTTestEnabled(boolean enabled)
Enable or disable the VT test runner.
Definition TConfig.cpp:1077
void SetSwitchTxRx(boolean enabled)
Enable or disable TX/RX swap mode.
Definition TConfig.cpp:1208
boolean GetMarginBellEnabled(void) const
Query whether margin bell is enabled.
Definition TConfig.h:251
void SetBuzzerVolume(unsigned int volume)
Adjust the buzzer volume setting.
Definition TConfig.cpp:1191
void SetTextColor(EColorSelection color)
Set the configured text color index.
Definition TConfig.cpp:1144
static CTConfig * Get(void)
Access the singleton configuration task.
Definition TConfig.cpp:41
void SetBaudRate(unsigned int baudRate)
Set the serial baud rate.
Definition TConfig.cpp:1048
unsigned int GetSerialDataBits(void) const
Retrieve configured UART data bits.
Definition TConfig.h:230
void SetSoftwareFlowControl(boolean enabled)
Enable or disable software flow control.
Definition TConfig.cpp:1296
unsigned int GetKeyRepeatRateCps(void) const
Retrieve key repeat rate in characters per second.
Definition TConfig.h:202
unsigned int GetBuzzerVolume(void) const
Retrieve the buzzer volume setting in percent.
Definition TConfig.h:161
void SetBackgroundColor(EColorSelection color)
Set the configured background color index.
Definition TConfig.cpp:1155
EColorSelection GetTextColor(void) const
Retrieve the configured text color index.
Definition TConfig.h:140
EFontSelection GetFontSelection(void) const
Retrieve the configured font selection.
Definition TConfig.h:154
boolean GetKeyAutoRepeatEnabled(void) const
Check whether keyboard auto-repeat is enabled.
Definition TConfig.h:192
void SetTabStop(unsigned int column, bool enabled)
Set or clear a tab stop at the specified column.
Definition TConfig.cpp:417
boolean GetSoftwareFlowControl(void) const
Query whether software flow control (XON/XOFF) is enabled.
Definition TConfig.h:244
void SetKeyRepeatRateCps(unsigned int rateCps)
Set key repeat rate.
Definition TConfig.cpp:1241
void InitDefaultTabStops(unsigned int columns=TabStopsMax)
Reset tab stops to default 8-column positions.
Definition TConfig.cpp:426
void SetKeyRepeatDelayMs(unsigned int delayMs)
Set key repeat delay.
Definition TConfig.cpp:1226
unsigned int GetSwitchTxRx(void) const
Check whether TX/RX wiring is swapped.
Definition TConfig.h:175
bool IsTabStop(unsigned int column) const
Query whether a tab stop is set at the specified column.
Definition TConfig.cpp:408
boolean GetSmoothScrollEnabled(void) const
Check whether smooth scrolling animation is enabled.
Definition TConfig.h:216
void logConfig(void) const
Emit the active configuration to the logger.
Definition TConfig.cpp:284
boolean LoadFromFile(void)
Load configuration from persistent storage if present.
Definition TConfig.cpp:443
void SetLogOutput(unsigned int logOutput)
Update the log output bitmask.
Definition TConfig.cpp:1089
const char * GetLogFileName(void) const
Retrieve the configured log file name.
Definition TConfig.h:133
boolean GetScreenInverted(void) const
Check whether screen colors are inverted (screen mode).
Definition TConfig.h:209
unsigned int GetWlanHostAutoStart(void) const
Check whether WLAN host mode auto-start is enabled.
Definition TConfig.h:182
void SetScreenInverted(boolean inverted)
Enable or disable screen color inversion.
Definition TConfig.cpp:1256
void SetCursorBlock(boolean block)
Change cursor style.
Definition TConfig.cpp:1065
~CTConfig(void)
Release configuration resources.
Definition TConfig.cpp:362
void SetLineEndingMode(unsigned int mode)
Update the configured line ending mode.
Definition TConfig.cpp:1054
unsigned int GetSerialParityMode(void) const
Retrieve configured UART parity mode.
Definition TConfig.h:237
void SetVT52ModeEnabled(boolean enabled)
Enable or disable VT52 emulation mode.
Definition TConfig.cpp:1083
boolean GetCursorBlock(void) const
Check whether the cursor is configured as block style.
Definition TConfig.h:98
void SetSerialParityMode(unsigned int parityMode)
Set UART parity mode.
Definition TConfig.cpp:1285
const char * GetLineEndingModeString(void) const
Obtain a textual description of the current line ending mode.
Definition TConfig.cpp:1313
boolean SaveToFile(void)
Save current configuration values to persistent storage.
Definition TConfig.cpp:461
void SetWrapAroundEnabled(boolean enabled)
Enable or disable automatic line wrap-around.
Definition TConfig.cpp:1268
unsigned int GetLineEndingMode(void) const
Retrieve the line ending mode (0=LF, 1=CRLF, 2=CR).
Definition TConfig.h:84
boolean GetWrapAroundEnabled(void) const
Check whether automatic line wrap-around is enabled.
Definition TConfig.h:223
void SetSerialDataBits(unsigned int dataBits)
Set UART data bits.
Definition TConfig.cpp:1274
boolean Initialize(void)
Initialize the configuration task and load defaults.
Definition TConfig.cpp:367
void ResolveLogOutputs(bool &screen, bool &file, bool &wlan) const
Decode the log output bitmask into individual booleans.
Definition TConfig.cpp:1100
unsigned int GetBaudRate(void) const
Retrieve the configured serial baud rate.
Definition TConfig.h:91
boolean GetVTTestEnabled(void) const
Check whether the VT test runner is enabled.
Definition TConfig.h:112
void SetLogFileName(const char *pFileName)
Set the configured log file name.
Definition TConfig.cpp:1166
void SetKeyClick(boolean enabled)
Enable or disable key click feedback.
Definition TConfig.cpp:1202
CTConfig(void)
Construct the configuration task with default values.
Definition TConfig.cpp:322
void Run() override
Scheduler entry point to service configuration events.
Definition TConfig.cpp:376
void SetKeyAutoRepeatEnabled(boolean enabled)
Enable or disable keyboard auto-repeat.
Definition TConfig.cpp:1220
void SetWlanHostAutoStart(boolean enabled)
Enable or disable WLAN host mode auto-start on telnet connect.
Definition TConfig.cpp:1214
unsigned int GetKeyRepeatDelayMs(void) const
Retrieve key repeat delay in milliseconds.
Definition TConfig.h:189
boolean GetCursorBlinking(void) const
Check whether the cursor is configured to blink.
Definition TConfig.h:105
void SetFontSelection(EFontSelection selection)
Set the active font selection.
Definition TConfig.cpp:1180
boolean GetVT52ModeEnabled(void) const
Check whether VT52 emulation mode is enabled.
Definition TConfig.h:119
void SetCursorBlinking(boolean blinking)
Toggle cursor blinking behavior.
Definition TConfig.cpp:1071
void SetSmoothScrollEnabled(boolean enabled)
Enable or disable smooth scrolling animation.
Definition TConfig.cpp:1262
void SetMarginBellEnabled(boolean enabled)
Enable or disable margin bell.
Definition TConfig.cpp:1302
unsigned int GetLogOutput(void) const
Retrieve the configured log output bitmask.
Definition TConfig.h:126