System Configuration Display Application
Overview
The System Configuration Display Application is an embedded C++ program designed to demonstrate how to read and display system configuration settings stored in JSON format. This application provides a simple command-line interface for examining device configuration data and memory usage statistics.
Features
- Configuration Tree Display: Read and display the complete system configuration structure in JSON format
- Memory Usage Monitoring: Show how much memory is being used by configuration settings versus total available space
- Network Information: Display current network interface settings including IP address, AutoIP, and Gateway
- Interactive Command Interface: Simple character-based menu system for user interaction
Application Details
Main Components
- Application Name: ShowSystemConfiguration
- Primary Function: Configuration system exploration and diagnostics
- Interface: Serial port communication with command-driven menu system
System Configuration
The configuration system stores critical device settings including:
- Device boot parameters
- Network interface settings
- Serial interface configuration
- All settings stored in JSON format for easy parsing and modification
Network Features
The application automatically:
- Waits for active network connection (5-second timeout)
- Displays current network configuration on startup
- Shows IP address, AutoIP, and Gateway settings for the first network interface
User Interface
Available Commands
| Command | Description |
C | Show Configuration Tree (displays complete JSON structure) |
S | Show Configuration Memory Usage (current usage vs. available space) |
? | Show Command List (displays this help menu) |
Command Operation
- Launch the application
- Wait for network initialization
- Review displayed network information
- Use single-character commands to interact with the system
- Commands are case-insensitive
Technical Implementation
Dependencies
The application includes several system libraries:
Key Functions
ShowTree() - Displays the configuration tree structure in JSON format
ShowConfigMemoryUsage() - Reports memory usage statistics
ShowCommandList() - Displays available user commands
UserMain() - Main application loop and initialization
System Diagnostics
The application enables system diagnostics by default, which should be disabled for production deployments to optimize performance and reduce debug output.
Memory Management
The application provides real-time monitoring of configuration memory usage through the ConfigSize() and ConfigMaxSize() functions, allowing administrators to:
- Monitor current configuration storage usage
- Understand available configuration space
- Plan for configuration expansion
- Identify potential memory constraints
Network Initialization
The application implements a robust network startup sequence:
- Initialize core system components
- Enable system diagnostics (development mode)
- Wait for network to become active (5-second timeout)
- Display network configuration information
- Enter interactive command mode
Usage Example
Config Tree Demo built at 12:34:56 on Jan 01 2025
'?' for commands
IP: 192.168.1.100
AutoIP : 169.254.1.1
Gateway: 192.168.1.1
Command List
----------------
C = Show Config Tree
S = Show Config Memory Usage
? = Show Commands
Configuration Memory Used: 1024 bytes, out of 8192 bytes
Development Notes
- The application runs in a continuous loop, checking for user input every 250ms
- All user commands are processed immediately when characters are available
- System diagnostics are enabled for development and debugging purposes
- The application is designed for embedded systems with limited resources
Production Considerations
Before deploying to production:
- Remove or disable
EnableSystemDiagnostics() call
- Consider adjusting the network timeout based on your environment
- Implement proper error handling for network initialization failures
- Add logging mechanisms for configuration changes if needed
Build Information
The application displays build timestamp information on startup, showing both compilation time and date for version tracking and debugging purposes.