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


一、在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、实现

    -


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM