⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fsdata.c

📁 uIP是免费的TCP/IP协议栈,我们将它移植到我们的AVR以太网开发板中
💻 C
字号:
#define http_head_len 92
/*
添加文件步骤:
1.添加文件名
2.加入网页文件(不带http头部)
3.修改文件结构列表
4.修改文件数
*/

//文件名
char file_index_name[6]={'i','n','d','e','x'};
char file_page1_name[6]={'p','a','g','e','1'};
char file_page2_name[6]={'p','a','g','e','2'};
char file_picture_name[7]={'p','i','c','t','u','r','e'};

//公共网页发送缓冲区(已带http头部)
char mypage[6000]={ 
    0x48, 0x54, 0x54, 0x50, 0x2f, 0x31,	0x2e, 0x30,	0x20, 
	
	0x32, 0x30, 0x30, 0x20, 
	0x4f, 0x4b, 0xd, 0xa, 
	
	0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x3a, 0x20, 0x75, 0x49, 0x50, 0x2f, 0x30, 
	0x2e, 0x39, 0x20, 0x28, 0x68, 0x74, 0x74, 0x70, 0x3a, 0x2f, 
	0x2f, 0x64, 0x75, 0x6e, 0x6b, 0x65, 0x6c, 0x73, 0x2e, 0x63, 
	0x6f, 0x6d, 0x2f, 0x61, 0x64, 0x61, 0x6d, 0x2f, 0x75, 0x69, 
	0x70, 0x2f, 0x29, 0xd, 0xa, 
	
	0x43, 0x6f, 0x6e, 0x74, 0x65, 
	0x6e, 0x74, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x20, 0x74, 
	0x65, 0x78, 0x74, 0x2f, 0x68, 0x74, 0x6d, 0x6c, 0x0d, 0x0a, 0x0d, 0x0a
};

//网页文件
#pragma data:code
const char index_html[]="<html>\
<head>\
<meta http-equiv=\"Content-Language\" content=\"zh-cn\">\
<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 5.0\">\
<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">\
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\
<title>uIP0.9 AVR by YHR - index</title>\
</head>\
<body bgcolor=\"#ADBDED\">\
<p align=\"left\">\
<font color=\"#0000FF\">\
<span style=\"font-size: 33pt; font-weight: 700\">WEB Server at uIP 0.9 TCP/IP Stack</span>\
</font>\
</p>\
<hr>\
<a href=\"page1.html\">page1</a>\
<p><img border=\"0\" src=\"/picture.png\"></p>\
</body>\
</html>\
<end>\
";

const char page1_html[]="<html>\
<head>\
<meta http-equiv=\"Content-Language\" content=\"zh-cn\">\
<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 5.0\">\
<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">\
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\
<title>uIP0.9 AVR by YHR - page1</title>\
</head>\
<body bgcolor=\"#ADBDED\">\
<p align=\"left\">\
<font color=\"#0000FF\">\
<span style=\"font-size: 33pt; font-weight: 700\">WEB Server at uIP 0.9 TCP/IP Stack</span>\
</font>\
</p>\
<hr>\
<a href=\"page2.html\">page2</a>\
<form method=\"POST\" action=\"page1.html\">\
<p>\
<input type=\"radio\" value=\"V1\" name=\"R1\">\
<input type=\"radio\" name=\"R1\" value=\"V2\">\
<input type=\"submit\" value=\"提交\" name=\"B1\"><input type=\"reset\" value=\"重置\" name=\"B2\">\
</p>\
</form>\
</body>\
</html>\
<end>\
";

const char page2_html[]="<html>\
<head>\
<meta http-equiv=\"Content-Language\" content=\"zh-cn\">\
<meta name=\"GENERATOR\" content=\"Microsoft FrontPage 5.0\">\
<meta name=\"ProgId\" content=\"FrontPage.Editor.Document\">\
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\
<title>uIP0.9 AVR by YHR - page2</title>\
</head>\
<body bgcolor=\"#ADBDED\">\
<p align=\"left\">\
<font color=\"#0000FF\">\
<span style=\"font-size: 33pt; font-weight: 700\">WEB Server at uIP 0.9 TCP/IP Stack</span>\
</font>\
</p>\
<hr>\
<a href=\"/\">index</a>\
</body>\
</html>\
<end>\
";

