首页 > 其他 > 详细

LWIP中的接收数据相关的函数详解(1)

时间:2016-01-20 09:49:12      阅读:1256      评论:0      收藏:0      [点我收藏+]

一、在main()函数中

1         /* check if any packet received */
2         if (ETH_CheckFrameReceived())
3         { 
4             /* process received ethernet packet */
5             LwIP_Pkt_Handle();
6         }

二、

 1 /**
 2   * @brief  Called when a frame is received
 3   * @param  None
 4   * @retval None
 5   */
 6 void LwIP_Pkt_Handle(void)
 7 {
 8   /* Read a received packet from the Ethernet buffers and send it to the lwIP for handling */
 9   ethernetif_input(&netif);
10 }

三、在函数ethernetif_input()主要完成两个工作

  1、调用low_level_input();得到实际的接收数据pbuf

  2、调用netif->input();

四、在LwIP_Init()中的调用netif_add(&netif, &ipaddr, &netmask, &gw, NULL, &ethernetif_init, &ethernet_input);

  可知,当执行到netif->input();时,函数ethernet_input()被调用;

五、ethernet_input()

  1、原型:err_t ethernet_input(struct pbuf *p, struct netif *netif)

  2、功能:处理接收到的网络数据帧;

       这个函数并没有直接调用ip_input;

       在并发访问时,ARP高速缓存被保护 

  3、实现

    -

LWIP中的接收数据相关的函数详解(1)

原文:http://www.cnblogs.com/Iamchritian--forthegloryofGod/p/5144006.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!