VT100 Terminal App
Circle VT100 module documentation
Loading...
Searching...
No Matches
CTConfig Class Reference

Cooperative task responsible for configuration persistence and lookup. More...

#include <TConfig.h>

Inheritance diagram for CTConfig:

Public Member Functions

 CTConfig (void)
 Construct the configuration task with default values.
 
 ~CTConfig (void)
 Release configuration resources.
 
boolean Initialize (void)
 Initialize the configuration task and load defaults.
 
void Run () override
 Scheduler entry point to service configuration events.
 
boolean LoadFromFile (void)
 Load configuration from persistent storage if present.
 
boolean SaveToFile (void)
 Save current configuration values to persistent storage.
 
unsigned int GetLineEndingMode (void) const
 Retrieve the line ending mode (0=LF, 1=CRLF, 2=CR).
 
void SetLineEndingMode (unsigned int mode)
 Update the configured line ending mode.
 
unsigned int GetBaudRate (void) const
 Retrieve the configured serial baud rate.
 
void SetBaudRate (unsigned int baudRate)
 Set the serial baud rate.
 
boolean GetCursorBlock (void) const
 Check whether the cursor is configured as block style.
 
void SetCursorBlock (boolean block)
 Change cursor style.
 
boolean GetCursorBlinking (void) const
 Check whether the cursor is configured to blink.
 
void SetCursorBlinking (boolean blinking)
 Toggle cursor blinking behavior.
 
boolean GetVTTestEnabled (void) const
 Check whether the VT test runner is enabled.
 
void SetVTTestEnabled (boolean enabled)
 Enable or disable the VT test runner.
 
boolean GetVT52ModeEnabled (void) const
 Check whether VT52 emulation mode is enabled.
 
void SetVT52ModeEnabled (boolean enabled)
 Enable or disable VT52 emulation mode.
 
unsigned int GetLogOutput (void) const
 Retrieve the configured log output bitmask.
 
void SetLogOutput (unsigned int logOutput)
 Update the log output bitmask.
 
const char * GetLogFileName (void) const
 Retrieve the configured log file name.
 
void SetLogFileName (const char *pFileName)
 Set the configured log file name.
 
EColorSelection GetTextColor (void) const
 Retrieve the configured text color index.
 
void SetTextColor (EColorSelection color)
 Set the configured text color index.
 
EColorSelection GetBackgroundColor (void) const
 Retrieve the configured background color index.
 
void SetBackgroundColor (EColorSelection color)
 Set the configured background color index.
 
EFontSelection GetFontSelection (void) const
 Retrieve the configured font selection.
 
void SetFontSelection (EFontSelection selection)
 Set the active font selection.
 
unsigned int GetBuzzerVolume (void) const
 Retrieve the buzzer volume setting in percent.
 
void SetBuzzerVolume (unsigned int volume)
 Adjust the buzzer volume setting.
 
unsigned int GetKeyClick (void) const
 Check whether key click feedback is enabled.
 
void SetKeyClick (boolean enabled)
 Enable or disable key click feedback.
 
unsigned int GetSwitchTxRx (void) const
 Check whether TX/RX wiring is swapped.
 
void SetSwitchTxRx (boolean enabled)
 Enable or disable TX/RX swap mode.
 
unsigned int GetWlanHostAutoStart (void) const
 Check whether WLAN host mode auto-start is enabled.
 
void SetWlanHostAutoStart (boolean enabled)
 Enable or disable WLAN host mode auto-start on telnet connect.
 
unsigned int GetKeyRepeatDelayMs (void) const
 Retrieve key repeat delay in milliseconds.
 
boolean GetKeyAutoRepeatEnabled (void) const
 Check whether keyboard auto-repeat is enabled.
 
void SetKeyAutoRepeatEnabled (boolean enabled)
 Enable or disable keyboard auto-repeat.
 
void SetKeyRepeatDelayMs (unsigned int delayMs)
 Set key repeat delay.
 
unsigned int GetKeyRepeatRateCps (void) const
 Retrieve key repeat rate in characters per second.
 
void SetKeyRepeatRateCps (unsigned int rateCps)
 Set key repeat rate.
 
boolean GetScreenInverted (void) const
 Check whether screen colors are inverted (screen mode).
 
void SetScreenInverted (boolean inverted)
 Enable or disable screen color inversion.
 
boolean GetSmoothScrollEnabled (void) const
 Check whether smooth scrolling animation is enabled.
 
void SetSmoothScrollEnabled (boolean enabled)
 Enable or disable smooth scrolling animation.
 
boolean GetWrapAroundEnabled (void) const
 Check whether automatic line wrap-around is enabled.
 