const char picture_png[]={
	0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0xa, 
	00, 00, 00, 0xd, 0x49, 0x48, 0x44, 0x52, 00, 00, 
	0x3, 0x1d, 00, 00, 00, 0x5e, 0x8, 0x6, 00, 00, 
	00, 0x46, 0xbd, 0x79, 0xcc, 00, 00, 00, 0x6, 0x62, 
	0x4b, 0x47, 0x44, 00, 0xff, 00, 0xff, 00, 0xff, 0xa0, 
	0xbd, 0xa7, 0x93, 00, 00, 00, 0x9, 0x70, 0x48, 0x59, 
	0x73, 00, 00, 0xb, 0x12, 00, 00, 0xb, 0x12, 0x1, 
	0xd2, 0xdd, 0x7e, 0xfc, 00, 00, 00, 0x7, 0x74, 0x49, 
	0x4d, 0x45, 0x7, 0xd3, 0xa, 0x5, 0x12, 0x22, 0x33, 0x22, 
	0xd0, 0x7c, 0x9a, 00, 00, 00, 0x1d, 0x74, 0x45, 0x58, 
	0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 00, 0x43, 
	0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x20, 0x77, 0x69, 0x74, 
	0x68, 0x20, 0x54, 0x68, 0x65, 0x20, 0x47, 0x49, 0x4d, 0x50, 
	0xef, 0x64, 0x25, 0x6e, 00, 00, 0x3, 0xa0, 0x49, 0x44, 
	0x41, 0x54, 0x78, 0xda, 0xed, 0xdd, 0xc1, 0x76, 0x9a, 0x40, 
	0x18, 0x80, 0x51, 0x27, 0xc7, 0x5, 0x6c, 0xd1, 0x65, 0x1a, 
	0xec, 0xe9, 0xfb, 0xbf, 0x45, 0x9e, 0x23, 0xd5, 0xb4, 0x4b, 
	0x71, 0x19, 0xdd, 0x4d, 0x97, 0x36, 0x8a, 0x6, 0x1c, 0x82, 
	0x20, 0xf7, 0xee, 0x92, 0xa8, 0x3f, 0xc, 0x68, 0xfa, 0xa1, 
	0x3d, 0x9, 0x6f, 0xaf, 0x1f, 0x71, 0x76, 0x26, 0xcc, 0x6e, 
	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 0x24, 
	00, 0x60, 0x32, 0xbc, 0xd3, 0x1, 00, 00, 0x88, 0xe, 
	00, 00, 0x40, 0x74, 00, 00, 00, 0x88, 0xe, 00, 
	00, 0x40, 0x74, 00, 00, 00, 0x8f, 0x1f, 0x1d, 0xdd, 
	0xfe, 0xf9, 0xd9, 0x18, 0xa3, 0x55, 0x6, 00, 00, 0xd1, 
	0xc1, 0x64, 0x84, 0x8e, 0x1f, 0x2e, 0x58, 0x52, 00, 00, 
	0x44, 0x7, 00, 00, 0x20, 0x3a, 00, 00, 00, 0xd1, 
	0x1, 00, 00, 0x20, 0x3a, 00, 00, 00, 0xd1, 0x1, 
	00, 00, 0x88, 0xe, 00, 00, 00, 0xd1, 0x1, 00, 
	00, 0x88, 0xe, 00, 00, 0x80, 0xb9, 0x25, 0x80, 0xfb, 
	0xd8, 0x6d, 0xe, 0x77, 0x9d, 0xbf, 0x5d, 0xa7, 0xcd, 0x5f, 
	0xae, 0xb2, 0xa4, 0xfb, 0x57, 0x35, 0xfb, 0xdf, 0xe6, 0x8f, 
	0x4d, 0x16, 0x65, 0xbb, 0xf9, 0xa7, 0x8f, 0x5d, 0x6d, 0xf6, 
	0xe7, 0x37, 0x88, 0xf1, 0xca, 0x3, 0x7c, 0xfe, 0x72, 0xf1, 
	0x92, 0x3b, 0x89, 0x1, 0xa0, 0x21, 0xef, 0x74, 00, 00, 
	00, 0xa2, 0x3, 00, 00, 0x10, 0x1d, 00, 00, 00, 
	0xa2, 0x63, 0xac, 0xda, 0x7c, 0xce, 0x1d, 00, 00, 0x44, 
	0x7, 0xe0, 0x59, 0xd, 00, 0xf8, 0xe7, 0x9, 00, 00, 
	0x80, 0xe8, 00, 00, 00, 0x44, 0x7, 00, 00, 0x80, 
	0xe8, 00, 00, 00, 0x44, 0x7, 00, 00, 0x20, 0x3a, 
	00, 00, 00, 0x44, 0x7, 00, 00, 0x20, 0x3a, 00, 
	00, 00, 0xd1, 0x1, 00, 00, 0x20, 0x3a, 00, 00, 
	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0xe7, 0x3, 0x4c, 0x8d, 0x77, 0x3a, 00, 
	00, 00, 0xd1, 0x1, 00, 00, 0x88, 0xe, 00, 00, 
	00, 0xd1, 0x1, 00, 00, 0x88, 0xe, 00, 00, 0x40, 
	0x74, 00, 00, 00, 0x88, 0xe, 00, 00, 0x40, 0x74, 
	00, 00, 00, 0xa2, 0x3, 00, 00, 0x40, 0x74, 0x34, 
	0x13, 0xe4, 0x15, 00, 00, 0x88, 0xe, 00, 00, 0x40, 
	0x74, 00, 00, 00, 0x88, 0xe, 00, 00, 0x40, 0x74, 
	00, 00, 00, 0x13, 0xf1, 0xf, 0x24, 0xa1, 0x5c, 0xab, 
	0x41, 0xd8, 0x92, 0xa4, 00, 00, 00, 00, 0x49, 0x45, 
	0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
	'<','e','n','d','>','\0'
};

#pragma data:data


void load_web_page(const char *webfile)
{
  unsigned int i=0;
  //for(;webfile[i]!='\0';i++)
  for(;(webfile[i]!='<')||(webfile[i+1]!='e')||(webfile[i+2]!='n')||(webfile[i+3]!='d')||(webfile[i+4]!='>');i++)
  {
    mypage[i+http_head_len]=webfile[i];
  } 
}

//文件结构列表]
struct fsdata_file_noconst file_picture_png[] = {{NULL,file_picture_name,mypage,sizeof(picture_png)+http_head_len-6,picture_png}};
struct fsdata_file_noconst file_page2_html[] = {{file_picture_png,file_page2_name,mypage,  sizeof(page2_html)+http_head_len-6,page2_html}};
struct fsdata_file_noconst file_page1_html[] = {{file_page2_html, file_page1_name,mypage,  sizeof(page1_html)+http_head_len-6,page1_html}};
struct fsdata_file_noconst file_index_html[] = {{file_page1_html, file_index_name,mypage,  sizeof(index_html)+http_head_len-6,index_html}};

//文件列表入口
#define FS_ROOT file_index_html
//文件总数
#define FS_NUMFILES 4


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -