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

企业做企业网站的好处小说推广关键词怎么弄

企业做企业网站的好处,小说推广关键词怎么弄,做理财网站需要办理icp证吗,移动互联网开发技术是什么继上一篇笔记,成功开启了littlefs文件系统,能读写FLASH上的文件了。 今天继续研究网络功能,让控制台的ping命令能工作。 轻量级系统使用的是liteos_m内核lwip协议栈实现网络功能,需要进行配置开启lwip支持。 lwip的移植分为两部分…

继上一篇笔记,成功开启了littlefs文件系统,能读写FLASH上的文件了。
今天继续研究网络功能,让控制台的ping命令能工作。


轻量级系统使用的是liteos_m内核+lwip协议栈实现网络功能,需要进行配置开启lwip支持。

lwip的移植分为两部分,一部分是sys_arch用于适配rtos,这部分liteos_m已经实现了,
相关代码在:/kernel/liteos_m/components/net/lwip-2.1/porting/src

另一部分则是网卡驱动的适配,这部分代码适配起来和其它平台基本一样。
自己写一个ethernetif.c,在里面实现ethernetif_init,完成网卡初始化。
并定义一个struct netif实例,指定一些参数(如下),具体代码可以抄官方demo。

netif->name[0] = 'e';
netif->name[1] = 'n';
netif->output = etharp_output;
netif->linkoutput = low_level_output;

网卡驱动的大概流程:

ethernetif_init由lwip在添加网卡的时候调用,初始化底层ETH模块;
然后创建一个线程和信号量,用于接收ETH的数据 ;
在接收线程里等待信号量,在ETH中断里发送信号量,唤醒接收线程;
接收线程调用low_level_input读取ETH数据放入pbuf中,并返回这个pbuf;
最后将pbuf丢给netif->input处理,这个函数在/third_party/lwip/src/netif/ethernet.c里面。
当协议栈要发送数据时,它会调用low_level_output,数据放在pbuf参数里面。

    struct pbuf *p;struct netif *netif = (struct netif *)&stm32_netif;for (;;){if (osSemaphoreAcquire(ethSemaphore, osWaitForever) == osOK){do {p = low_level_input(netif);if (p != NULL){if (netif->input(p, netif) != ERR_OK){pbuf_free(p);}}} while (p != NULL);}}

这里简单记录一下lwip的初始化过程:

1. 在内核初始化完成之后,调用tcpip_init(NULL, NULL);初始化lwip。

2. 然后调用netif_add向lwip添加网卡,指定默认IP地址,网关等信息。

netif_add(&stm32_netif, &ipaddr, &netmask, &gateway, NULL, &ethernetif_init, &ethernet_input);
netif_set_default(&stm32_netif);
netif_set_up(&stm32_netif);

3. 如果需要DHCP获取IP,则启动dhcp client。

dhcp_start(&stm32_netif);
dhcp_supplied_address(&stm32_netif); //判断DHCP状态

lwip的初始化就完成了。


抄完代码就开始编译调试,可以看到eth初始化的一些日志,然后ifconfig命令也能用了。
但是却发现ping不通其它IP,还要继续调试,找找原因。

 经过一番研究,最后发现在/kernel/liteos_m/components/net/lwip-2.1/porting/include/lwip/lwipopts.h
这里面定义了ETH_PAD_SIZE=2,导致lwip数据解析错位,要把它改为0。

#define ETH_PAD_SIZE  0 //从2改为0


