/*#################################################*//* !< @breif Read Request structure > */typedefstruct{
WORD Length;
WORD Address;
UINT6 Channel;
UINT2 Priority;
UINT4 Type;
UINT4 reserved;}TMBXHEADER;typedefstruct{
BYTE OpCode;
BYTE Reserved;} TFOEHEADER;typedefstruct{
TMBXHEADER MbxHeader;
TFOEHEADER FoeHeader;
DWORD Password;char FileName[MAX_FILE_NAME_SIZE};} TFOEREADREQ;//end Read Request structure/* !< @breif Write Request structure > */typedefstruct{
TMBXHEADER MbxHeader;
TFOEHEADER FoeHeader;
DWORD Password;char FileName[MAX_FILE_NAME_SIZE};} TFOEWRITEREQ;//end Write Request structure/* !< @breif Data Request structure > */typedefstruct{
TMBXHEADER MbxHeader;
TFOEHEADER FoeHeader;
DWORD PacketNo;
BYTE Data[MAX_DATA_SIZE};} TFOEDATAREQ;//end Data Request structure/* !< @breif Ack Request structure > */typedefstruct{
TMBXHEADER MbxHeader;
TFOEHEADER FoeHeader;
DWORD PacketNo;} TFOEACKREQ;//end Ack Request structure/* !< @breif Error Request structure > *//**************************************
Table 96 – Error codes of FoE
0x8000 Not defined
0x8001 Not found
0x8002 Access denied
0x8003 Disk full
0x8004 Illegal
0x8005 Packet number wrong
0x8006 Already exists
0x8007 No user
0x8008 Bootstrap only
0x8009 Not Bootstrap
0x800A No rights
0x800B Program Error
**************************************/typedefstruct{
TMBXHEADER MbxHeader;
TFOEHEADER FoeHeader;
DWORD ErrorCode;char ErrorText[MAX_ERROR_TEXT_SIZE};} TFOEERRORREQ;//end Error Request structure/* !< @breif Busy Request structure > */typedefstruct{
TMBXHEADER MbxHeader;
TFOEHEADER FoeHeader;
WORD Done;
WORD Entire;char BusyText[MAX_BUSY_TEXT_SIZE};} TFOEBUSYREQ;//end Busy Request structurestructst_foe_data{
var addrOfServer;//station address of the server
var packetNum;
var Size;//number of bytes,range is 1~1472
var Data;}foe_data;
函数
//Read a file from a server.voidfoeService_read(addrOfServer,passwd,filename);//Write a file to a server.voidfoeService_write(addrOfServer,passwd,filename);//Acknowledge a FOE Data.voidfoeService_ack(addrOfServer,packetNum);//Indicate the server is busy.voidfoeService_busy(addrOfServer,Done,Entrie,busyDetail);//Indicate the client that an error has happened.voidfoeService_error(addrOfServer,errCode,errText);