void SetWrapAroundEnabled (boolean enabled)
 Enable or disable automatic line wrap-around.
 
unsigned int GetSerialDataBits (void) const
 Retrieve configured UART data bits.
 
void SetSerialDataBits (unsigned int dataBits)
 Set UART data bits.
 
unsigned int GetSerialParityMode (void) const
 Retrieve configured UART parity mode.
 
void SetSerialParityMode (unsigned int parityMode)
 Set UART parity mode.
 
boolean GetSoftwareFlowControl (void) const
 Query whether software flow control (XON/XOFF) is enabled.
 
void SetSoftwareFlowControl (boolean enabled)
 Enable or disable software flow control.
 
boolean GetMarginBellEnabled (void) const
 Query whether margin bell is enabled.
 
void SetMarginBellEnabled (boolean enabled)
 Enable or disable margin bell.
 
void ResolveLogOutputs (bool &screen, bool &file, bool &wlan) const
 Decode the log output bitmask into individual booleans.
 
const char * GetLineEndingModeString (void) const
 Obtain a textual description of the current line ending mode.
 
void logConfig (void) const
 Emit the active configuration to the logger.
 
bool IsTabStop (unsigned int column) const
 Query whether a tab stop is set at the specified column.
 
void SetTabStop (unsigned int column, bool enabled)
 Set or clear a tab stop at the specified column.
 
void InitDefaultTabStops (unsigned int columns=TabStopsMax)
 Reset tab stops to default 8-column positions.
 

Static Public Member Functions

static CTConfigGet (void)
 Access the singleton configuration task.
 

Static Public Attributes

static constexpr unsigned int TabStopsMax = 160U
 

Detailed Description

Cooperative task responsible for configuration persistence and lookup.

The configuration task boots with defaults, optionally loads the persisted file, and offers getters/setters for every tunable VT100 parameter. Other subsystems depend on CTConfig to discover active fonts, color themes, serial behavior, and logging destinations. It also provides helper utilities to decode bitmasks and emit state summaries for diagnostics.

Member Function Documentation

◆ Get()

CTConfig * CTConfig::Get ( void  )
static

Access the singleton configuration task.

Returns
Pointer to the configuration task instance.

◆ GetBackgroundColor()

EColorSelection CTConfig::GetBackgroundColor ( void  ) const
inline

Retrieve the configured background color index.

Returns
Current background color selection.

◆ GetBaudRate()

unsigned int CTConfig::GetBaudRate ( void  ) const
inline

Retrieve the configured serial baud rate.

Returns
Baud rate in bits per second.

◆ GetBuzzerVolume()

unsigned int CTConfig::GetBuzzerVolume ( void  ) const
inline

Retrieve the buzzer volume setting in percent.

Returns
Volume percent (0-100).

◆ GetCursorBlinking()

boolean CTConfig::GetCursorBlinking ( void  ) const
inline

Check whether the cursor is configured to blink.

Returns
TRUE if blinking is enabled.

◆ GetCursorBlock()

boolean CTConfig::GetCursorBlock ( void  ) const
inline

Check whether the cursor is configured as block style.

Returns
TRUE if block cursor is selected, FALSE for underline.

◆ GetFontSelection()

EFontSelection CTConfig::GetFontSelection ( void  ) const
inline

Retrieve the configured font selection.

Returns
Current font selection value.

◆ GetKeyAutoRepeatEnabled()

boolean CTConfig::GetKeyAutoRepeatEnabled ( void  ) const
inline

Check whether keyboard auto-repeat is enabled.

Returns
TRUE if auto-repeat is enabled.

◆ GetKeyClick()

unsigned int CTConfig::GetKeyClick ( void  ) const
inline

Check whether key click feedback is enabled.

Returns
TRUE if enabled.

◆ GetKeyRepeatDelayMs()

unsigned int CTConfig::GetKeyRepeatDelayMs ( void  ) const
inline

Retrieve key repeat delay in milliseconds.

Returns
Delay in milliseconds.

◆ GetKeyRepeatRateCps()

unsigned int CTConfig::GetKeyRepeatRateCps ( void  ) const
inline

Retrieve key repeat rate in characters per second.

Returns
Rate in characters per second.

◆ GetLineEndingMode()

unsigned int CTConfig::GetLineEndingMode ( void  ) const
inline

Retrieve the line ending mode (0=LF, 1=CRLF, 2=CR).

Returns
Current line ending mode.

◆ GetLineEndingModeString()

const char * CTConfig::GetLineEndingModeString ( void  ) const

Obtain a textual description of the current line ending mode.

Returns
Pointer to static string describing the mode.

