Nut/OS configuration structure. More...
Data Structures | |
struct | _CONFOS |
Operating system configuration structure. More... | |
Defines | |
#define | CONFOS_EE_OFFSET 0 |
Non-volatile memory location. | |
#define | CONFOS_EE_MAGIC "OS" |
#define | MAX_HOSTNAME_LEN 15 |
Maximum number of characters allowed for hostname. | |
#define | CONFOS_VIRGIN_HOSTNAME "ethernut" |
Default hostname. | |
Typedefs | |
typedef struct _CONFOS | CONFOS |
Operating system configuration type. | |
Functions | |
int | NutLoadConfig (void) |
Load Nut/OS configuration from non-volatile memory. | |
int | NutSaveConfig (void) |
Save Nut/OS configuration in non-volatile memory. | |
Variables | |
CONFOS | confos |
Global system configuration structure. | |
CONFOS | confos |
Global system configuration structure. |
Nut/OS configuration structure.
#define CONFOS_EE_OFFSET 0 |
Non-volatile memory location.
Offset into non-volatile memory, where Nut/OS stores the system configuration. The default may be overridden by the Configurator.
Referenced by NutLoadConfig(), and NutSaveConfig().
#define CONFOS_EE_MAGIC "OS" |
Referenced by NutLoadConfig(), and NutSaveConfig().
#define MAX_HOSTNAME_LEN 15 |
Maximum number of characters allowed for hostname.
Intentionally not MAXHOSTNAMELEN to avoid conflicts with existing C libraries.
Referenced by NutSaveConfig().
#define CONFOS_VIRGIN_HOSTNAME "ethernut" |
Default hostname.
Used on virgin systems without any valid configuration.
Referenced by NutLoadConfig().
int NutLoadConfig | ( | void | ) |
Load Nut/OS configuration from non-volatile memory.
This routine is automatically called during system initialization. It tries to read the OS configuration structure CONFOS from non-volatile memory, starting at /ref CONFOS_EE_OFFSET.
The routine may fail, if
References CONFOS_EE_MAGIC, CONFOS_EE_OFFSET, CONFOS_VIRGIN_HOSTNAME, _CONFOS::hostname, _CONFOS::magic, memcmp(), NUTASSERT, NutNvMemLoad(), _CONFOS::size, strcpy(), and strlen().
Referenced by main(), and NutIdle().
int NutSaveConfig | ( | void | ) |
Save Nut/OS configuration in non-volatile memory.
Since Nut/OS version 4.7.5, this routine is no longer called automatically during system initialization. Thus, if NutLoadConfig() fails, then the non-volatile memory remains invalid and NutLoadConfig() will again fail during the next system start.
References CONFOS_EE_MAGIC, CONFOS_EE_OFFSET, _CONFOS::hostname, _CONFOS::magic, MAX_HOSTNAME_LEN, memcpy(), NUTASSERT, NutNvMemSave(), _CONFOS::size, and strlen().
Referenced by NutDiscoveryAppConf().
Global system configuration structure.
Contains the current system configuration. Nut/OS will load this structure from non-volatile memory during initialization.
Referenced by MibRegisterSysVars(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), and syslog_header().
Global system configuration structure.
Contains the current system configuration. Nut/OS will load this structure from non-volatile memory during initialization.
Referenced by MibRegisterSysVars(), NutDiscoveryAnnTele(), NutDiscoveryAppConf(), and syslog_header().