📄 easyweb.c
字号:
/****************************************************************** ***** ***** ***** Name: easyweb.c ***** ***** Ver.: 1.0 ***** ***** Date: 07/05/2001 ***** ***** Auth: Andreas Dannenberg ***** ***** HTWK Leipzig ***** ***** university of applied sciences ***** ***** Germany ***** ***** Func: implements a dynamic HTTP-server by using ***** ***** the easyWEB-API ***** ***** ***** ******************************************************************///#include <stdlib.h>#include <stdio.h>#include <string.h>
#define extern // Keil: Line added for modular project management#include "easyweb.h"#include "EMAC.h" // Keil: *.c -> *.h // ethernet packet driver#include "tcpip.h" // Keil: *.c -> *.h // easyWEB TCP/IP stack#include <LPC23xx.h> // Keil: Register definition file for LPC2378#include "webpage.h" // webside for our HTTP server (HTML)
//void main(void)int main(void){unsigned char buf[60];
unsigned char mac,it;
unsigned int lenght;
FIO2DIR=0x0000000FF;
//buf[0]=0x10;buf[1]=0x20;buf[2]=0x30;buf[3]=0x40;
Init_EMAC();
lenght=0;
while(1)
{
lenght=StartReadFrame();
if(lenght==60)
{ if(CheckFrameReceived()==1){
CopyFromFrame_EMAC(buf,60);
EndReadFrame();
for(it=0;it<6;it++)
{
mac=buf[it];
buf[it]=buf[it+6];
buf[it+6]=mac;
}
RequestSend(60);
CopyToFrame_EMAC(buf,60); }
}
else if (lenght!=60&&lenght>0)
{
if(CheckFrameReceived()==1){
DummyReadFrame_EMAC(lenght);
EndReadFrame(); }
}
lenght=0;
}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -