mirror of
https://github.com/HEYAHONG/Air780EDemo.git
synced 2025-05-09 02:41:28 +08:00
完善mobile代码
This commit is contained in:
parent
bbea3863de
commit
2d61d73023
@ -51,6 +51,7 @@ extern "C"
|
|||||||
#include "luat_wdt.h"
|
#include "luat_wdt.h"
|
||||||
#include "luat_wifiscan.h"
|
#include "luat_wifiscan.h"
|
||||||
|
|
||||||
|
|
||||||
void main_task(void *param);
|
void main_task(void *param);
|
||||||
|
|
||||||
void main_task_sleep(uint32_t timeout_ms);
|
void main_task_sleep(uint32_t timeout_ms);
|
||||||
|
@ -89,10 +89,30 @@ public:
|
|||||||
luat_rtos_task_handle mobile::m_task_handle=NULL;
|
luat_rtos_task_handle mobile::m_task_handle=NULL;
|
||||||
luat_rtos_mutex_t mobile::m_lock=NULL;
|
luat_rtos_mutex_t mobile::m_lock=NULL;
|
||||||
|
|
||||||
|
extern "C" void luat_socket_check_ready(uint32_t param, uint8_t *is_ipv6);
|
||||||
void mobile::process_callback(luat_mobile_event_callback_data_t &data)
|
void mobile::process_callback(luat_mobile_event_callback_data_t &data)
|
||||||
{
|
{
|
||||||
//此处处理事件(注意:开机时的事件可能会丢失)
|
//此处处理事件(注意:开机时的事件可能会丢失)
|
||||||
main_debug_print("mobile_event:%d,%d,%d\r\n",(int)data.event,(int)data.index,(int)data.status);
|
main_debug_print("mobile_event:%d,%d,%d\r\n",(int)data.event,(int)data.index,(int)data.status);
|
||||||
|
{
|
||||||
|
LUAT_MOBILE_EVENT event=data.event;
|
||||||
|
uint8_t index=data.index;
|
||||||
|
uint8_t status=data.status;
|
||||||
|
if (LUAT_MOBILE_EVENT_NETIF == event)
|
||||||
|
{
|
||||||
|
if (LUAT_MOBILE_NETIF_LINK_ON == status)
|
||||||
|
{
|
||||||
|
//已联网
|
||||||
|
luat_socket_check_ready(index, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//已断网
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
if(!heventchain_start(event_chain,&data))
|
if(!heventchain_start(event_chain,&data))
|
||||||
{
|
{
|
||||||
LUAT_MOBILE_EVENT event=data.event;
|
LUAT_MOBILE_EVENT event=data.event;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user