◆ GetLogFileName()

const char * CTConfig::GetLogFileName ( void  ) const
inline

Retrieve the configured log file name.

Returns
Pointer to the log file name string.

◆ GetLogOutput()

unsigned int CTConfig::GetLogOutput ( void  ) const
inline

Retrieve the configured log output bitmask.

Returns
Bitmask selecting log destinations.

◆ GetMarginBellEnabled()

boolean CTConfig::GetMarginBellEnabled ( void  ) const
inline

Query whether margin bell is enabled.

Returns
TRUE if enabled.

◆ GetScreenInverted()

boolean CTConfig::GetScreenInverted ( void  ) const
inline

Check whether screen colors are inverted (screen mode).

Returns
TRUE if foreground/background are swapped.

◆ GetSerialDataBits()

unsigned int CTConfig::GetSerialDataBits ( void  ) const
inline

Retrieve configured UART data bits.

Returns
Data bits (7 or 8).

◆ GetSerialParityMode()

unsigned int CTConfig::GetSerialParityMode ( void  ) const
inline

Retrieve configured UART parity mode.

Returns
Parity mode (0=none, 1=even, 2=odd).

◆ GetSmoothScrollEnabled()

boolean CTConfig::GetSmoothScrollEnabled ( void  ) const
inline

Check whether smooth scrolling animation is enabled.

Returns
TRUE if enabled.

◆ GetSoftwareFlowControl()

boolean CTConfig::GetSoftwareFlowControl ( void  ) const
inline

Query whether software flow control (XON/XOFF) is enabled.

Returns
TRUE if enabled.

◆ GetSwitchTxRx()

unsigned int CTConfig::GetSwitchTxRx ( void  ) const
inline

Check whether TX/RX wiring is swapped.

Returns
TRUE if swapped.

◆ GetTextColor()

EColorSelection CTConfig::GetTextColor ( void  ) const
inline

Retrieve the configured text color index.

Returns
Current text color selection.

◆ GetVT52ModeEnabled()

boolean CTConfig::GetVT52ModeEnabled ( void  ) const
inline

Check whether VT52 emulation mode is enabled.

Returns
TRUE if VT52 mode is enabled.

◆ GetVTTestEnabled()

boolean CTConfig::GetVTTestEnabled ( void  ) const
inline

Check whether the VT test runner is enabled.

Returns
TRUE if enabled.

◆ GetWlanHostAutoStart()

unsigned int CTConfig::GetWlanHostAutoStart ( void  ) const
inline

Check whether WLAN host mode auto-start is enabled.

Returns
1 if host mode auto-start is enabled, else 0.

◆ GetWrapAroundEnabled()

boolean CTConfig::GetWrapAroundEnabled ( void  ) const
inline

Check whether automatic line wrap-around is enabled.

Returns
TRUE if enabled.

◆ InitDefaultTabStops()

void CTConfig::InitDefaultTabStops ( unsigned int  columns = TabStopsMax)

Reset tab stops to default 8-column positions.

Note
Columns are 0-based; default stops set at 8,16,24,...

◆ Initialize()

boolean CTConfig::Initialize ( void  )

Initialize the configuration task and load defaults.

Returns
TRUE on success, FALSE otherwise.

◆ IsTabStop()

bool CTConfig::IsTabStop ( unsigned int  column) const

Query whether a tab stop is set at the specified column.

Note
Column index is 0-based.

◆ LoadFromFile()

boolean CTConfig::LoadFromFile ( void  )

Load configuration from persistent storage if present.

Returns
TRUE if loading succeeded, FALSE otherwise.

◆ ResolveLogOutputs()

void CTConfig::ResolveLogOutputs ( bool &  screen,
bool &  file,
bool &  wlan 
) const

Decode the log output bitmask into individual booleans.

Parameters
screenTRUE if screen logging is enabled (output).
fileTRUE if file logging is enabled (output).
wlanTRUE if WLAN logging is enabled (output).

◆ SaveToFile()

boolean CTConfig::SaveToFile ( void  )

Save current configuration values to persistent storage.

Returns
TRUE if writing succeeded, FALSE otherwise.

◆ SetBackgroundColor()

void CTConfig::SetBackgroundColor ( EColorSelection  color)

Set the configured background color index.

Parameters
colorNew background color selection.

◆ SetBaudRate()

void CTConfig::SetBaudRate ( unsigned int  baudRate)

Set the serial baud rate.

Parameters
baudRateDesired baud rate.

◆ SetBuzzerVolume()

void CTConfig::SetBuzzerVolume ( unsigned int  volume)

Adjust the buzzer volume setting.

Parameters
volumeVolume percent (0-100).

