TI中文支持网
TI专业的中文技术问题搜集分享网站

CC3200 的SL_NETAPP_IP_RELEASED_EVENT事件怎么被触发

Other Parts Discussed in Thread:CC3200

CC3200 的SL_NETAPP_IP_RELEASED_EVENT事件怎么被触发

Kevin Qiu1:

SL_NETAPP_IP_RELEASED_EVENT – Notifies STA IP release; relevant in AP or P2P GO mode.
Event parameters:
• ip_address
• mac
• reason
当断开sta连接事件发生后就会触发,具体看你在程序中如何使用

,

HUGH HUGH:

CC3200 作为AP时客户端主动断开连接为什么不会触发这个事件

,

Kevin Qiu1:

在AP模式中,触发的是SL_NETAPP_IP_LEASED_EVENT事件,程序顺序执行,所以没有触发
void SimpleLinkNetAppEventHandler(SlNetAppEvent_t *pNetAppEvent)
{switch(pNetAppEvent->Event){case SL_NETAPP_IPV4_IPACQUIRED_EVENT:case SL_NETAPP_IPV6_IPACQUIRED_EVENT:{SET_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_AQUIRED);}break;case SL_NETAPP_IP_LEASED_EVENT:{SET_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_LEASED);g_ulStaIp = (pNetAppEvent)->EventData.ipLeased.ip_address;UART_PRINT("[NETAPP EVENT] IP Leased to Client: IP=%d.%d.%d.%d , ",SL_IPV4_BYTE(g_ulStaIp,3), SL_IPV4_BYTE(g_ulStaIp,2),SL_IPV4_BYTE(g_ulStaIp,1), SL_IPV4_BYTE(g_ulStaIp,0));}break;case SL_NETAPP_IP_RELEASED_EVENT:{CLR_STATUS_BIT(g_ulStatus, STATUS_BIT_IP_LEASED);UART_PRINT("[NETAPP EVENT] IP Released for Client: IP=%d.%d.%d.%d , ",SL_IPV4_BYTE(g_ulStaIp,3), SL_IPV4_BYTE(g_ulStaIp,2),SL_IPV4_BYTE(g_ulStaIp,1), SL_IPV4_BYTE(g_ulStaIp,0));}break;default:{UART_PRINT("[NETAPP EVENT] Unexpected event [0x%x] \n\r",pNetAppEvent->Event);}break;}
}



,

Kevin Qiu1:

触发有以下三个原因:

peer released the IP address

peer declined to this IP address

Lease time was expired

赞(0)
未经允许不得转载:TI中文支持网 » CC3200 的SL_NETAPP_IP_RELEASED_EVENT事件怎么被触发
分享到: 更多 (0)