From 2d61d730237d89c4235decb31d59119ed153f293 Mon Sep 17 00:00:00 2001 From: HEYAHONG <2229388563@qq.com> Date: Tue, 26 Dec 2023 09:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84mobile=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.h | 1 + app/mobile.cpp | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/app/main.h b/app/main.h index 62e15c4..b4d64ce 100644 --- a/app/main.h +++ b/app/main.h @@ -51,6 +51,7 @@ extern "C" #include "luat_wdt.h" #include "luat_wifiscan.h" + void main_task(void *param); void main_task_sleep(uint32_t timeout_ms); diff --git a/app/mobile.cpp b/app/mobile.cpp index 2aa5e5c..d49a85d 100644 --- a/app/mobile.cpp +++ b/app/mobile.cpp @@ -89,10 +89,30 @@ public: luat_rtos_task_handle mobile::m_task_handle=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) { //此处处理事件(注意:开机时的事件可能会丢失) 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)) { LUAT_MOBILE_EVENT event=data.event;