码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2016-01-20 09:49:53      阅读:499      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!