📄 config.h
字号:
#ifndef _CONFIG_H_
#define _CONFIG_H_
/*
* Copyright (C) 2006-2007 by egnite Software GmbH. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holders nor the names of
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
* SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
* THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* For additional information see http://www.ethernut.de/
*/
/*!
* \file config.h
* \brief Configuration items.
*
* \verbatim
*
* $Log$
*
* \endverbatim
*/
#include <sys/types.h>
#ifndef VERSION
#define VERSION "1.0.2"
#endif
#ifndef MAXNUM_STATIONS
#if defined (AT91SAM9260_EK)
#define MAXNUM_STATIONS 128#else
#define MAXNUM_STATIONS 8#endif
#endif
#ifndef MAX_PLAYERRORS
#define MAX_PLAYERRORS 32
#endif
#ifndef MAX_WAIT_MP3BUF_FILLED
#define MAX_WAIT_MP3BUF_FILLED 10
#endif
#ifndef DAC_OUTPUT_RATE
#if defined (AT91SAM9260_EK)
#define DAC_OUTPUT_RATE 44100
#else
#define DAC_OUTPUT_RATE 8000
#endif
#endif
/*
* Wether we should run a web interface.
*/
#if defined(AT91SAM9260_EK)
#define USE_HTTPSERVER
#endif
/*
* Maximum segment size, choose 536 up to 1460. Note, that segment
* sizes above 536 may result in fragmented packets. Remember, that
* Nut/Net doesn't support TCP fragmentation.
*/
#ifndef MAX_TCPSEG_SIZE
#define MAX_TCPSEG_SIZE 536
#endif
/*
* TCP buffer size.
*/
#ifndef MAX_TCPBUF_SIZE
#if defined(AT91SAM9260_EK)
#define MAX_TCPBUF_SIZE (60 * MAX_TCPSEG_SIZE)
#else
#define MAX_TCPBUF_SIZE (3 * MAX_TCPSEG_SIZE)
#endif
#endif
#ifndef MP3_BUFSIZ
#if defined (AT91SAM9260_EK)
#define MP3_BUFSIZ 1048576#else
#define MP3_BUFSIZ (4 * MAINBUF_SIZE)#endif
#endif
#ifndef MAX_WAITSTREAM
#define MAX_WAITSTREAM 20
#endif
/*
* Socket receive timeout.
*/
#ifndef MAX_TCPRCV_WAIT
#define MAX_TCPRCV_WAIT 5000
#endif
typedef struct {
u_long proxy_ip;
u_short proxy_port;
u_char *proxy_user;
} HTTP_PROXY;
extern HTTP_PROXY proxy;
typedef struct {
/*! \brief Symbolic station name.
*/
char *rs_symbol;
/*! \brief TCP port number.
*
* Zero if this station entry is empty.
*/
u_short rs_port;
/*! \brief Station's IP address.
*/
u_long rs_ip;
/*! \brief Specific URL path.
*
* For server root this is set to NULL.
*/
char *rs_url_path;
} STATIONCONF;
extern STATIONCONF *station;
__BEGIN_DECLS
/* Prototypes */
extern void ConfigResetFactory(void);
extern int ConfigStation(u_char idx, CONST char *symbol, CONST char * url);
__END_DECLS
/* End of prototypes */
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -