lwip_part1(tcpip报错)

This commit is contained in:
james 2024-08-14 21:22:45 +08:00
parent bb454c3d4b
commit b761b2d3b7
31 changed files with 32166 additions and 0 deletions

View File

@ -21,6 +21,31 @@
| 0x88 | 菜单 |
| 0x28 | 退出 |
### LWIP+HTTPD
[参考文章](https://club.rt-thread.org/ask/article/df1a7724c1e933a5.html)
1. [下载链接](https://github.com/FateMouse/STM32-NETCONN_WEBserver/tree/master)
2. 在`SConscript`通过以下方式将`fsdata.c` 排除构建
``` python
src = [
'fs.c',
'httpd.c',
'httpd_cgi_ssi.c',
'web_server.c',
]
```
3. 补充头文件、函数
``` c
#include <httpd.h>
#ifdef LWIP_HTTPD_SSI
extern void httpd_ssi_init(void);
#endif
#ifdef LWIP_HTTPD_CGI
extern void httpd_cgi_init(void);
#endif
```
4. 图片加载不出来、网页一直在加载
5. ![alt text](image-1.png)![alt text](image.png)
### LCD 显示温湿度
![LCD温湿度](/my_picture/lcdtemp.jpg)

BIN
image-1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

View File

@ -0,0 +1,20 @@
from building import *
import os
cwd = GetCurrentDir()
CPPPATH = [cwd]
src = [
'fs.c',
'httpd.c',
'httpd_cgi_ssi.c',
'web_server.c',
]
group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH)
list = os.listdir(cwd)
for item in list:
if os.path.isfile(os.path.join(cwd, item, 'SConscript')):
group = group + SConscript(os.path.join(item, 'SConscript'))
Return('group')

185
web_server_demo/fs.c Normal file
View File

@ -0,0 +1,185 @@
/**
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
**/
//这个文件属于LWIP协议栈的一部分
#include "lwip/opt.h"
#include "lwip/def.h"
#include "fs.h"
#include "fsdata.h"
#include <string.h>
//设置HTTPD_USE_SUSTUM_FSDATA为1时,使用fsdata_custom.c代替fsdata.c
#ifndef HTTPD_USE_CUSTUM_FSDATA
#define HTTPD_USE_CUSTUM_FSDATA 0 //使用fsdata.c
#endif
#if HTTPD_USE_CUSTUM_FSDATA
#include "fsdata_custom.c"
#else /* HTTPD_USE_CUSTUM_FSDATA */
#include "fsdata.c"
#endif /* HTTPD_USE_CUSTUM_FSDATA */
//定义最多能打开的文件数目
#ifndef LWIP_MAX_OPEN_FILES
#define LWIP_MAX_OPEN_FILES 10
#endif
//定义文件系统内存分配结构体
struct fs_table {
struct fs_file file; //
u8_t inuse; //0表示未使用,1表示使用
};
//定义一个fs_tabble数组,其中包括LWIP_MAX_OPEN_FILES个元素
struct fs_table fs_memory[LWIP_MAX_OPEN_FILES];
#if LWIP_HTTPD_CUSTOM_FILES
int fs_open_custom(struct fs_file *file, const char *name);
void fs_close_custom(struct fs_file *file);
#endif /* LWIP_HTTPD_CUSTOM_FILES */
//文件内存申请函数 给LWIP_MAX_OPEN_FILES个文件同时分配内存
static struct fs_file *
fs_malloc(void)
{
int i;
for(i = 0; i < LWIP_MAX_OPEN_FILES; i++) {
if(fs_memory[i].inuse == 0) {
fs_memory[i].inuse = 1;
return(&fs_memory[i].file);
}
}
return(NULL);
}
//释放内存,一次释放掉LWIP_MAX_OPEN_FILES个变量的内存
static void
fs_free(struct fs_file *file)
{
int i;
for(i = 0; i < LWIP_MAX_OPEN_FILES; i++) {
if(&fs_memory[i].file == file) {
fs_memory[i].inuse = 0;
break;
}
}
return;
}
//打开一个文件
//name:要打开的文件名
struct fs_file *
fs_open(const char *name)
{
struct fs_file *file;
const struct fsdata_file *f;
file = fs_malloc(); //申请内存
if(file == NULL) {
return NULL;
}
#if LWIP_HTTPD_CUSTOM_FILES
if(fs_open_custom(file, name)) {
file->is_custom_file = 1;
return file;
}
file->is_custom_file = 0;
#endif /* LWIP_HTTPD_CUSTOM_FILES */
for(f = FS_ROOT; f != NULL; f = f->next) {
if (!strcmp(name, (char *)f->name)) { //根据函数的name参数查找
file->data = (const char *)f->data;
file->len = f->len;
file->index = f->len;
file->pextension = NULL;
file->http_header_included = f->http_header_included;
#if HTTPD_PRECALCULATED_CHECKSUM //如果使用HTTPD_PRECALCULATED的话
file->chksum_count = f->chksum_count;
file->chksum = f->chksum;
#endif /* HTTPD_PRECALCULATED_CHECKSUM */
#if LWIP_HTTPD_FILE_STATE //如果使用LEIP_HTTPD_FILE_STATE
file->state = fs_state_init(file, name);
#endif /* #if LWIP_HTTPD_FILE_STATE */
return file;
}
}
fs_free(file); //释放file内存
return NULL;
}
//关闭文件
//参数:要关闭的文件
void
fs_close(struct fs_file *file)
{
#if LWIP_HTTPD_CUSTOM_FILES
if (file->is_custom_file) {
fs_close_custom(file);
}
#endif /* LWIP_HTTPD_CUSTOM_FILES */
#if LWIP_HTTPD_FILE_STATE
fs_state_free(file, file->state);
#endif /* #if LWIP_HTTPD_FILE_STATE */
fs_free(file); //释放file的内存
}
//读取文件
//参数:file 要读取的文件
//参数:buffer 读取到后存放的缓冲区
//参数:count 要读取的个数
int
fs_read(struct fs_file *file, char *buffer, int count)
{
int read; //实际读取的数据个数
if(file->index == file->len) {
return -1;
}
read = file->len - file->index;
if(read > count) {
read = count;
}
MEMCPY(buffer, (file->data + file->index), read);
file->index += read;
return(read); //返回读取的数据个数
}
//文件左对齐
int fs_bytes_left(struct fs_file *file)
{
return file->len - file->index;
}

101
web_server_demo/fs.h Normal file
View File

@ -0,0 +1,101 @@
/**
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
**/
#ifndef __FS_H__
#define __FS_H__
#include "lwip/opt.h"
/** Set this to 1 and provide the functions:
* - "int fs_open_custom(struct fs_file *file, const char *name)"
* Called first for every opened file to allow opening files
* that are not included in fsdata(_custom).c
* - "void fs_close_custom(struct fs_file *file)"
* Called to free resources allocated by fs_open_custom().
*/
#ifndef LWIP_HTTPD_CUSTOM_FILES
#define LWIP_HTTPD_CUSTOM_FILES 0
#endif
/** Set this to 1 to include an application state argument per file
* that is opened. This allows to keep a state per connection/file.
*/
#ifndef LWIP_HTTPD_FILE_STATE
#define LWIP_HTTPD_FILE_STATE 0
#endif
/** HTTPD_PRECALCULATED_CHECKSUM==1: include precompiled checksums for
* predefined (MSS-sized) chunks of the files to prevent having to calculate
* the checksums at runtime. */
#ifndef HTTPD_PRECALCULATED_CHECKSUM
#define HTTPD_PRECALCULATED_CHECKSUM 0
#endif
#if HTTPD_PRECALCULATED_CHECKSUM
struct fsdata_chksum {
u32_t offset;
u16_t chksum;
u16_t len;
};
#endif /* HTTPD_PRECALCULATED_CHECKSUM */
//fs_file½á¹¹Ìå
struct fs_file {
const char *data; //Êý¾Ý
int len; //³¤¶È
int index; //Ë÷ÒýºÅ
void *pextension;
#if HTTPD_PRECALCULATED_CHECKSUM
const struct fsdata_chksum *chksum;
u16_t chksum_count;
#endif /* HTTPD_PRECALCULATED_CHECKSUM */
u8_t http_header_included;
#if LWIP_HTTPD_CUSTOM_FILES
u8_t is_custom_file;
#endif /* LWIP_HTTPD_CUSTOM_FILES */
#if LWIP_HTTPD_FILE_STATE
void *state;
#endif /* LWIP_HTTPD_FILE_STATE */
};
struct fs_file *fs_open(const char *name);
void fs_close(struct fs_file *file);
int fs_read(struct fs_file *file, char *buffer, int count);
int fs_bytes_left(struct fs_file *file);
#if LWIP_HTTPD_FILE_STATE
/** This user-defined function is called when a file is opened. */
void *fs_state_init(struct fs_file *file, const char *name);
/** This user-defined function is called when a file is closed. */
void fs_state_free(struct fs_file *file, void *state);
#endif /* #if LWIP_HTTPD_FILE_STATE */
#endif /* __FS_H__ */

14215
web_server_demo/fsdata.c Normal file

File diff suppressed because it is too large Load Diff

51
web_server_demo/fsdata.h Normal file
View File

@ -0,0 +1,51 @@
/**
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
**/
#ifndef __FSDATA_H__
#define __FSDATA_H__
#include "lwip/opt.h"
#include "fs.h"
//fsdata_file结构体
struct fsdata_file {
const struct fsdata_file *next; //指向一个fsdata_file文件
const unsigned char *name; //名字
const unsigned char *data; //数据
int len; //长度
u8_t http_header_included;
#if HTTPD_PRECALCULATED_CHECKSUM
u16_t chksum_count;
const struct fsdata_chksum *chksum;
#endif /* HTTPD_PRECALCULATED_CHECKSUM */
};
#endif /* __FSDATA_H__ */

2227
web_server_demo/httpd.c Normal file

File diff suppressed because it is too large Load Diff

254
web_server_demo/httpd.h Normal file
View File

@ -0,0 +1,254 @@
/*
* Copyright (c) 2001-2003 Swedish Institute of Computer Science.
* 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. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 THE AUTHOR 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.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
* This version of the file has been modified by Texas Instruments to offer
* simple server-side-include (SSI) and Common Gateway Interface (CGI)
* capability.
*/
#ifndef __HTTPD_H__
#define __HTTPD_H__
#include "lwip/opt.h"
#include "lwip/err.h"
#include "lwip/pbuf.h"
/** 设置为1支持CGISet this to 1 to support CGI */
#ifndef LWIP_HTTPD_CGI
#define LWIP_HTTPD_CGI 1
#endif
/** 设置为1支持SSI Set this to 1 to support SSI (Server-Side-Includes) */
#ifndef LWIP_HTTPD_SSI
#define LWIP_HTTPD_SSI 1
#endif
/** 设置为1支持POST Set this to 1 to support HTTP POST */
#ifndef LWIP_HTTPD_SUPPORT_POST
#define LWIP_HTTPD_SUPPORT_POST 0
#endif
#if LWIP_HTTPD_CGI //如果使用CGI
/*
* Function pointer for a CGI script handler.
*
* This function is called each time the HTTPD server is asked for a file
* whose name was previously registered as a CGI function using a call to
* http_set_cgi_handler. The iIndex parameter provides the index of the
* CGI within the ppcURLs array passed to http_set_cgi_handler. Parameters
* pcParam and pcValue provide access to the parameters provided along with
* the URI. iNumParams provides a count of the entries in the pcParam and
* pcValue arrays. Each entry in the pcParam array contains the name of a
* parameter with the corresponding entry in the pcValue array containing the
* value for that parameter. Note that pcParam may contain multiple elements
* with the same name if, for example, a multi-selection list control is used
* in the form generating the data.
*
* The function should return a pointer to a character string which is the
* path and filename of the response that is to be sent to the connected
* browser, for example "/thanks.htm" or "/response/error.ssi".
*
* The maximum number of parameters that will be passed to this function via
* iNumParams is defined by LWIP_HTTPD_MAX_CGI_PARAMETERS. Any parameters in the incoming
* HTTP request above this number will be discarded.
*
* Requests intended for use by this CGI mechanism must be sent using the GET
* method (which encodes all parameters within the URI rather than in a block
* later in the request). Attempts to use the POST method will result in the
* request being ignored.
*
*/
//pcParam中包含了每一个URI参数的名称,而pcValue存放相对应的参数的值.函数返回
//一个字符串,字符串包含应该响应给浏览器的文件路径和名称.URL中所能发送的最大参数个数
//被定义为LWIP_HTTPD_MAX_CGI_PARAMETERS,任何大于这个值的请求都会被丢弃.只有GET方式才能
//使用这种方法
//参数iIndex:传递给http_set_cgi_handler的pccURLs内的索引号
//参数iNumparams:表示URL中你请求参数和其参数对应值的个数,就是pcParam和pcValue的元素个数
//参数pcParam和pcValue:URI中提供的参数
typedef const char *(*tCGIHandler)(int iIndex, int iNumParams, char *pcParam[],
char *pcValue[]);
/*
* Structure defining the base filename (URL) of a CGI and the associated
* function which is to be called when that URL is requested.
*/
//结构体定义了一个CGI的基础文件名(URL),并且关联了如果URL被请求的功能
typedef struct
{
const char *pcCGIName; //浏览器请求的URL
tCGIHandler pfnCGIHandler; //定义一个tcGIHandler指针
} tCGI;
void http_set_cgi_handlers(const tCGI *pCGIs, int iNumHandlers);
/*CGI的handler可以发送的最大参数数量 The maximum number of parameters that the CGI handler can be sent. */
#ifndef LWIP_HTTPD_MAX_CGI_PARAMETERS
#define LWIP_HTTPD_MAX_CGI_PARAMETERS 16
#endif
#endif /* LWIP_HTTPD_CGI */
#if LWIP_HTTPD_SSI //如果使用SSI的话
/** LWIP_HTTPD_SSI_MULTIPART==1: SSI handler function is called with 2 more
* arguments indicating a counter for insert string that are too long to be
* inserted at once: the SSI handler function must then set 'next_tag_part'
* which will be passed back to it in the next call. */
//
#ifndef LWIP_HTTPD_SSI_MULTIPART
#define LWIP_HTTPD_SSI_MULTIPART 0
#endif
/*
* Function pointer for the SSI tag handler callback.
*
* This function will be called each time the HTTPD server detects a tag of the
* form <!--#name--> in a .shtml, .ssi or .shtm file where "name" appears as
* one of the tags supplied to http_set_ssi_handler in the ppcTags array. The
* returned insert string, which will be appended after the the string
* "<!--#name-->" in file sent back to the client,should be written to pointer
* pcInsert. iInsertLen contains the size of the buffer pointed to by
* pcInsert. The iIndex parameter provides the zero-based index of the tag as
* found in the ppcTags array and identifies the tag that is to be processed.
*
* The handler returns the number of characters written to pcInsert excluding
* any terminating NULL or a negative number to indicate a failure (tag not
* recognized, for example).
*
* Note that the behavior of this SSI mechanism is somewhat different from the
* "normal" SSI processing as found in, for example, the Apache web server. In
* this case, the inserted text is appended following the SSI tag rather than
* replacing the tag entirely. This allows for an implementation that does not
* require significant additional buffering of output data yet which will still
* offer usable SSI functionality. One downside to this approach is when
* attempting to use SSI within JavaScript. The SSI tag is structured to
* resemble an HTML comment but this syntax does not constitute a comment
* within JavaScript and, hence, leaving the tag in place will result in
* problems in these cases. To work around this, any SSI tag which needs to
* output JavaScript code must do so in an encapsulated way, sending the whole
* HTML <script>...</script> section as a single include.
*/
//每当HTTPD服务器在.shtml文件中检测到<!==#name-->形式的tag就调用一次这个函数,
//"name"为ppcTags数组中其中的某一个tags时,调用http_set_ssi_handler.
//将要附加到服务器返回给客户端文件中要添加的字符串复制给pcInsert
//参数iIndex:提供了在ppcTags数组中查找并且找出要被处理的tag的zero-based索引号,
//参数pcInsert:要附加到返回给客户端的网页中的字符串
//参数iInsertLen: pcInsert的大小
//函数返回被写入到pcInsert中的元素个数,包含任何NULL或者其他表明数据错误的值的个数
typedef u16_t (*tSSIHandler)(int iIndex, char *pcInsert, int iInsertLen
#if LWIP_HTTPD_SSI_MULTIPART
, u16_t current_tag_part, u16_t *next_tag_part
#endif /* LWIP_HTTPD_SSI_MULTIPART */
#if LWIP_HTTPD_FILE_STATE
, void *connection_state
#endif /* LWIP_HTTPD_FILE_STATE */
);
void http_set_ssi_handler(tSSIHandler pfnSSIHandler,
const char **ppcTags, int iNumTags);
/* The maximum length of the string comprising the tag name */
#ifndef LWIP_HTTPD_MAX_TAG_NAME_LEN
#define LWIP_HTTPD_MAX_TAG_NAME_LEN 1
#endif
/* The maximum length of string that can be returned to replace any given tag */
#ifndef LWIP_HTTPD_MAX_TAG_INSERT_LEN
#define LWIP_HTTPD_MAX_TAG_INSERT_LEN 192
#endif
#endif /* LWIP_HTTPD_SSI */
#if LWIP_HTTPD_SUPPORT_POST
/* These functions must be implemented by the application */
/** Called when a POST request has been received. The application can decide
* whether to accept it or not.
*
* @param connection Unique connection identifier, valid until httpd_post_end
* is called.
* @param uri The HTTP header URI receiving the POST request.
* @param http_request The raw HTTP request (the first packet, normally).
* @param http_request_len Size of 'http_request'.
* @param content_len Content-Length from HTTP header.
* @param response_uri Filename of response file, to be filled when denying the
* request
* @param response_uri_len Size of the 'response_uri' buffer.
* @param post_auto_wnd Set this to 0 to let the callback code handle window
* updates by calling 'httpd_post_data_recved' (to throttle rx speed)
* default is 1 (httpd handles window updates automatically)
* @return ERR_OK: Accept the POST request, data may be passed in
* another err_t: Deny the POST request, send back 'bad request'.
*/
err_t httpd_post_begin(void *connection, const char *uri, const char *http_request,
u16_t http_request_len, int content_len, char *response_uri,
u16_t response_uri_len, u8_t *post_auto_wnd);
/** Called for each pbuf of data that has been received for a POST.
* ATTENTION: The application is responsible for freeing the pbufs passed in!
*
* @param connection Unique connection identifier.
* @param p Received data.
* @return ERR_OK: Data accepted.
* another err_t: Data denied, http_post_get_response_uri will be called.
*/
err_t httpd_post_receive_data(void *connection, struct pbuf *p);
/** Called when all data is received or when the connection is closed.
* The application must return the filename/URI of a file to send in response
* to this POST request. If the response_uri buffer is untouched, a 404
* response is returned.
*
* @param connection Unique connection identifier.
* @param response_uri Filename of response file, to be filled when denying the request
* @param response_uri_len Size of the 'response_uri' buffer.
*/
void httpd_post_finished(void *connection, char *response_uri, u16_t response_uri_len);
#ifndef LWIP_HTTPD_POST_MANUAL_WND
#define LWIP_HTTPD_POST_MANUAL_WND 0
#endif
#if LWIP_HTTPD_POST_MANUAL_WND
void httpd_post_data_recved(void *connection, u16_t recved_len);
#endif /* LWIP_HTTPD_POST_MANUAL_WND */
#endif /* LWIP_HTTPD_SUPPORT_POST */
void httpd_init(void);
#endif /* __HTTPD_H__ */

View File

@ -0,0 +1,224 @@
#include "lwip/debug.h"
#include "httpd.h"
#include "lwip/tcp.h"
#include "fs.h"
// #include "lwip_comm.h"
// #include "led.h"
// #include "tsensor.h"
// #include "rtc.h"
// #include "lcd.h"
#include <string.h>
#include <stdlib.h>
//////////////////////////////////////////////////////////////////////////////////
//本程序只供学习使用,未经作者许可,不得用于其它任何用途
//ENC28J60 模块
//lwip通用驱动 代码
//正点原子@ALIENTEK
//技术论坛:www.openedv.com
//创建日期:2015/4/30
//版本V1.0
//版权所有,盗版必究。
//Copyright(C) 广州市星翼电子科技有限公司 2009-2019
//All rights reserved
//*******************************************************************************
//修改信息
//无
//////////////////////////////////////////////////////////////////////////////////
#define NUM_CONFIG_CGI_URIS 2 //CGI的URI数量
#define NUM_CONFIG_SSI_TAGS 4 //SSI的TAG数量
//控制LED和BEEP的CGI handler
const char* LEDS_CGI_Handler(int iIndex, int iNumParams, char *pcParam[], char *pcValue[]);
static const char *ppcTAGs[]= //SSI的Tag
{
"t", //ADC值
"w", //温度值
"h", //时间
"y" //日期
};
static const tCGI ppcURLs[]= //cgi程序
{
{"/leds.cgi",LEDS_CGI_Handler},
};
//当web客户端请求浏览器的时候,使用此函数被CGI handler调用
static int FindCGIParameter(const char *pcToFind,char *pcParam[],int iNumParams)
{
int iLoop;
for(iLoop = 0;iLoop < iNumParams;iLoop ++ )
{
if(strcmp(pcToFind,pcParam[iLoop]) == 0)
{
return (iLoop); //返回iLOOP
}
}
return (-1);
}
//SSIHandler中需要用到的处理ADC的函数
void ADC_Handler(char *pcInsert)
{
// char Digit1=0, Digit2=0, Digit3=0, Digit4=0;
// uint32_t ADCVal = 0;
// //获取ADC的值
// ADCVal = T_Get_Adc_Average(1,10); //获取ADC1_CH1的电压值
// //转换为电压 ADCVval * 0.8mv
// ADCVal = (uint32_t)(ADCVal * 0.8);
// Digit1= ADCVal/1000;
// Digit2= (ADCVal-(Digit1*1000))/100 ;
// Digit3= (ADCVal-((Digit1*1000)+(Digit2*100)))/10;
// Digit4= ADCVal -((Digit1*1000)+(Digit2*100)+ (Digit3*10));
// //准备添加到html中的数据
// *pcInsert = (char)(Digit1+0x30);
// *(pcInsert + 1) = (char)(Digit2+0x30);
// *(pcInsert + 2) = (char)(Digit3+0x30);
// *(pcInsert + 3) = (char)(Digit4+0x30);
}
//SSIHandler中需要用到的处理内部温度传感器的函数
void Temperate_Handler(char *pcInsert)
{
// char Digit1=0, Digit2=0, Digit3=0, Digit4=0,Digit5=0;
// short Temperate = 0;
// //获取内部温度值
// Temperate = Get_Temprate();//扩大100倍
// Digit1 = Temperate / 10000;
// Digit2 = (((short)Temperate) % 10000)/1000;
// Digit3 = (((short)Temperate) % 1000)/100 ;
// Digit4 = (((short)Temperate) % 100)/10;
// Digit5 = ((short)Temperate) % 10;
// //添加到html中的数据
// *pcInsert = (char)(Digit1+0x30);
// *(pcInsert+1) = (char)(Digit2+0x30);
// *(pcInsert+2) = (char)(Digit3+0x30);
// *(pcInsert+3) = '.';
// *(pcInsert+4) = (char)(Digit4+0x30);
// *(pcInsert+5) = (char)(Digit5+0x30);
}
//SSIHandler中需要用到的处理RTC时间的函数
void RTCTime_Handler(char *pcInsert)
{
// u8 hour,min,sec;
// hour = calendar.hour;
// min = calendar.min;
// sec = calendar.sec;
// *pcInsert = (char)((hour/10) + 0x30);
// *(pcInsert+1) = (char)((hour%10) + 0x30);
// *(pcInsert+2) = ':';
// *(pcInsert+3) = (char)((min/10) + 0x30);
// *(pcInsert+4) = (char)((min%10) + 0x30);
// *(pcInsert+5) = ':';
// *(pcInsert+6) = (char)((sec/10) + 0x30);
// *(pcInsert+7) = (char)((sec%10) + 0x30);
}
//SSIHandler中需要用到的处理RTC日期的函数
void RTCdate_Handler(char *pcInsert)
{
// u16 year,month,date,week;
// year = calendar.w_year;
// month = calendar.w_month;
// date = calendar.w_date;
// week = calendar.week;
// *pcInsert = '2';
// *(pcInsert+1) = '0';
// *(pcInsert+2) = (char)(((year%100)/10) + 0x30);
// *(pcInsert+3) = (char)((year%10) + 0x30);
// *(pcInsert+4) = '-';
// *(pcInsert+5) = (char)((month/10) + 0x30);
// *(pcInsert+6) = (char)((month%10) + 0x30);
// *(pcInsert+7) = '-';
// *(pcInsert+8) = (char)((date/10) + 0x30);
// *(pcInsert+9) = (char)((date%10) + 0x30);
// *(pcInsert+10) = ' ';
// *(pcInsert+11) = 'w';
// *(pcInsert+12) = 'e';
// *(pcInsert+13) = 'e';
// *(pcInsert+14) = 'k';
// *(pcInsert+15) = ':';
// *(pcInsert+16) = (char)(week + 0x30);
}
//SSI的Handler句柄
static u16_t SSIHandler(int iIndex,char *pcInsert,int iInsertLen)
{
switch(iIndex)
{
case 0:
ADC_Handler(pcInsert);
break;
case 1:
Temperate_Handler(pcInsert);
break;
case 2:
RTCTime_Handler(pcInsert);
break;
case 3:
RTCdate_Handler(pcInsert);
break;
}
return strlen(pcInsert);
}
//CGI LED控制句柄
const char* LEDS_CGI_Handler(int iIndex, int iNumParams, char *pcParam[], char *pcValue[])
{
// u8 i=0; //注意根据自己的GET的参数的多少来选择i值范围
// iIndex = FindCGIParameter("LED1",pcParam,iNumParams); //找到led的索引号
// //只有一个CGI句柄 iIndex=0
// if (iIndex != -1)
// {
// LED1=1; //关闭LED1灯
// for (i=0; i<iNumParams; i++) //检查CGI参数
// {
// if (strcmp(pcParam[i] , "LED1")==0) //检查参数"led" 属于控制LED1灯的
// {
// if(strcmp(pcValue[i], "LED1ON") ==0) //改变LED1状态
// LED1=0; //打开LED1
// else if(strcmp(pcValue[i],"LED1OFF") == 0)
// LED1=1; //关闭LED1
// }
// }
// }
// if(LED1==0) return "/STM32_LED_ON_BEEP_OFF.shtml"; //LED1开
// else
return "/STM32_LED_OFF_BEEP_OFF.shtml";
}
//SSI句柄初始化
void httpd_ssi_init(void)
{
//配置SSI句柄
http_set_ssi_handler(SSIHandler,ppcTAGs,NUM_CONFIG_SSI_TAGS);
}
//CGI句柄初始化
void httpd_cgi_init(void)
{
//配置CGI句柄
http_set_cgi_handlers(ppcURLs, NUM_CONFIG_CGI_URIS);
}

View File

@ -0,0 +1,119 @@
#ifndef __HTTPD_STRUCTS_H__
#define __HTTPD_STRUCTS_H__
#include "httpd.h"
/** This string is passed in the HTTP header as "Server: " */
//这个字符串被传递给HTTP头文件作为"Server"
#ifndef HTTPD_SERVER_AGENT
#define HTTPD_SERVER_AGENT "lwIP/1.3.1 (http://savannah.nongnu.org/projects/lwip)"
#endif
/** Set this to 1 if you want to include code that creates HTTP headers
* at runtime. Default is off: HTTP headers are then created statically
* by the makefsdata tool. Static headers mean smaller code size, but
* the (readonly) fsdata will grow a bit as every file includes the HTTP
* header. */
//设置LWIP_HTTPD_DYNAMIC_HEDERS为1:想要包含在运行期间创建的http头文件
//默认情况下是关闭的,http头文件是由makefsdata工具创建的,静态的头文件意味着更小的代码
//但是fsdata会在包括http头文件在内的文件扩展一个bit
#ifndef LWIP_HTTPD_DYNAMIC_HEADERS
#define LWIP_HTTPD_DYNAMIC_HEADERS 0
#endif
#if LWIP_HTTPD_DYNAMIC_HEADERS
/** This struct is used for a list of HTTP header strings for various
* filename extensions. */
typedef struct
{
const char *extension;
int headerIndex;
} tHTTPHeader;
/** A list of strings used in HTTP headers */
static const char *g_psHTTPHeaderStrings[] =
{
"Content-type: text/html\r\n\r\n",
"Content-type: text/html\r\nExpires: Fri, 10 Apr 2008 14:00:00 GMT\r\nPragma: no-cache\r\n\r\n",
"Content-type: image/gif\r\n\r\n",
"Content-type: image/png\r\n\r\n",
"Content-type: image/jpeg\r\n\r\n",
"Content-type: image/bmp\r\n\r\n",
"Content-type: image/x-icon\r\n\r\n",
"Content-type: application/octet-stream\r\n\r\n",
"Content-type: application/x-javascript\r\n\r\n",
"Content-type: application/x-javascript\r\n\r\n",
"Content-type: text/css\r\n\r\n",
"Content-type: application/x-shockwave-flash\r\n\r\n",
"Content-type: text/xml\r\n\r\n",
"Content-type: text/plain\r\n\r\n",
"HTTP/1.0 200 OK\r\n",
"HTTP/1.0 404 File not found\r\n",
"HTTP/1.0 400 Bad Request\r\n",
"HTTP/1.0 501 Not Implemented\r\n",
"HTTP/1.1 200 OK\r\n",
"HTTP/1.1 404 File not found\r\n",
"HTTP/1.1 400 Bad Request\r\n",
"HTTP/1.1 501 Not Implemented\r\n",
"Content-Length: ",
"Connection: Close\r\n",
"Server: "HTTPD_SERVER_AGENT"\r\n",
"\r\n<html><body><h2>404: The requested file cannot be found.</h2></body></html>\r\n"
};
/* Indexes into the g_psHTTPHeaderStrings array */
#define HTTP_HDR_HTML 0 /* text/html */
#define HTTP_HDR_SSI 1 /* text/html Expires... */
#define HTTP_HDR_GIF 2 /* image/gif */
#define HTTP_HDR_PNG 3 /* image/png */
#define HTTP_HDR_JPG 4 /* image/jpeg */
#define HTTP_HDR_BMP 5 /* image/bmp */
#define HTTP_HDR_ICO 6 /* image/x-icon */
#define HTTP_HDR_APP 7 /* application/octet-stream */
#define HTTP_HDR_JS 8 /* application/x-javascript */
#define HTTP_HDR_RA 9 /* application/x-javascript */
#define HTTP_HDR_CSS 10 /* text/css */
#define HTTP_HDR_SWF 11 /* application/x-shockwave-flash */
#define HTTP_HDR_XML 12 /* text/xml */
#define HTTP_HDR_DEFAULT_TYPE 13 /* text/plain */
#define HTTP_HDR_OK 14 /* 200 OK */
#define HTTP_HDR_NOT_FOUND 15 /* 404 File not found */
#define HTTP_HDR_BAD_REQUEST 16 /* 400 Bad request */
#define HTTP_HDR_NOT_IMPL 17 /* 501 Not Implemented */
#define HTTP_HDR_OK_11 18 /* 200 OK */
#define HTTP_HDR_NOT_FOUND_11 19 /* 404 File not found */
#define HTTP_HDR_BAD_REQUEST_11 20 /* 400 Bad request */
#define HTTP_HDR_NOT_IMPL_11 21 /* 501 Not Implemented */
#define HTTP_HDR_CONTENT_LENGTH 22 /* Content-Length: (HTTP 1.1)*/
#define HTTP_HDR_CONN_CLOSE 23 /* Connection: Close (HTTP 1.1) */
#define HTTP_HDR_SERVER 24 /* Server: HTTPD_SERVER_AGENT */
#define DEFAULT_404_HTML 25 /* default 404 body */
/** A list of extension-to-HTTP header strings */
static tHTTPHeader g_psHTTPHeaders[] =
{
{ "html", HTTP_HDR_HTML},
{ "htm", HTTP_HDR_HTML},
{ "shtml",HTTP_HDR_SSI},
{ "shtm", HTTP_HDR_SSI},
{ "ssi", HTTP_HDR_SSI},
{ "gif", HTTP_HDR_GIF},
{ "png", HTTP_HDR_PNG},
{ "jpg", HTTP_HDR_JPG},
{ "bmp", HTTP_HDR_BMP},
{ "ico", HTTP_HDR_ICO},
{ "class",HTTP_HDR_APP},
{ "cls", HTTP_HDR_APP},
{ "js", HTTP_HDR_JS},
{ "ram", HTTP_HDR_RA},
{ "css", HTTP_HDR_CSS},
{ "swf", HTTP_HDR_SWF},
{ "xml", HTTP_HDR_XML}
};
#define NUM_HTTP_HEADERS (sizeof(g_psHTTPHeaders) / sizeof(tHTTPHeader))
#endif /* LWIP_HTTPD_DYNAMIC_HEADERS */
#endif /* __HTTPD_STRUCTS_H__ */

View File

@ -0,0 +1,5 @@
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\folder\shell\cmd]
@="在此位置打开CMD"
[HKEY_CLASSES_ROOT\folder\shell\cmd\command]
@="cmd.exe /k cd %1"

