lwip基础
LWIP是一个轻量级的TCP/IP协议栈,其全称为Lightweight IP,它专门为小型嵌入式系统设计,具有占用资源少、易于移植、可裁剪性高等特点。
一、lwip打印状态信息
配置相关宏
include/lwipopts.h /* ---------- Statistics options ---------- */ #define LWIP_STATS 1 #if LWIP_STATS #define LWIP_STATS_DISPLAY 1 #define LINK_STATS 0 #define ETHARP_STATS 0 #define IP_STATS 0 #define ICMP_STATS 0 #define IGMP_STATS 0 #define IPFRAG_STATS 0 #define UDP_STATS 0 #define TCP_STATS 0 #define MEM_STATS 1 #define MEMP_STATS 1 #define PBUF_STATS 0 #define SYS_STATS 0 #endif /* LWIP_STATS */
周期性调用函数打印信息
stats_display();
参考:
1. LWIP基础