webradio/config.h

Go to the documentation of this file.
00001 #ifndef _CONFIG_H_
00002 #define _CONFIG_H_
00003 
00004 /*
00005  * Copyright (C) 2006-2007 by egnite Software GmbH. All rights reserved.
00006  * Copyright (C) 2008 by egnite GmbH. All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  *
00012  * 1. Redistributions of source code must retain the above copyright
00013  *    notice, this list of conditions and the following disclaimer.
00014  * 2. Redistributions in binary form must reproduce the above copyright
00015  *    notice, this list of conditions and the following disclaimer in the
00016  *    documentation and/or other materials provided with the distribution.
00017  * 3. Neither the name of the copyright holders nor the names of
00018  *    contributors may be used to endorse or promote products derived
00019  *    from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00022  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00023  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00024  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00025  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00026  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00027  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00028  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00029  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00030  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00031  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00032  * SUCH DAMAGE.
00033  *
00034  * For additional information see http://www.ethernut.de/
00035  */
00036 
00048 #include <sys/types.h>
00049 
00050 #ifndef VERSION
00051 #define VERSION "1.2.0"
00052 #endif
00053 
00054 #if defined(AT91SAM9260_EK) || defined(ELEKTOR_IR1)
00055 #ifndef USE_LARGE_RAM
00056 #define USE_LARGE_RAM   1
00057 #endif
00058 #endif
00059 
00060 #ifndef USE_DISPLAY
00061 
00075 #if defined(AT91SAM7X_EK) || defined(AT91SAM9260_EK)
00076 #define USE_DISPLAY     1
00077 #else
00078 #define USE_DISPLAY     0
00079 #endif
00080 #endif
00081 
00082 #ifndef USE_BUTTONS
00083 
00086 #if defined(AT91SAM7X_EK) || defined(AT91SAM9260_EK)
00087 #define USE_BUTTONS     1
00088 #else
00089 #define USE_BUTTONS     0
00090 #endif
00091 #endif
00092 
00093 #ifndef MAX_WAIT_MP3BUF_FILLED
00094 #define MAX_WAIT_MP3BUF_FILLED  10
00095 #endif
00096 
00097 #if defined(AT91SAM7X_EK) || defined(AT91SAM9260_EK)
00098 #define USE_SOFTWARE_CODEC
00099 #endif
00100 
00101 /*
00102  * Wether we should run a web interface.
00103  */
00104 #if defined(AT91SAM9260_EK) || defined(ELEKTOR_IR1) || defined(ETHERNUT3)
00105 #define USE_HTTPSERVER
00106 #ifndef HTTPD_TCP_TIMEOUT
00107 #define HTTPD_TCP_TIMEOUT   500
00108 #endif
00109 #endif
00110 
00111 /* Wether to use dynamically created threads. */
00112 #define USE_DYNAMIC_THREADS
00113 
00114 /*
00115  * Maximum segment size, choose 536 up to 1460. Note, that segment 
00116  * sizes above 536 may result in fragmented packets. Remember, that 
00117  * Nut/Net doesn't support TCP fragmentation.
00118  */
00119 #ifndef MAX_TCPSEG_SIZE
00120 #define MAX_TCPSEG_SIZE 536
00121 #endif
00122 
00123 /*
00124  * TCP buffer size.
00125  */
00126 #ifndef MAX_TCPBUF_SIZE
00127 #if defined(AT91SAM9260_EK) || defined(ELEKTOR_IR1)
00128 #define MAX_TCPBUF_SIZE (60 * MAX_TCPSEG_SIZE)
00129 #else
00130 #define MAX_TCPBUF_SIZE (3 * MAX_TCPSEG_SIZE)
00131 #endif
00132 #endif
00133 
00134 #ifndef MP3_BUFSIZ
00135 #if defined (AT91SAM9260_EK) || defined(ELEKTOR_IR1)
00136 #define MP3_BUFSIZ          1048576
00137 #else
00138 #define MP3_BUFSIZ          (4 * MAINBUF_SIZE)
00139 #endif
00140 #endif
00141 
00142 #ifndef MAX_WAITSTREAM
00143 #define MAX_WAITSTREAM      20
00144 #endif
00145 
00146 /*
00147  * Socket receive timeout.
00148  */
00149 #ifndef MAX_TCPRCV_WAIT
00150 #define MAX_TCPRCV_WAIT     5000
00151 #endif
00152 
00156 typedef struct {
00158     char proxy_host[128];
00164     u_short proxy_port;
00165     //u_long proxy_ip;
00166     //u_char *proxy_user;
00167 } HTTP_PROXY;
00168 
00169 extern HTTP_PROXY proxy;
00170 
00171 __BEGIN_DECLS
00172 /* Prototypes */
00173 
00174 extern int ConfigInit(void);
00175 extern void ConfigResetFactory(void);
00176 extern size_t ConfigSize(void);
00177 extern int ConfigLoad(void);
00178 extern int ConfigSave(void);
00179 
00180 extern void ConfigFlush(void);
00181 extern void ConfigSaveString(char *str);
00182 extern size_t ConfigLoadString(char * str, size_t size);
00183 extern void ConfigSaveBinary(void *data, size_t len);
00184 extern void ConfigLoadBinary(void *data, size_t len);
00185 extern void ConfigRewind(u_long pgn);
00186 
00187 __END_DECLS
00188 /* End of prototypes */
00189 #endif

© 2008 by egnite GmbH - visit www.ethernut.de