◆ SetCursorBlinking()

void CTConfig::SetCursorBlinking ( boolean  blinking)

Toggle cursor blinking behavior.

Parameters
blinkingTRUE to enable blinking.

◆ SetCursorBlock()

void CTConfig::SetCursorBlock ( boolean  block)

Change cursor style.

Parameters
blockTRUE to select block cursor, FALSE for underline.

◆ SetFontSelection()

void CTConfig::SetFontSelection ( EFontSelection  selection)

Set the active font selection.

Parameters
selectionFont selection enum value.

◆ SetKeyAutoRepeatEnabled()

void CTConfig::SetKeyAutoRepeatEnabled ( boolean  enabled)

Enable or disable keyboard auto-repeat.

Parameters
enabledTRUE to enable auto-repeat.

◆ SetKeyClick()

void CTConfig::SetKeyClick ( boolean  enabled)

Enable or disable key click feedback.

Parameters
enabledTRUE to enable click feedback.

◆ SetKeyRepeatDelayMs()

void CTConfig::SetKeyRepeatDelayMs ( unsigned int  delayMs)

Set key repeat delay.

Parameters
delayMsDelay in milliseconds.

◆ SetKeyRepeatRateCps()

void CTConfig::SetKeyRepeatRateCps ( unsigned int  rateCps)

Set key repeat rate.

Parameters
rateCpsRate in characters per second.

◆ SetLineEndingMode()

void CTConfig::SetLineEndingMode ( unsigned int  mode)

Update the configured line ending mode.

Parameters
modeNew mode value (0=LF, 1=CRLF, 2=CR).

◆ SetLogFileName()

void CTConfig::SetLogFileName ( const char *  pFileName)

Set the configured log file name.

Parameters
pFileNameNull-terminated file name.

◆ SetLogOutput()

void CTConfig::SetLogOutput ( unsigned int  logOutput)

Update the log output bitmask.

Parameters
logOutputBitmask selecting log destinations.

◆ SetMarginBellEnabled()

void CTConfig::SetMarginBellEnabled ( boolean  enabled)

Enable or disable margin bell.

Parameters
enabledTRUE to enable margin bell.

◆ SetScreenInverted()

void CTConfig::SetScreenInverted ( boolean  inverted)

Enable or disable screen color inversion.

Parameters
invertedTRUE to swap foreground/background colors.

◆ SetSerialDataBits()

void CTConfig::SetSerialDataBits ( unsigned int  dataBits)

Set UART data bits.

Parameters
dataBitsData bits (7 or 8).

◆ SetSerialParityMode()

void CTConfig::SetSerialParityMode ( unsigned int  parityMode)

Set UART parity mode.

Parameters
parityModeParity mode (0=none, 1=even, 2=odd).

◆ SetSmoothScrollEnabled()

void CTConfig::SetSmoothScrollEnabled ( boolean  enabled)

Enable or disable smooth scrolling animation.

Parameters
enabledTRUE to enable smooth scrolling.

◆ SetSoftwareFlowControl()

void CTConfig::SetSoftwareFlowControl ( boolean  enabled)

Enable or disable software flow control.

Parameters
enabledTRUE to enable software flow control.

◆ SetSwitchTxRx()

void CTConfig::SetSwitchTxRx ( boolean  enabled)

Enable or disable TX/RX swap mode.

Parameters
enabledTRUE to swap the wiring.

◆ SetTabStop()

void CTConfig::SetTabStop ( unsigned int  column,
bool  enabled 
)

Set or clear a tab stop at the specified column.

Note
Column index is 0-based.

◆ SetTextColor()

void CTConfig::SetTextColor ( EColorSelection  color)

Set the configured text color index.

Parameters
colorNew text color selection.

◆ SetVT52ModeEnabled()

void CTConfig::SetVT52ModeEnabled ( boolean  enabled)

Enable or disable VT52 emulation mode.

Parameters
enabledTRUE to enable VT52 mode.

◆ SetVTTestEnabled()

void CTConfig::SetVTTestEnabled ( boolean  enabled)

Enable or disable the VT test runner.

Parameters
enabledTRUE to enable tests.

◆ SetWlanHostAutoStart()

void CTConfig::SetWlanHostAutoStart ( boolean  enabled)

Enable or disable WLAN host mode auto-start on telnet connect.

Parameters
enabledTRUE to auto-enable host mode for new sessions.

◆ SetWrapAroundEnabled()

void CTConfig::SetWrapAroundEnabled ( boolean  enabled)

Enable or disable automatic line wrap-around.

Parameters
enabledTRUE to wrap to next line at right margin.

The documentation for this class was generated from the following files: