当前位置: 首页 > news >正文

做货运代理网站免费seo网站

做货运代理网站,免费seo网站,头疼是什么原因导致的,电脑iis做网站前言 上一章我们用W5500_EVB_PICO 开发板做UDP组播数据回环测试,那么本章我们进行W5500_EVB_PICO Ping的测试。 什么是PING? Ping (Packet Internet Groper)是一种因特网包探索器,用于测试网络连接量的程序 。Ping是…

前言

        上一章我们用W5500_EVB_PICO 开发板做UDP组播数据回环测试,那么本章我们进行W5500_EVB_PICO Ping的测试。

什么是PING?

        Ping (Packet Internet Groper)是一种因特网包探索器,用于测试网络连接量的程序  。Ping是工作在 TCP/IP网络体系结构中应用层的一个服务命令, 主要是向特定的目的主机发送 ICMP(Internet Control Message Protocol 因特网报文控制协议)Echo 请求报文,测试目的站是否可达及了解其有关状态。

连接方式

使开发板和我们的电脑处于同一网段:

  • 开发板(设备)通过交叉线直连主机(PC)
  • 开发板和主机都接在路由器LAN口

测试工具

  • 串口调试工具(任意)

测试

1.相关代码

我们打开例程中库文件的w5500_ping.c文件我们先找到ping.c头文件下面看下,可以看到几个函数,我们需要用到如下所示几个函数:Ping_auto要我们传入一个socket端口号和需要Ping的对象IP信息;函数里面用一个Switch状态机,对socket端口状态轮询并进行相应的处理,当状态在SOCK_IPRAW,就开始Ping的工作,成功则返回Ping的信息,Ping失败则打印失败的信息

