📄 tetsrtl.c
字号:
#include "true_false.h"
#include "stdlib.h"
#include "typedef.h"
#include "mem_man.h"
#include "rtl8019.h"
#include "netif.h"
#include "etherif.h"
#include "ip.h"
#include "arp.h"
#include "utilities.h"
#include "tcp.h"
u8_t arpbuf[]={
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF ,//关拨地址
0x12, 0x23, 0x34, 0x45, 0x56, 0x67,//我的地址
0x08, 0x06,//
0x00, 0x01,//
0x08, 0x00, //
0x06,//
0x04, //
0x00, 0x01,//
0x12, 0x23, 0x34, 0x45, 0x56, 0x67,//
0xC0, 0xA8, 0x02, 0x0d, //我的ip
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,//对方的mac
0xC0, 0xA8, 0x02, 0x13//对方的ip地址
};
void delay(void)
{
u16_t i,j ;
for(i=0;i<0xff;++i)
for(j=0;j<0xff;++j);
}
void testrtl(void)
{
u32_t i ;
struct SMemHead*p=NULL ;
for(;;)
{
RTLSendPacket(arpbuf,100);
delay();
if(p=RTLReceivePacket(),p!=NULL)
{
Uart_Printf("\nRCV SOME DATA,LEN IS %d THEY ARE :",p->pEnd-p->pSart);
for(i=0;i<p->pEnd-p->pSart;++i)
{
if(i%10)Uart_Printf("\n");
Uart_Printf(" 0x%2x",*(u8_t*)(p->pStart+i));
MemFree(p);
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -