config.h File Reference

Go to the source code of this file.

Data Structures

struct  RADIOSTATION
struct  RADIOCONTROL

Defines

#define CONFAPP_EE_OFFSET   512
#define CONFAPP_EE_NAME   "NUTPIPER"
#define MAXLEN_URL   32
#define MAXNUM_STATIONS   128
#define NEXT_STATION   255
#define PREV_STATION   254
#define DIST_NONE   0
#define DIST_WAIT   1
#define DIST_CONNECTING   2
#define DIST_CONNECTED   3
#define DIST_BUFFER   4
#define DIST_TITLE   5
#define DIST_STATION   6
#define DIST_VOLUME   7
#define DIST_DEAD   8
#define DIST_FORCE   9

Functions

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

Variables

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


Define Documentation

#define CONFAPP_EE_OFFSET   512

Log
config.h,v
Revision 1.1 2003/07/21 17:50:48 haraldkipp First check in

Definition at line 44 of file config.h.

Referenced by ConfigLoad(), ConfigSave(), and ConfigSaveControl().

#define CONFAPP_EE_NAME   "NUTPIPER"

Definition at line 45 of file config.h.

Referenced by ConfigLoad(), ConfigSave(), and ConfigSaveControl().

#define MAXLEN_URL   32

Definition at line 47 of file config.h.

Referenced by ConfigLoad().

#define MAXNUM_STATIONS   128

Examples:
nutpiper/nutpiper.c.

Definition at line 48 of file config.h.

Referenced by ConfigSize(), ConfigStation(), and Scanner().

#define NEXT_STATION   255

Examples:
nutpiper/nutpiper.c.

Definition at line 50 of file config.h.

#define PREV_STATION   254

Examples:
nutpiper/nutpiper.c.

Definition at line 51 of file config.h.

#define DIST_NONE   0

Definition at line 67 of file config.h.

Referenced by DisplayInit(), and DisplayStatus().

#define DIST_WAIT   1

Definition at line 68 of file config.h.

#define DIST_CONNECTING   2

Examples:
nutpiper/nutpiper.c.

Definition at line 69 of file config.h.

Referenced by DisplayStatus().

#define DIST_CONNECTED   3

Examples:
nutpiper/nutpiper.c.

Definition at line 70 of file config.h.

Referenced by DisplayStatus().

#define DIST_BUFFER   4

Definition at line 71 of file config.h.

#define DIST_TITLE   5

Definition at line 72 of file config.h.

#define DIST_STATION   6

Definition at line 73 of file config.h.

#define DIST_VOLUME   7

Definition at line 74 of file config.h.

#define DIST_DEAD   8

Examples:
nutpiper/nutpiper.c.

Definition at line 75 of file config.h.

Referenced by DisplayStatus().

#define DIST_FORCE   9

Examples:
nutpiper/nutpiper.c.

Definition at line 76 of file config.h.

Referenced by DisplayStatus().


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 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.

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 ConfigResetFactory ( void   ) 

Reset configuration.

Definition at line 255 of file config.c.

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

Referenced by main().

void ConfigSave ( void   ) 

Save configuration in EEPROM.

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.

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.

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().


Variable Documentation

RADIOSTATION* station

List of radio stations.

Definition at line 67 of file config.c.

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

RADIOCONTROL radio

Radio status and control.

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/