config.c File Reference

Go to the source code of this file.

Functions

size_t ConfigSize (void)
 Calculate total size of configuration data.
int ConfigStation (u_char idx, CONST u_char *url)
 Configure a station list entry.
void ConfigResetFactory (void)
 Reset configuration.
int ConfigLoad (void)
 Load configuration from EEPROM.
void ConfigSaveControl (void)
 Save radio control settings.
void ConfigSave (void)
 Save configuration in EEPROM.

Variables

RADIOSTATIONstation
 List of radio stations.
RADIOCONTROL radio
 Radio status and control.


Function Documentation

size_t ConfigSize ( void   ) 

Calculate total size of configuration data.

Returns:
Number of bytes used by configuration data.

Definition at line 149 of file config.c.

References MAXNUM_STATIONS, RADIOSTATION::rs_ip, RADIOSTATION::rs_port, RADIOSTATION::rs_url, station, and strlen().

int ConfigStation ( u_char  idx,
CONST u_char url 
)

Configure a station list entry.

Parameters:
idx Index of the entry.
url URL of the station.
Returns:
0 on success, -1 otherwise.

Definition at line 178 of file config.c.

References atoi(), free, inet_addr(), malloc, MAXNUM_STATIONS, RADIOSTATION::rs_ip, RADIOSTATION::rs_port, RADIOSTATION::rs_url, station, strcpy(), and strlen().

Referenced by ConfigResetFactory().

void ConfigResetFactory ( void   ) 

Reset configuration.

Examples:
nutpiper/nutpiper.c.

Definition at line 255 of file config.c.

References ConfigStation(), radio, RADIOCONTROL::rc_rstation, and RADIOCONTROL::rc_rvolume.

Referenced by main().

int ConfigLoad ( void   ) 

Load configuration from EEPROM.

If no configuration is available, some preconfigured stations are loaded.

Returns:
0 on success, -1 if no configuration data had been found.
Examples:
nutpiper/nutpiper.c.

Definition at line 343 of file config.c.

References CONFAPP_EE_NAME, CONFAPP_EE_OFFSET, free, malloc, MAXLEN_URL, radio, RADIOCONTROL::rc_rstation, RADIOCONTROL::rc_rvolume, RADIOSTATION::rs_ip, RADIOSTATION::rs_port, RADIOSTATION::rs_url, station, strcmp(), strcpy(), and strlen().

Referenced by main().

void ConfigSaveControl ( void   ) 

Save radio control settings.

Saves currently selected station and volume.

Definition at line 388 of file config.c.

References CONFAPP_EE_NAME, CONFAPP_EE_OFFSET, radio, RADIOCONTROL::rc_cstation, and RADIOCONTROL::rc_cvolume.

void ConfigSave ( void   ) 

Save configuration in EEPROM.

Examples:
nutpiper/nutpiper.c.

Definition at line 400 of file config.c.

References CONFAPP_EE_NAME, CONFAPP_EE_OFFSET, NutNetSaveConfig(), radio, RADIOCONTROL::rc_cstation, RADIOCONTROL::rc_cvolume, RADIOSTATION::rs_ip, RADIOSTATION::rs_port, RADIOSTATION::rs_url, and station.


Variable Documentation

RADIOSTATION* station

List of radio stations.

Examples:
nutpiper/nutpiper.c.

Definition at line 67 of file config.c.

Referenced by ConfigLoad(), ConfigSave(), ConfigSize(), ConfigStation(), DisplayEntry(), DisplayStatus(), and Scanner().

RADIOCONTROL radio

Radio status and control.

Examples:
nutpiper/nutpiper.c.

Definition at line 72 of file config.c.

Referenced by ConfigLoad(), ConfigResetFactory(), ConfigSave(), ConfigSaveControl(), DisplayStatus(), main(), and Scanner().


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/