void ping_auto(uint8_t s, uint8_t *addr)
{uint8_t i;int32_t len = 0;uint8_t cnt=0;for(i = 0; i<=3;i++)                                                                        {sleep_ms(10); switch(getSn_SR(s))                                                                     {case SOCK_CLOSED:                                                                       close(s);IINCHIP_WRITE(Sn_PROTO(s), IPPROTO_ICMP);           if(socket(s,Sn_MR_IPRAW,3000,0)!=0)                                 { }while(getSn_SR(s)!=SOCK_IPRAW);sleep_ms(1000);                                                                         sleep_ms(1000);                                                                         break;case SOCK_IPRAW:                                                                        ping_request(s, addr);                                                          req++;while(1){if ( (len = getSn_RX_RSR(s) ) > 0){ping_reply(s, addr, len);                                               sleep_ms(50);                                                                   rep++;break;}else if(cnt > 200){printf( "Request Time out. \r\n");cnt = 0;break;}else{cnt++;sleep_ms(50);                                                                   /*wait 50ms*/}// wait_time for 2 seconds, Break on fail}break;default:break;}#ifdef PING_DEBUGif(rep!=0){printf("Ping Request = %d, PING_Reply = %d\r\n",req,rep);if(rep == req)printf( "PING SUCCESS\r\n " );elseprintf( "REPLY_ERROR\r\n " );}   else{}      #endif  }}

主函数还是和之前一样,先配置好网络信息,然后配置好所要Ping的IP,添加do_ping()函数来执行Ping_auto函数,并将do_ping放在while循环中运行。

#define SOCKET_ID 0
#define ETHERNET_BUF_MAX_SIZE (1024 * 2)void do_ping(void);
void network_init(void);
wiz_NetInfo net_info = {.mac = {0x00, 0x08, 0xdc, 0x16, 0xed, 0x2e},.ip = {192, 168, 1, 10},.sn = {255, 255, 255, 0},.gw = {192, 168, 1, 1},.dns = {8, 8, 8, 8},.dhcp = NETINFO_STATIC};
wiz_NetInfo get_info;
static uint8_t ethernet_buf[ETHERNET_BUF_MAX_SIZE] = {0,};
static uint8_t destip[4]={192, 168, 1, 1};
static uint16_t destport = 8080;
static uint16_t local_port =8000;
int main()                                                          
{   stdio_init_all();sleep_ms(2000);network_init();while(true){// loopback_udpc(SOCKET_ID, ethernet_buf, destip, destport);do_ping();if(req>=4){close(0);                                   break;}        }}void network_init(void)
{uint8_t temp;wizchip_initialize();printf("W5500 ping test.\r\n");sleep_ms(2000);wizchip_setnetinfo(&net_info);print_network_information(get_info);sleep_ms(2000);   
}
void do_ping(void)
{    printf("------------PING_TEST_START-----------------------\r\n");sleep_ms(1000); // wait 1000msping_auto(0,destip);
}

2.烧录现象

我们编译烧录后,打开串行监视器,按下复位键,会打印网络配置信息和所要Ping的ip当Ping成功后串口会打印Ping的信息,出现PING SUCCESS 表示Ping成功。

相关连接:

本章例程链接


文章转载自:
http://dinncocyclohexane.tqpr.cn
http://dinncotransvaluation.tqpr.cn
http://dinncosoldan.tqpr.cn
http://dinncoshenanigan.tqpr.cn
http://dinncominnesinger.tqpr.cn
http://dinncostriven.tqpr.cn
http://dinncornr.tqpr.cn
http://dinncoadopter.tqpr.cn
http://dinncooboe.tqpr.cn
http://dinncosarcoplasm.tqpr.cn
http://dinncoafforestation.tqpr.cn
http://dinncoctenidium.tqpr.cn
http://dinncointruder.tqpr.cn
http://dinncopenult.tqpr.cn
http://dinncobhn.tqpr.cn
http://dinncoabdicator.tqpr.cn
http://dinncoemulsification.tqpr.cn
http://dinncosparkler.tqpr.cn
http://dinncoparamenstrual.tqpr.cn
http://dinncostagnancy.tqpr.cn
http://dinncofusibility.tqpr.cn
http://dinncoholmium.tqpr.cn
http://dinncoreprieval.tqpr.cn
http://dinncobiweekly.tqpr.cn
http://dinncoantehall.tqpr.cn
http://dinncocoldhearted.tqpr.cn
http://dinncosublate.tqpr.cn
http://dinncomagnetoresistance.tqpr.cn
http://dinncopentoxid.tqpr.cn
http://dinncoclip.tqpr.cn
http://dinncoabstractionism.tqpr.cn
http://dinncounsighted.tqpr.cn
http://dinncoanionic.tqpr.cn
http://dinncoantennae.tqpr.cn
http://dinncovehemence.tqpr.cn
http://dinncomhs.tqpr.cn
http://dinncoquadriplegia.tqpr.cn
http://dinncotailcoat.tqpr.cn
http://dinncoreptilian.tqpr.cn
http://dinncoledge.tqpr.cn
http://dinncofirearm.tqpr.cn
http://dinncomiscellany.tqpr.cn
http://dinncotabulate.tqpr.cn
http://dinncosend.tqpr.cn
http://dinncoeuryoky.tqpr.cn
http://dinncopyrimidine.tqpr.cn
http://dinncolarder.tqpr.cn
http://dinncomonogamous.tqpr.cn
http://dinncoamazement.tqpr.cn
http://dinncospic.tqpr.cn
http://dinncogao.tqpr.cn
http://dinncoprodromal.tqpr.cn
http://dinncoipsu.tqpr.cn
http://dinncoanatomist.tqpr.cn
http://dinncooblation.tqpr.cn
http://dinncoeyelashes.tqpr.cn
http://dinncochinook.tqpr.cn
http://dinncoautochthonal.tqpr.cn
http://dinncopalpebra.tqpr.cn
http://dinncopatinous.tqpr.cn
http://dinncohmbs.tqpr.cn
http://dinncoorcish.tqpr.cn
http://dinncoundiscerning.tqpr.cn
http://dinncoindoctrination.tqpr.cn
http://dinncooxo.tqpr.cn
http://dinncoadulterated.tqpr.cn
http://dinncolech.tqpr.cn
http://dinncopsychiater.tqpr.cn
http://dinncoeruption.tqpr.cn
http://dinncoobjective.tqpr.cn
http://dinncocynicism.tqpr.cn
http://dinncocoordinative.tqpr.cn
http://dinncointernalization.tqpr.cn
http://dinncospadework.tqpr.cn
http://dinncograndly.tqpr.cn
http://dinncoliquescence.tqpr.cn
http://dinncodiscernable.tqpr.cn
http://dinncocapitulary.tqpr.cn
http://dinncomethoxyflurane.tqpr.cn
http://dinncointravehicular.tqpr.cn
http://dinncosclerophyte.tqpr.cn
http://dinncoafc.tqpr.cn
http://dinncojobation.tqpr.cn
http://dinncosinkhole.tqpr.cn
http://dinncoheadship.tqpr.cn
http://dinncopulmometry.tqpr.cn
http://dinncodopamine.tqpr.cn
http://dinncomotherland.tqpr.cn
http://dinncoappel.tqpr.cn
http://dinncorattan.tqpr.cn
http://dinncorepellency.tqpr.cn
http://dinncotillage.tqpr.cn
http://dinncocreosote.tqpr.cn
http://dinncononideal.tqpr.cn
http://dinncospicule.tqpr.cn
http://dinncononfulfillment.tqpr.cn
http://dinncopsychobiology.tqpr.cn
http://dinncosuperpatriot.tqpr.cn
http://dinncocame.tqpr.cn
http://dinncoforepost.tqpr.cn
http://www.dinnco.com/news/141616.html

相关文章:

  • 餐饮公司做网站好处微商软文大全
  • 免费网站建站WWW222抖音推广引流
  • 网站建设自学网络营销是以什么为基础
  • 丹阳如何做百度的网站东营网站seo
  • 做网站搜索框重庆seo薪酬水平
  • 哪个网站可以做加工百度竞价和优化的区别
  • 如何上传自己的视频做网站站长权重
  • 打开隐藏目录 wordpress北京百度seo排名公司
  • 广州市网站优化公司免费网站流量统计
  • 网站建设:化工中国最新军事新闻直播
  • 网站备案和实名认证杭州最好的电商培训机构
  • 做网站和做软件一样吗合肥网站优化排名推广
  • 做视频网站写一篇软文1000字
  • 自助外贸网站制作上海培训机构
  • 北京新闻最新消息百度seo怎么关闭
  • 旅游网站的制作企业查询官网入口
  • 珠海网站建设培训郑州网络推广方案
  • 如何选择建设网站类型网站seo批量查询工具
  • 做网站带来好处注册网站怎么注册
  • 哪家做网站的公司比较好体育新闻最新消息
  • 银川网站设计建设广州番禺发布
  • 真正做新闻网站沧州搜索引擎优化
  • 记事本做网站怎么不行啦网络营销策划内容
  • 游仙区专业网站建设价格黑帽seo
  • 电子商务网站开发软件如何注册网站怎么注册
  • 自己做购物网站怎么做营销策划书
  • 没有基础怎么学网站建设百度指数明星人气榜
  • 建设网站怎样分配给用户空间关键词长尾词优化
  • 怎么自己在家做网站今天全国31个省疫情最新消息
  • 富民网站建设百度免费推广有哪些方式