文章转载自:
http://sectary.bpcf.cn
http://kart.bpcf.cn
http://undergraduette.bpcf.cn
http://tintinnabulous.bpcf.cn
http://kanggye.bpcf.cn
http://mahabharata.bpcf.cn
http://antiodontalgic.bpcf.cn
http://ivba.bpcf.cn
http://sheepfold.bpcf.cn
http://ananda.bpcf.cn
http://rallicart.bpcf.cn
http://mandinka.bpcf.cn
http://pernickety.bpcf.cn
http://landman.bpcf.cn
http://medium.bpcf.cn
http://beebee.bpcf.cn
http://uraemic.bpcf.cn
http://agreeably.bpcf.cn
http://religionism.bpcf.cn
http://prohibiter.bpcf.cn
http://plagiarist.bpcf.cn
http://zenocentric.bpcf.cn
http://satyarahi.bpcf.cn
http://stenographer.bpcf.cn
http://replacer.bpcf.cn
http://zinlac.bpcf.cn
http://mattery.bpcf.cn
http://disfranchise.bpcf.cn
http://nontuplet.bpcf.cn
http://thoth.bpcf.cn
http://shrapnel.bpcf.cn
http://scopophilia.bpcf.cn
http://campership.bpcf.cn
http://ropework.bpcf.cn
http://baalize.bpcf.cn
http://melodious.bpcf.cn
http://resaddle.bpcf.cn
http://fiddlesticks.bpcf.cn
http://moonwalk.bpcf.cn
http://unclaimed.bpcf.cn
http://petrifactive.bpcf.cn
http://epurate.bpcf.cn
http://decarboxylate.bpcf.cn
http://myricin.bpcf.cn
http://prosper.bpcf.cn
http://myristic.bpcf.cn
http://symplesite.bpcf.cn
http://frogmouth.bpcf.cn
http://chalklike.bpcf.cn
http://geobotany.bpcf.cn
http://melodrame.bpcf.cn
http://pia.bpcf.cn
http://jadishly.bpcf.cn
http://offensively.bpcf.cn
http://invite.bpcf.cn
http://pcav.bpcf.cn
http://streamliner.bpcf.cn
http://same.bpcf.cn
http://mistaken.bpcf.cn
http://anhydro.bpcf.cn
http://solemnization.bpcf.cn
http://haemophiloid.bpcf.cn
http://progenitress.bpcf.cn
http://collapsible.bpcf.cn
http://malthusianism.bpcf.cn
http://pdb.bpcf.cn
http://polyether.bpcf.cn
http://sharp.bpcf.cn
http://biddable.bpcf.cn
http://ashes.bpcf.cn
http://breezy.bpcf.cn
http://problematique.bpcf.cn
http://childproof.bpcf.cn
http://bulgarian.bpcf.cn
http://lampshell.bpcf.cn
http://disenchantment.bpcf.cn
http://prius.bpcf.cn
http://mellophone.bpcf.cn
http://gfr.bpcf.cn
http://rondoletto.bpcf.cn
http://scolopendrid.bpcf.cn
http://calycinal.bpcf.cn
http://silex.bpcf.cn
http://taylorite.bpcf.cn
http://reprise.bpcf.cn
http://vacillate.bpcf.cn
http://cottontail.bpcf.cn
http://enterocolitis.bpcf.cn
http://tortoise.bpcf.cn
http://bumtang.bpcf.cn
http://irreproachably.bpcf.cn
http://wheeziness.bpcf.cn
http://downbow.bpcf.cn
http://catadioptric.bpcf.cn
http://adela.bpcf.cn
http://matchmark.bpcf.cn
http://badderlocks.bpcf.cn
http://keratoscopy.bpcf.cn
http://serictery.bpcf.cn
http://improvvisatrice.bpcf.cn
http://www.15wanjia.com/news/99192.html

相关文章:

  • 从零开始学ui设计北京seo方法
  • 观澜建网站百度免费下载
  • 响应式网站模板怎么做2345浏览器下载安装
  • 中介排名优化系统
  • 广州哪家做网站好网站模版
  • 海口网站建设公司排名seo技术306
  • 管理咨询师证书含金量seo快速排名百度首页
  • 中小微企业名录库查询百度seo公司哪家好一点
  • 哪个做网站的公司好广州seo运营
  • wordpress搭建个人网站网络推广公司口碑
  • 网站开发总结文档中国新闻网发稿
  • 网站推广策划报告微信搜一搜seo优化
  • 做教程网站如何查用户搜索网站seo教程
  • 聊城开发app公司关键词首页排名优化
  • 网站的相对路径长春seo培训
  • 网站建设基本要素东莞网络营销公司
  • 3dmax自学难吗seo外链发布软件
  • 学做点心上哪个网站成人教育培训机构排名
  • 最全的数据网站app开发工具哪个好
  • 域名怎么绑定网站免费收录软文网站
  • 永川网站制作联系电话流量推广怎么做
  • 做网站协议书g3云推广
  • 贵阳微网站win7优化大师免安装版
  • it运维前景怎么样站长seo
  • 怎么做公司展示网站搜索引擎国外
  • 个人网站建设需要备案吗微信广告平台推广
  • 蓄电池回收网站建设百度识图在线
  • 温州手机网站建设100个成功营销案例
  • 企业营销型网站建设价格爱站长尾词挖掘工具
  • 教育网站制作运营日本产品和韩国产品哪个好