View File

@ -0,0 +1,74 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0049)http://192.168.1.112/STM32_ADC_TEMPERATE.shtml -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
<meta http-equiv="refresh" content="1">
<title>ALIENTEK STM32F103开发板LWIP实例</title>
<style type="text/css">
.ul1{margin:0;padding:0; list-style:none;}
.li1{margin:0;padding:0; list-style:none;}
.menu{width:1000px;height:48px;margin:0 auto; background:url(image/tab.jpg) repeat-x; }
.menu ul{width:1000px;float:left;height:48px;display:inline;}
.menu ul li{width:200px;height:48px; line-height:48px; text-align:center; float:left;display:inline; }
.menu ul li a{width:200px;height:48px; float:left;text-decoration:none; color:#fff; font-size:18px;font-weight:bold;}
.menu ul li a:hover{ background:#FF0000 repeat-x; }
.logo{}
.bodystyle{ margin:0 auto; width:1000px; background:#d5d5d7;}
</style>
</head>
<body class="bodystyle">
<div style="background-color:#FFFFFF;">
<div class="logo">
<img src="/image/head.jpg" alt="广州市星翼电子科技有限公司" title="广州市星翼电子科技有限公司" style="margin:20px 0px 0px 0px;">
</div>
<div class="menu">
<ul class="ul1">
<li class="li1"><a href="/index.html">主页</a></li>
<li class="li1"><a href="/STM32_LED_OFF_BEEP_OFF.shtml">LED/BEEP控制</a></li>
<li class="li1"><a href="/STM32_ADC_TEMPERATE.shtml">ADC/内部温度传感器</a></li>
<li class="li1"><a href="/STM32_RTC.shtml">RTC实时时钟</a></li>
<li class="li1"><a href="http://eboard.taobao.com/" target="_blank">联系我们</a></li>
</ul>
</div>
<div style="margin-top:30px;">
此页面用来显示开发板上的ADC电压值和内部温度传感器值。
</div>
<div style="background-color:#0066CC;color:#fff;margin-top:30px; ">
<h3>
<span>RTC实时时钟显示</span>
</h3>
</div>
<div align="center">
<table border="1" cellpadding="10">
<tbody><tr>
<td width="200">ADC1_CH1电压值</td>
<td width="200"><!--#t-->mv</td>
</tr>
</tbody></table>
<br><br>
<table border="1" cellpadding="10">
<tbody><tr>
<td width="200">内部温度传感器值</td>
<td width="200"><!--#w-->°C</td>
</tr>
</tbody></table>
<br><br>
</div>
</div>
<div align="center" style="margin-top:20px;margin-bottom:30px;">
&#169; 开源电子网(OpenEdv.com) | <a href="http://www.alientek.com/" target="_blank">关于我们</a> | <a target="_blank" href="http://www.alientek.com/">官方网站</a> | <a href="http://weibo.com/u/2973019374" target="_blank">@新浪微博</a> |<a href="http://shop62057469.taobao.com/" target="_blank">官方淘宝店</a> |<a href="http://www.miitbeian.gov.cn/" target="_blank" style="color:#737573;text-decoration:none;">粤ICP备12000418号-1</a> <br>
</div>
</body></html>

View File

@ -0,0 +1,79 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0052)http://192.168.1.112/STM32_LED_OFF_BEEP_OFF.shtml -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>ALIENTEK STM32F103开发板LWIP实例</title>
<style type="text/css">
.ul1{margin:0;padding:0; list-style:none;}
.li1{margin:0;padding:0; list-style:none;}
.menu{width:1000px;height:48px;margin:0 auto; background:url(image/tab.jpg) repeat-x; }
.menu ul{width:1000px;float:left;height:48px;display:inline;}
.menu ul li{width:200px;height:48px; line-height:48px; text-align:center; float:left;display:inline; }
.menu ul li a{width:200px;height:48px; float:left;text-decoration:none; color:#fff; font-size:18px;font-weight:bold;}
.menu ul li a:hover{ background:#FF0000 repeat-x; }
.logo{}
.bodystyle{ margin:0 auto; width:1000px; background:#d5d5d7;}
</style>
</head>
<body class="bodystyle">
<div style="background-color:#FFFFFF;">
<div class="logo">
<img src="/image/head.jpg" alt="广州市星翼电子科技有限公司" title="广州市星翼电子科技有限公司" style="margin:20px 0px 0px 0px;">
</div>
<div class="menu">
<ul class="ul1">
<li class="li1"><a href="/index.html">主页</a></li>
<li class="li1"><a href="/STM32_LED_OFF_BEEP_OFF.shtml">LED/BEEP控制</a></li>
<li class="li1"><a href="/STM32_ADC_TEMPERATE.shtml">ADC/内部温度传感器</a></li>
<li class="li1"><a href="/STM32_RTC.shtml">RTC实时时钟</a></li>
<li class="li1"><a href="http://eboard.taobao.com/" target="_blank">联系我们</a></li>
</ul>
</div>
<div style="margin-top:30px;">
此页面用来控制开发板上的LED和蜂鸣器,选择LED1或BEEP的状态然后点击发送按钮。查看开发板上的对应的LED灯是或蜂鸣器否变化。
</div>
<div style="width:1000px; background-color:#0066CC;color:#fff;margin-top:30px; ">
<h3>
<span style="text-align:center;">ALIENTEK STM32F103开发板网页LED控制</span>
</h3>
</div>
<div style="margin-top:30px; text-align:center;">
<form method="get" action="/leds.cgi">
LED1:
<input type="radio" name="LED1" value="LED1ON" id="LED1_0">ON
<input name="LED1" type="radio" id="LED1_1" value="LED1OFF" checked="">OFF<br>
<br>
<input type="submit" name="button2" id="button2" value="SEND">
</form>
</div>
<div style="width:1000px; background-color:#0066CC;color:#fff; ">
<h3>
<span style="text-align:center;">ALIENTEK STM32F103开发板网页蜂鸣器(BEEP)控制</span>
</h3>
</div>
<div style="margin-top:30px; text-align:center;">
<form name="form1" method="get" action="/beep.cgi">
BEEP:
<input type="radio" name="BEEP" value="BEEPON" id="BEEP_0">ON
<input name="BEEP" type="radio" id="BEEP_1" value="BEEPOFF" checked="">OFF<br> <br>
<input type="submit" name="button" id="button" value="SEND">
<br>
</form>
</div>
</div>
<div align="center" style="margin-top:20px;margin-bottom:30px;">
&#169; 开源电子网(OpenEdv.com) | <a href="http://www.alientek.com/" target="_blank">关于我们</a> | <a target="_blank" href="http://www.alientek.com/">官方网站</a> | <a href="http://weibo.com/u/2973019374" target="_blank">@新浪微博</a> |<a href="http://shop62057469.taobao.com/" target="_blank">官方淘宝店</a> |<a href="http://www.miitbeian.gov.cn/" target="_blank" style="color:#737573;text-decoration:none;">粤ICP备12000418号-1</a> <br>
</div>
</body></html>

View File

@ -0,0 +1,79 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0055)http://192.168.1.112/leds.cgi?LED1=LED1OFF&button2=SEND -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>ALIENTEK STM32F103开发板LWIP实例</title>
<style type="text/css">
.ul1{margin:0;padding:0; list-style:none;}
.li1{margin:0;padding:0; list-style:none;}
.menu{width:1000px;height:48px;margin:0 auto; background:url(image/tab.jpg) repeat-x; }
.menu ul{width:1000px;float:left;height:48px;display:inline;}
.menu ul li{width:200px;height:48px; line-height:48px; text-align:center; float:left;display:inline; }
.menu ul li a{width:200px;height:48px; float:left;text-decoration:none; color:#fff; font-size:18px;font-weight:bold;}
.menu ul li a:hover{ background:#FF0000 repeat-x; }
.logo{}
.bodystyle{ margin:0 auto; width:1000px; background:#d5d5d7;}
</style>
</head>
<body class="bodystyle">
<div style="background-color:#FFFFFF;">
<div class="logo">
<img src="/image/head.jpg" alt="广州市星翼电子科技有限公司" title="广州市星翼电子科技有限公司" style="margin:20px 0px 0px 0px;">
</div>
<div class="menu">
<ul class="ul1">
<li class="li1"><a href="/index.html">主页</a></li>
<li class="li1"><a href="/STM32_LED_OFF_BEEP_ON.shtml">LED/BEEP控制</a></li>
<li class="li1"><a href="/STM32_ADC_TEMPERATE.shtml">ADC/内部温度传感器</a></li>
<li class="li1"><a href="/STM32_RTC.shtml">RTC实时时钟</a></li>
<li class="li1"><a href="http://eboard.taobao.com/" target="_blank">联系我们</a></li>
</ul>
</div>
<div style="margin-top:30px;">
此页面用来控制开发板上的LED和蜂鸣器,选择LED1或BEEP的状态然后点击发送按钮。查看开发板上的对应的LED灯是或蜂鸣器否变化。
</div>
<div style="width:1000px; background-color:#0066CC;color:#fff;margin-top:30px; ">
<h3>
<span style="text-align:center;">ALIENTEK STM32F103开发板网页LED控制</span>
</h3>
</div>
<div style="margin-top:30px; text-align:center;">
<form method="get" action="/leds.cgi">
LED1:
<input type="radio" name="LED1" value="LED1ON" id="LED1_0">ON
<input name="LED1" type="radio" id="LED1_1" value="LED1OFF" checked="">OFF<br>
<br>
<input type="submit" name="button2" id="button2" value="SEND">
</form>
</div>
<div style="width:1000px; background-color:#0066CC;color:#fff; ">
<h3>
<span style="text-align:center;">ALIENTEK STM32F103开发板网页蜂鸣器(BEEP)控制</span>
</h3>
</div>
<div style="margin-top:30px; text-align:center;">
<form name="form1" method="get" action="/beep.cgi">
BEEP:
<input type="radio" name="BEEP" value="BEEPON" id="BEEP_0" checked="">ON
<input name="BEEP" type="radio" id="BEEP_1" value="BEEPOFF">OFF<br> <br>
<input type="submit" name="button" id="button" value="SEND">
<br>
</form>
</div>
</div>
<div align="center" style="margin-top:20px;margin-bottom:30px;">
&#169; 开源电子网(OpenEdv.com) | <a href="http://www.alientek.com/" target="_blank">关于我们</a> | <a target="_blank" href="http://www.alientek.com/">官方网站</a> | <a href="http://weibo.com/u/2973019374" target="_blank">@新浪微博</a> |<a href="http://shop62057469.taobao.com/" target="_blank">官方淘宝店</a> |<a href="http://www.miitbeian.gov.cn/" target="_blank" style="color:#737573;text-decoration:none;">粤ICP备12000418号-1</a> <br>
</div>
</body></html>

View File

@ -0,0 +1,79 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0054)http://192.168.1.112/leds.cgi?LED1=LED1ON&button2=SEND -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>ALIENTEK STM32F103开发板LWIP实例</title>
<style type="text/css">
.ul1{margin:0;padding:0; list-style:none;}
.li1{margin:0;padding:0; list-style:none;}
.menu{width:1000px;height:48px;margin:0 auto; background:url(image/tab.jpg) repeat-x; }
.menu ul{width:1000px;float:left;height:48px;display:inline;}
.menu ul li{width:200px;height:48px; line-height:48px; text-align:center; float:left;display:inline; }
.menu ul li a{width:200px;height:48px; float:left;text-decoration:none; color:#fff; font-size:18px;font-weight:bold;}
.menu ul li a:hover{ background:#FF0000 repeat-x; }
.logo{}
.bodystyle{ margin:0 auto; width:1000px; background:#d5d5d7;}
</style>
</head>
<body class="bodystyle">
<div style="background-color:#FFFFFF;">
<div class="logo">
<img src="/image/head.jpg" alt="广州市星翼电子科技有限公司" title="广州市星翼电子科技有限公司" style="margin:20px 0px 0px 0px;">
</div>
<div class="menu">
<ul class="ul1">
<li class="li1"><a href="/index.html">主页</a></li>
<li class="li1"><a href="/STM32_LED_ON_BEEP_OFF.shtml">LED/BEEP控制</a></li>
<li class="li1"><a href="/STM32_ADC_TEMPERATE.shtml">ADC/内部温度传感器</a></li>
<li class="li1"><a href="/STM32_RTC.shtml">RTC实时时钟</a></li>
<li class="li1"><a href="http://eboard.taobao.com/" target="_blank">联系我们</a></li>
</ul>
</div>
<div style="margin-top:30px;">
此页面用来控制开发板上的LED和蜂鸣器,选择LED1或BEEP的状态然后点击发送按钮。查看开发板上的对应的LED灯是或蜂鸣器否变化。
</div>
<div style="width:1000px; background-color:#0066CC;color:#fff;margin-top:30px; ">
<h3>
<span style="text-align:center;">ALIENTEK STM32F103开发板网页LED控制</span>
</h3>
</div>
<div style="margin-top:30px; text-align:center;">
<form method="get" action="/leds.cgi">
LED1:
<input type="radio" name="LED1" value="LED1ON" id="LED1_0" checked="">ON
<input name="LED1" type="radio" id="LED1_1" value="LED1OFF">OFF<br>
<br>
<input type="submit" name="button2" id="button2" value="SEND">
</form>
</div>
<div style="width:1000px; background-color:#0066CC;color:#fff; ">
<h3>
<span style="text-align:center;">ALIENTEK STM32F103开发板网页蜂鸣器(BEEP)控制</span>
</h3>
</div>
<div style="margin-top:30px; text-align:center;">
<form name="form1" method="get" action="/beep.cgi">
BEEP:
<input type="radio" name="BEEP" value="BEEPON" id="BEEP_0">ON
<input name="BEEP" type="radio" id="BEEP_1" value="BEEPOFF" checked="">OFF<br> <br>
<input type="submit" name="button" id="button" value="SEND">
<br>
</form>
</div>
</div>
<div align="center" style="margin-top:20px;margin-bottom:30px;">
&#169; 开源电子网(OpenEdv.com) | <a href="http://www.alientek.com/" target="_blank">关于我们</a> | <a target="_blank" href="http://www.alientek.com/">官方网站</a> | <a href="http://weibo.com/u/2973019374" target="_blank">@新浪微博</a> |<a href="http://shop62057469.taobao.com/" target="_blank">官方淘宝店</a> |<a href="http://www.miitbeian.gov.cn/" target="_blank" style="color:#737573;text-decoration:none;">粤ICP备12000418号-1</a> <br>
</div>
</body></html>

View File

@ -0,0 +1,79 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0053)http://192.168.1.112/beep.cgi?BEEP=BEEPON&button=SEND -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>ALIENTEK STM32F103开发板LWIP实例</title>
<style type="text/css">
.ul1{margin:0;padding:0; list-style:none;}
.li1{margin:0;padding:0; list-style:none;}
.menu{width:1000px;height:48px;margin:0 auto; background:url(image/tab.jpg) repeat-x; }
.menu ul{width:1000px;float:left;height:48px;display:inline;}
.menu ul li{width:200px;height:48px; line-height:48px; text-align:center; float:left;display:inline; }
.menu ul li a{width:200px;height:48px; float:left;text-decoration:none; color:#fff; font-size:18px;font-weight:bold;}
.menu ul li a:hover{ background:#FF0000 repeat-x; }
.logo{}
.bodystyle{ margin:0 auto; width:1000px; background:#d5d5d7;}
</style>
</head>
<body class="bodystyle">
<div style="background-color:#FFFFFF;">
<div class="logo">
<img src="/image/head.jpg" alt="广州市星翼电子科技有限公司" title="广州市星翼电子科技有限公司" style="margin:20px 0px 0px 0px;">
</div>
<div class="menu">
<ul class="ul1">
<li class="li1"><a href="/index.html">主页</a></li>
<li class="li1"><a href="/STM32_LED_ON_BEEP_ON.shtml">LED/BEEP控制</a></li>
<li class="li1"><a href="/STM32_ADC_TEMPERATE.shtml">ADC/内部温度传感器</a></li>
<li class="li1"><a href="/STM32_RTC.shtml">RTC实时时钟</a></li>
<li class="li1"><a href="http://eboard.taobao.com/" target="_blank">联系我们</a></li>
</ul>
</div>
<div style="margin-top:30px;">
此页面用来控制开发板上的LED和蜂鸣器,选择LED1或BEEP的状态然后点击发送按钮。查看开发板上的对应的LED灯是或蜂鸣器否变化。
</div>
<div style="width:1000px; background-color:#0066CC;color:#fff;margin-top:30px; ">
<h3>
<span style="text-align:center;">ALIENTEK STM32F103开发板网页LED控制</span>
</h3>
</div>
<div style="margin-top:30px; text-align:center;">
<form method="get" action="/leds.cgi">
LED1:
<input type="radio" name="LED1" value="LED1ON" id="LED1_0" checked="">ON
<input name="LED1" type="radio" id="LED1_1" value="LED1OFF">OFF<br>
<br>
<input type="submit" name="button2" id="button2" value="SEND">
</form>
</div>
<div style="width:1000px; background-color:#0066CC;color:#fff; ">
<h3>
<span style="text-align:center;">ALIENTEK STM32F103开发板网页蜂鸣器(BEEP)控制</span>
</h3>
</div>
<div style="margin-top:30px; text-align:center;">
<form name="form1" method="get" action="/beep.cgi">
BEEP:
<input type="radio" name="BEEP" value="BEEPON" id="BEEP_0" checked="">ON
<input name="BEEP" type="radio" id="BEEP_1" value="BEEPOFF">OFF<br> <br>
<input type="submit" name="button" id="button" value="SEND">
<br>
</form>
</div>
</div>
<div align="center" style="margin-top:20px;margin-bottom:30px;">
&#169; 开源电子网(OpenEdv.com) | <a href="http://www.alientek.com/" target="_blank">关于我们</a> | <a target="_blank" href="http://www.alientek.com/">官方网站</a> | <a href="http://weibo.com/u/2973019374" target="_blank">@新浪微博</a> |<a href="http://shop62057469.taobao.com/" target="_blank">官方淘宝店</a> |<a href="http://www.miitbeian.gov.cn/" target="_blank" style="color:#737573;text-decoration:none;">粤ICP备12000418号-1</a> <br>
</div>
</body></html>

View File

@ -0,0 +1,76 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0039)http://192.168.1.112/STM32_RTC.shtml -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=GBK">
<meta http-equiv="refresh" content="1">
<title>ALIENTEK STM32F103开发板LWIP实例</title>
<style type="text/css">
.ul1{margin:0;padding:0; list-style:none;}
.li1{margin:0;padding:0; list-style:none;}
.menu{width:1000px;height:48px;margin:0 auto; background:url(image/tab.jpg) repeat-x; }
.menu ul{width:1000px;float:left;height:48px;display:inline;}
.menu ul li{width:200px;height:48px; line-height:48px; text-align:center; float:left;display:inline; }
.menu ul li a{width:200px;height:48px; float:left;text-decoration:none; color:#fff; font-size:18px;font-weight:bold;}
.menu ul li a:hover{ background:#FF0000 repeat-x; }
.logo{}
.bodystyle{ margin:0 auto; width:1000px; background:#d5d5d7;}
</style>
</head>
<body class="bodystyle">
<div style="background-color:#FFFFFF; ">
<div class="logo">
<img src="/image/head.jpg" alt="广州市星翼电子科技有限公司" title="广州市星翼电子科技有限公司" style="margin:20px 0px 0px 0px;">
</div>
<div class="menu">
<ul class="ul1">
<li class="li1"><a href="/index.html">主页</a></li>
<li class="li1"><a href="/STM32_LED_OFF_BEEP_OFF.shtml">LED/BEEP控制</a></li>
<li class="li1"><a href="/STM32_ADC_TEMPERATE.shtml">ADC/内部温度传感器</a></li>
<li class="li1"><a href="/STM32_RTC.shtml">RTC实时时钟</a></li>
<li class="li1"><a href="http://eboard.taobao.com/" target="_blank">联系我们</a></li>
</ul>
</div>
<div style="margin-top:30px;">
此页面用来显示开发板上RTC实时时钟时间值。
</div>
<div style="background-color:#0066CC;color:#fff;margin-top:30px; ">
<h3>
<span>RTC实时时钟显示</span>
</h3>
</div>
<div align="center">
<table border="1" cellpadding="10">
<tbody><tr>
<td width="200">当前时间</td>
<td width="200"><!--#h--></td>
</tr>
</tbody></table>
<br><br>
<table border="1" cellpadding="10">
<tbody><tr>
<td width="200">当前日期</td>
<td width="200"><!--#y--></td>
</tr>
</tbody></table>
<br><br>
</div>
</div>
<div align="center" style="margin-top:20px;margin-bottom:30px;">
&#169; 开源电子网(OpenEdv.com) | <a href="http://www.alientek.com/" target="_blank">关于我们</a> | <a target="_blank" href="http://www.alientek.com/">官方网站</a> | <a href="http://weibo.com/u/2973019374" target="_blank">@新浪微博</a> |<a href="http://shop62057469.taobao.com/" target="_blank">官方淘宝店</a> |<a href="http://www.miitbeian.gov.cn/" target="_blank" style="color:#737573;text-decoration:none;">粤ICP备12000418号-1</a> <br>
</div>
</body></html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 677 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

View File

@ -0,0 +1,37 @@
(function(){var h={},mt={},c={id:"c49232a8be82d37340e295f04cb9cf85",dm:["openedv.com"],js:"tongji.baidu.com/hm-web/js/",etrk:[],icon:'',ctrk:false,align:-1,nv:-1,vdur:1800000,age:31536000000,rec:0,rp:[],trust:0,vcard:0,qiao:0,lxb:0,conv:0,apps:''};var p=!0,s=null,t=!1;mt.g={};mt.g.xa=/msie (\d+\.\d+)/i.test(navigator.userAgent);mt.g.cookieEnabled=navigator.cookieEnabled;mt.g.javaEnabled=navigator.javaEnabled();mt.g.language=navigator.language||navigator.browserLanguage||navigator.systemLanguage||navigator.userLanguage||"";mt.g.ia=(window.screen.width||0)+"x"+(window.screen.height||0);mt.g.colorDepth=window.screen.colorDepth||0;mt.cookie={};
mt.cookie.set=function(a,b,f){var d;f.z&&(d=new Date,d.setTime(d.getTime()+f.z));document.cookie=a+"="+b+(f.domain?"; domain="+f.domain:"")+(f.path?"; path="+f.path:"")+(d?"; expires="+d.toGMTString():"")+(f.Ba?"; secure":"")};mt.cookie.get=function(a){return(a=RegExp("(^| )"+a+"=([^;]*)(;|$)").exec(document.cookie))?a[2]:s};mt.event={};mt.event.e=function(a,b,f){a.attachEvent?a.attachEvent("on"+b,function(d){f.call(a,d)}):a.addEventListener&&a.addEventListener(b,f,t)};
mt.event.preventDefault=function(a){a.preventDefault?a.preventDefault():a.returnValue=t};mt.m={};mt.m.parse=function(){return(new Function('return (" + source + ")'))()};
mt.m.stringify=function(){function a(a){/["\\\x00-\x1f]/.test(a)&&(a=a.replace(/["\\\x00-\x1f]/g,function(a){var b=f[a];if(b)return b;b=a.charCodeAt();return"\\u00"+Math.floor(b/16).toString(16)+(b%16).toString(16)}));return'"'+a+'"'}function b(a){return 10>a?"0"+a:a}var f={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return function(d){switch(typeof d){case "undefined":return"undefined";case "number":return isFinite(d)?String(d):"null";case "string":return a(d);case "boolean":return String(d);
default:if(d===s)return"null";if(d instanceof Array){var f=["["],n=d.length,l,e,m;for(e=0;e<n;e++)switch(m=d[e],typeof m){case "undefined":case "function":case "unknown":break;default:l&&f.push(","),f.push(mt.m.stringify(m)),l=1}f.push("]");return f.join("")}if(d instanceof Date)return'"'+d.getFullYear()+"-"+b(d.getMonth()+1)+"-"+b(d.getDate())+"T"+b(d.getHours())+":"+b(d.getMinutes())+":"+b(d.getSeconds())+'"';l=["{"];e=mt.m.stringify;for(n in d)if(Object.prototype.hasOwnProperty.call(d,n))switch(m=
d[n],typeof m){case "undefined":case "unknown":case "function":break;default:f&&l.push(","),f=1,l.push(e(n)+":"+e(m))}l.push("}");return l.join("")}}}();mt.lang={};mt.lang.d=function(a,b){return"[object "+b+"]"==={}.toString.call(a)};mt.lang.ya=function(a){return mt.lang.d(a,"Number")&&isFinite(a)};mt.lang.Aa=function(a){return mt.lang.d(a,"String")};mt.localStorage={};
mt.localStorage.s=function(){if(!mt.localStorage.f)try{mt.localStorage.f=document.createElement("input"),mt.localStorage.f.type="hidden",mt.localStorage.f.style.display="none",mt.localStorage.f.addBehavior("#default#userData"),document.getElementsByTagName("head")[0].appendChild(mt.localStorage.f)}catch(a){return t}return p};
mt.localStorage.set=function(a,b,f){var d=new Date;d.setTime(d.getTime()+f||31536E6);try{window.localStorage?(b=d.getTime()+"|"+b,window.localStorage.setItem(a,b)):mt.localStorage.s()&&(mt.localStorage.f.expires=d.toUTCString(),mt.localStorage.f.load(document.location.hostname),mt.localStorage.f.setAttribute(a,b),mt.localStorage.f.save(document.location.hostname))}catch(g){}};
mt.localStorage.get=function(a){if(window.localStorage){if(a=window.localStorage.getItem(a)){var b=a.indexOf("|"),f=a.substring(0,b)-0;if(f&&f>(new Date).getTime())return a.substring(b+1)}}else if(mt.localStorage.s())try{return mt.localStorage.f.load(document.location.hostname),mt.localStorage.f.getAttribute(a)}catch(d){}return s};
mt.localStorage.remove=function(a){if(window.localStorage)window.localStorage.removeItem(a);else if(mt.localStorage.s())try{mt.localStorage.f.load(document.location.hostname),mt.localStorage.f.removeAttribute(a),mt.localStorage.f.save(document.location.hostname)}catch(b){}};mt.sessionStorage={};mt.sessionStorage.set=function(a,b){if(window.sessionStorage)try{window.sessionStorage.setItem(a,b)}catch(f){}};
mt.sessionStorage.get=function(a){return window.sessionStorage?window.sessionStorage.getItem(a):s};mt.sessionStorage.remove=function(a){window.sessionStorage&&window.sessionStorage.removeItem(a)};mt.G={};mt.G.log=function(a,b){var f=new Image,d="mini_tangram_log_"+Math.floor(2147483648*Math.random()).toString(36);window[d]=f;f.onload=f.onerror=f.onabort=function(){f.onload=f.onerror=f.onabort=s;f=window[d]=s;b&&b(a)};f.src=a};mt.H={};
mt.H.ba=function(){var a="";if(navigator.plugins&&navigator.mimeTypes.length){var b=navigator.plugins["Shockwave Flash"];b&&b.description&&(a=b.description.replace(/^.*\s+(\S+)\s+\S+$/,"$1"))}else if(window.ActiveXObject)try{if(b=new ActiveXObject("ShockwaveFlash.ShockwaveFlash"))(a=b.GetVariable("$version"))&&(a=a.replace(/^.*\s+(\d+),(\d+).*$/,"$1.$2"))}catch(f){}return a};
mt.H.ta=function(a,b,f,d,g){return'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="'+a+'" width="'+f+'" height="'+d+'"><param name="movie" value="'+b+'" /><param name="flashvars" value="'+(g||"")+'" /><param name="allowscriptaccess" value="always" /><embed type="application/x-shockwave-flash" name="'+a+'" width="'+f+'" height="'+d+'" src="'+b+'" flashvars="'+(g||"")+'" allowscriptaccess="always" /></object>'};mt.url={};
mt.url.k=function(a,b){var f=a.match(RegExp("(^|&|\\?|#)("+b+")=([^&#]*)(&|$|#)",""));return f?f[3]:s};mt.url.va=function(a){return(a=a.match(/^(https?:)\/\//))?a[1]:s};mt.url.Z=function(a){return(a=a.match(/^(https?:\/\/)?([^\/\?#]*)/))?a[2].replace(/.*@/,""):s};mt.url.K=function(a){return(a=mt.url.Z(a))?a.replace(/:\d+$/,""):a};mt.url.ua=function(a){return(a=a.match(/^(https?:\/\/)?[^\/]*(.*)/))?a[2].replace(/[\?#].*/,"").replace(/^$/,"/"):s};
h.I={wa:"http://tongji.baidu.com/hm-web/welcome/ico",P:"hm.baidu.com/hm.gif",S:"baidu.com",ea:"hmmd",fa:"hmpl",da:"hmkw",ca:"hmci",ga:"hmsr",l:0,h:Math.round(+new Date/1E3),protocol:"https:"==document.location.protocol?"https:":"http:",za:0,qa:6E5,ra:10,sa:1024,pa:1,q:2147483647,Q:"cc cf ci ck cl cm cp cw ds ep et fl ja ln lo lt nv rnd si st su v cv lv api tt u".split(" ")};
(function(){var a={i:{},e:function(a,f){this.i[a]=this.i[a]||[];this.i[a].push(f)},o:function(a,f){this.i[a]=this.i[a]||[];for(var d=this.i[a].length,g=0;g<d;g++)this.i[a][g](f)}};return h.w=a})();
(function(){function a(a,d){var g=document.createElement("script");g.charset="utf-8";b.d(d,"Function")&&(g.readyState?g.onreadystatechange=function(){if("loaded"===g.readyState||"complete"===g.readyState)g.onreadystatechange=s,d()}:g.onload=function(){d()});g.src=a;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(g,n)}var b=mt.lang;return h.load=a})();
(function(){function a(){return function(){h.b.a.nv=0;h.b.a.st=4;h.b.a.et=3;h.b.a.ep=h.t.$()+","+h.t.Y();h.b.j()}}function b(){clearTimeout(x);var a;w&&(a="visible"==document[w]);y&&(a=!document[y]);e="undefined"==typeof a?p:a;if((!l||!m)&&e&&k)u=p,r=+new Date;else if(l&&m&&(!e||!k))u=t,q+=+new Date-r;l=e;m=k;x=setTimeout(b,100)}function f(a){var m=document,r="";if(a in m)r=a;else for(var q=["webkit","ms","moz","o"],b=0;b<q.length;b++){var k=q[b]+a.charAt(0).toUpperCase()+a.slice(1);if(k in m){r=
k;break}}return r}function d(a){if(!("focus"==a.type||"blur"==a.type)||!(a.target&&a.target!=window))k="focus"==a.type||"focusin"==a.type?p:t,b()}var g=mt.event,n=h.w,l=p,e=p,m=p,k=p,v=+new Date,r=v,q=0,u=p,w=f("visibilityState"),y=f("hidden"),x;b();(function(){var a=w.replace(/[vV]isibilityState/,"visibilitychange");g.e(document,a,b);g.e(window,"pageshow",b);g.e(window,"pagehide",b);"object"==typeof document.onfocusin?(g.e(document,"focusin",d),g.e(document,"focusout",d)):(g.e(window,"focus",d),
g.e(window,"blur",d))})();h.t={$:function(){return+new Date-v},Y:function(){return u?+new Date-r+q:q}};n.e("pv-b",function(){g.e(window,"unload",a())});return h.t})();
(function(){function a(m){for(var b in m)if({}.hasOwnProperty.call(m,b)){var e=m[b];d.d(e,"Object")||d.d(e,"Array")?a(e):m[b]=String(e)}}function b(a){return a.replace?a.replace(/'/g,"'0").replace(/\*/g,"'1").replace(/!/g,"'2"):a}var f=mt.G,d=mt.lang,g=mt.m,n=h.I,l=h.w,e={L:s,n:[],r:0,M:t,init:function(){e.c=0;e.L={push:function(){e.D.apply(e,arguments)}};l.e("pv-b",function(){e.V();e.W()});l.e("pv-d",e.X);l.e("stag-b",function(){h.b.a.api=e.c||e.r?e.c+"_"+e.r:""});l.e("stag-d",function(){h.b.a.api=
0;e.c=0;e.r=0})},V:function(){var a=window._hmt;if(a&&a.length)for(var b=0;b<a.length;b++){var d=a[b];switch(d[0]){case "_setAccount":1<d.length&&/^[0-9a-z]{32}$/.test(d[1])&&(e.c|=1,window._bdhm_account=d[1]);break;case "_setAutoPageview":if(1<d.length&&(d=d[1],t===d||p===d))e.c|=2,window._bdhm_autoPageview=d}}},W:function(){if("undefined"===typeof window._bdhm_account||window._bdhm_account===c.id){window._bdhm_account=c.id;var a=window._hmt;if(a&&a.length)for(var b=0,f=a.length;b<f;b++)d.d(a[b],
"Array")&&"_trackEvent"!==a[b][0]&&"_trackRTEvent"!==a[b][0]?e.D(a[b]):e.n.push(a[b]);window._hmt=e.L}},X:function(){if(0<e.n.length)for(var a=0,b=e.n.length;a<b;a++)e.D(e.n[a]);e.n=s},D:function(a){if(d.d(a,"Array")){var b=a[0];if(e.hasOwnProperty(b)&&d.d(e[b],"Function"))e[b](a)}},_trackPageview:function(a){if(1<a.length&&a[1].charAt&&"/"==a[1].charAt(0)){e.c|=4;h.b.a.et=0;h.b.a.ep="";h.b.B?(h.b.a.nv=0,h.b.a.st=4):h.b.B=p;var b=h.b.a.u,d=h.b.a.su;h.b.a.u=n.protocol+"//"+document.location.host+a[1];
e.M||(h.b.a.su=document.location.href);h.b.j();h.b.a.u=b;h.b.a.su=d}},_trackEvent:function(a){2<a.length&&(e.c|=8,h.b.a.nv=0,h.b.a.st=4,h.b.a.et=4,h.b.a.ep=b(a[1])+"*"+b(a[2])+(a[3]?"*"+b(a[3]):"")+(a[4]?"*"+b(a[4]):""),h.b.j())},_setCustomVar:function(a){if(!(4>a.length)){var d=a[1],f=a[4]||3;if(0<d&&6>d&&0<f&&4>f){e.r++;for(var r=(h.b.a.cv||"*").split("!"),q=r.length;q<d-1;q++)r.push("*");r[d-1]=f+"*"+b(a[2])+"*"+b(a[3]);h.b.a.cv=r.join("!");a=h.b.a.cv.replace(/[^1](\*[^!]*){2}/g,"*").replace(/((^|!)\*)+$/g,
"");""!==a?h.b.setData("Hm_cv_"+c.id,encodeURIComponent(a),c.age):h.b.ha("Hm_cv_"+c.id)}}},_setReferrerOverride:function(a){1<a.length&&(h.b.a.su=a[1].charAt&&"/"==a[1].charAt(0)?n.protocol+"//"+window.location.host+a[1]:a[1],e.M=p)},_trackOrder:function(b){b=b[1];d.d(b,"Object")&&(a(b),e.c|=16,h.b.a.nv=0,h.b.a.st=4,h.b.a.et=94,h.b.a.ep=g.stringify(b),h.b.j())},_trackMobConv:function(a){if(a={webim:1,tel:2,map:3,sms:4,callback:5,share:6}[a[1]])e.c|=32,h.b.a.et=93,h.b.a.ep=a,h.b.j()},_trackRTPageview:function(b){b=
b[1];d.d(b,"Object")&&(a(b),b=g.stringify(b),512>=encodeURIComponent(b).length&&(e.c|=64,h.b.a.rt=b))},_trackRTEvent:function(b){b=b[1];if(d.d(b,"Object")){a(b);b=encodeURIComponent(g.stringify(b));var f=function(a){var b=h.b.a.rt;e.c|=128;h.b.a.et=90;h.b.a.rt=a;h.b.j();h.b.a.rt=b},l=b.length;if(900>=l)f.call(this,b);else for(var l=Math.ceil(l/900),r="block|"+Math.round(Math.random()*n.q).toString(16)+"|"+l+"|",q=[],u=0;u<l;u++)q.push(u),q.push(b.substring(900*u,900*u+900)),f.call(this,r+q.join("|")),
q=[]}},_setUserId:function(a){a=a[1];if(d.d(a,"String")||d.d(a,"Number")){var b=h.b.A(),g="hm-"+h.b.a.v;e.O=e.O||Math.round(Math.random()*n.q);f.log("//datax.baidu.com/x.gif?si="+c.id+"&dm="+encodeURIComponent(b)+"&ac="+encodeURIComponent(a)+"&v="+g+"&li="+e.O+"&rnd="+Math.round(Math.random()*n.q))}}};e.init();h.T=e;return h.T})();
(function(){function a(){"undefined"==typeof window["_bdhm_loaded_"+c.id]&&(window["_bdhm_loaded_"+c.id]=p,this.a={},this.B=t,this.init())}var b=mt.url,f=mt.G,d=mt.H,g=mt.lang,n=mt.cookie,l=mt.g,e=mt.localStorage,m=mt.sessionStorage,k=h.I,v=h.w;a.prototype={C:function(a,b){a="."+a.replace(/:\d+/,"");b="."+b.replace(/:\d+/,"");var d=a.indexOf(b);return-1<d&&d+b.length==a.length},N:function(a,b){a=a.replace(/^https?:\/\//,"");return 0===a.indexOf(b)},p:function(a){for(var d=0;d<c.dm.length;d++)if(-1<
c.dm[d].indexOf("/")){if(this.N(a,c.dm[d]))return p}else{var e=b.K(a);if(e&&this.C(e,c.dm[d]))return p}return t},A:function(){for(var a=document.location.hostname,b=0,d=c.dm.length;b<d;b++)if(this.C(a,c.dm[b]))return c.dm[b].replace(/(:\d+)?[\/\?#].*/,"");return a},J:function(){for(var a=0,b=c.dm.length;a<b;a++){var d=c.dm[a];if(-1<d.indexOf("/")&&this.N(document.location.href,d))return d.replace(/^[^\/]+(\/.*)/,"$1")+"/"}return"/"},aa:function(){if(!document.referrer)return k.h-k.l>c.vdur?1:4;var a=
t;this.p(document.referrer)&&this.p(document.location.href)?a=p:(a=b.K(document.referrer),a=this.C(a||"",document.location.hostname));return a?k.h-k.l>c.vdur?1:4:3},getData:function(a){try{return n.get(a)||m.get(a)||e.get(a)}catch(b){}},setData:function(a,b,d){try{n.set(a,b,{domain:this.A(),path:this.J(),z:d}),d?e.set(a,b,d):m.set(a,b)}catch(f){}},ha:function(a){try{n.set(a,"",{domain:this.A(),path:this.J(),z:-1}),m.remove(a),e.remove(a)}catch(b){}},na:function(){var a,b,d,e,f;k.l=this.getData("Hm_lpvt_"+
c.id)||0;13==k.l.length&&(k.l=Math.round(k.l/1E3));b=this.aa();a=4!=b?1:0;if(d=this.getData("Hm_lvt_"+c.id)){e=d.split(",");for(f=e.length-1;0<=f;f--)13==e[f].length&&(e[f]=""+Math.round(e[f]/1E3));for(;2592E3<k.h-e[0];)e.shift();f=4>e.length?2:3;for(1===a&&e.push(k.h);4<e.length;)e.shift();d=e.join(",");e=e[e.length-1]}else d=k.h,e="",f=1;this.setData("Hm_lvt_"+c.id,d,c.age);this.setData("Hm_lpvt_"+c.id,k.h);d=k.h==this.getData("Hm_lpvt_"+c.id)?"1":"0";if(0===c.nv&&this.p(document.location.href)&&
(""===document.referrer||this.p(document.referrer)))a=0,b=4;this.a.nv=a;this.a.st=b;this.a.cc=d;this.a.lt=e;this.a.lv=f},ma:function(){for(var a=[],b=0,d=k.Q.length;b<d;b++){var e=k.Q[b],f=this.a[e];"undefined"!=typeof f&&""!==f&&a.push(e+"="+encodeURIComponent(f))}b=this.a.et;this.a.rt&&(0===b?a.push("rt="+encodeURIComponent(this.a.rt)):90===b&&a.push("rt="+this.a.rt));return a.join("&")},oa:function(){this.na();this.a.si=c.id;this.a.su=document.referrer;this.a.ds=l.ia;this.a.cl=l.colorDepth+"-bit";
this.a.ln=l.language;this.a.ja=l.javaEnabled?1:0;this.a.ck=l.cookieEnabled?1:0;this.a.lo="number"==typeof _bdhm_top?1:0;this.a.fl=d.ba();this.a.v="1.0.75";this.a.cv=decodeURIComponent(this.getData("Hm_cv_"+c.id)||"");1==this.a.nv&&(this.a.tt=document.title||"");var a=document.location.href;this.a.cm=b.k(a,k.ea)||"";this.a.cp=b.k(a,k.fa)||"";this.a.cw=b.k(a,k.da)||"";this.a.ci=b.k(a,k.ca)||"";this.a.cf=b.k(a,k.ga)||""},init:function(){try{this.oa(),0===this.a.nv?this.la():this.F(".*"),h.b=this,this.U(),
v.o("pv-b"),this.ka()}catch(a){var b=[];b.push("si="+c.id);b.push("n="+encodeURIComponent(a.name));b.push("m="+encodeURIComponent(a.message));b.push("r="+encodeURIComponent(document.referrer));f.log(k.protocol+"//"+k.P+"?"+b.join("&"))}},ka:function(){function a(){v.o("pv-d")}"undefined"===typeof window._bdhm_autoPageview||window._bdhm_autoPageview===p?(this.B=p,this.a.et=0,this.a.ep="",this.j(a)):a()},j:function(a){var b=this;b.a.rnd=Math.round(Math.random()*k.q);v.o("stag-b");var d=k.protocol+"//"+
k.P+"?"+b.ma();v.o("stag-d");b.R(d);f.log(d,function(d){b.F(d);g.d(a,"Function")&&a.call(b)})},U:function(){var a=document.location.hash.substring(1),d=RegExp(c.id),e=-1<document.referrer.indexOf(k.S)?p:t,f=b.k(a,"jn"),g=/^heatlink$|^select$/.test(f);a&&(d.test(a)&&e&&g)&&(a=document.createElement("script"),a.setAttribute("type","text/javascript"),a.setAttribute("charset","utf-8"),a.setAttribute("src",k.protocol+"//"+c.js+f+".js?"+this.a.rnd),f=document.getElementsByTagName("script")[0],f.parentNode.insertBefore(a,
f))},R:function(a){var b=m.get("Hm_unsent_"+c.id)||"",d=this.a.u?"":"&u="+encodeURIComponent(document.location.href),b=encodeURIComponent(a.replace(/^https?:\/\//,"")+d)+(b?","+b:"");m.set("Hm_unsent_"+c.id,b)},F:function(a){var b=m.get("Hm_unsent_"+c.id)||"";b&&((b=b.replace(RegExp(encodeURIComponent(a.replace(/^https?:\/\//,"")).replace(/([\*\(\)])/g,"\\$1")+"(%26u%3D[^,]*)?,?","g"),"").replace(/,$/,""))?m.set("Hm_unsent_"+c.id,b):m.remove("Hm_unsent_"+c.id))},la:function(){var a=this,b=m.get("Hm_unsent_"+
c.id);if(b)for(var b=b.split(","),d=function(b){f.log(k.protocol+"//"+decodeURIComponent(b).replace(/^https?:\/\//,""),function(b){a.F(b)})},e=0,g=b.length;e<g;e++)d(b[e])}};return new a})();})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,21 @@
// #include <rtthread.h>
#include <httpd.h>
#ifdef LWIP_HTTPD_SSI
extern void httpd_ssi_init(void);
#endif
#ifdef LWIP_HTTPD_CGI
extern void httpd_cgi_init(void);
#endif
void webserver_start(void)
{
rt_kprintf("\n\n\tNow, Initializing The WEB File System...\n");
/* Httpd Init */
httpd_init();
/* 配置 SSI 处理程序 */
httpd_ssi_init();
/* 配置 CGI 处理器 */
httpd_cgi_init();
rt_kprintf("\tNow, Starting The WEB Server Thread...\n");
}
MSH_CMD_EXPORT(webserver_start, start web server);