|
NetBurner 3.5.6
PDF Version |
This NetBurner application demonstrates the use of the config system for creating and managing persistent configuration variables. The config system provides a way to store both system-defined settings (like network configuration) and user-defined custom variables that persist across power cycles.
config_obj to create structured configuration objectsThe application uses several NetBurner config object types:
config_obj - Base container object for grouping other config objectsconfig_bool - Boolean valuesconfig_int - Integer valuesconfig_double - Double precision floating point valuesconfig_string - String valuesconfig_chooser - Multiple choice selectionsconfig_pass - Password fieldsconfig_IPADDR4 - IPv4 addressesconfig_IPADDR6 - IPv6 addressesconfig_MACADR - MAC addressesThe application defines a hierarchy of config classes:
Base class for temperature-related configuration:
m_maxTemp: Maximum temperature settingm_setTemp: Target temperature settingm_minTemp: Minimum temperature settingExtended thermostat configuration inheriting from TempRange:
m_tempRec1 and m_tempRec2: Temperature recording valuesm_active: Enable/disable flagm_location: Physical location descriptionm_tempScale: Temperature scale selection (Fahrenheit/Celsius/Kelvin)Example classes for slot-based configuration:
cfg_class_slot: Individual slot with enabled flag and namecfg_class_slots: Container for multiple slot configurationsThe application provides an interactive menu system accessible via serial port:
| Command | Description |
|---|---|
C | Show complete config tree |
L | Show and set thermostat location |
M | Show and set thermostat max temperature |
N | Show and set thermostat min temperature |
S | Show and set thermostat set temperature |
T | Show thermostat recorded temperatures |
? | Show command list |
? to see available commandsOn startup, the application displays:
The application requires the following NetBurner libraries:
arp.h - ARP protocol supporthttp.h - HTTP server functionalityinit.h - System initializationnetinterface.h - Network interface managementserial.h - Serial port communicationconfig_server.h - Configuration systemThis example builds upon the BasicConfigVariable example and demonstrates more advanced config system usage with custom classes and inheritance. It serves as a foundation for applications requiring persistent configuration management with structured data organization.