From 6929f3b0d6a0375d0235789c815d6a131305cb15 Mon Sep 17 00:00:00 2001 From: xshuqun Date: Tue, 12 Sep 2023 10:56:11 +0800 Subject: [PATCH] [wifi] fix onnetwork not working * change definition in SHA:b29ab15276a98cdf2cfb053eebfebc4b20ebf54b from #if CHIP_PROJECT to #ifdef CHIP_PROJECT to trigger UpdateInternetConnectivityState() for onnetwork --- component/common/api/lwip_netconf.c | 6 +++--- component/common/api/wifi/wifi_conf.c | 6 +++--- .../common/drivers/wlan/realtek/include/wifi_constants.h | 2 +- component/common/network/lwip/lwip_v2.1.2/src/core/netif.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/component/common/api/lwip_netconf.c b/component/common/api/lwip_netconf.c index a22a6be1..ded91e76 100644 --- a/component/common/api/lwip_netconf.c +++ b/component/common/api/lwip_netconf.c @@ -598,8 +598,8 @@ uint8_t LwIP_DHCP6(uint8_t idx, uint8_t dhcp6_state) /*Todo: error_flag for DHCPv6*/ -#if CHIP_PROJECT - wifi_indication(WIFI_EVENT_DHCP6_DONE, NULL, 0, 0); +#ifdef CHIP_PROJECT + wifi_indication(WIFI_EVENT_DHCP6_DONE, NULL, 0, 0); #endif return DHCP6_ADDRESS_ASSIGNED; } @@ -619,7 +619,7 @@ uint8_t LwIP_DHCP6(uint8_t idx, uint8_t dhcp6_state) if(idx == NET_IF_NUM -1) // This is the ethernet interface, set it up for static ip address netif_set_up(pnetif); #endif -#if CHIP_PROJECT +#ifdef CHIP_PROJECT wifi_indication(WIFI_EVENT_DHCP6_DONE, NULL, 0, 0); #endif return DHCP6_TIMEOUT; diff --git a/component/common/api/wifi/wifi_conf.c b/component/common/api/wifi/wifi_conf.c index 9b1dbbd4..56f86f30 100644 --- a/component/common/api/wifi/wifi_conf.c +++ b/component/common/api/wifi/wifi_conf.c @@ -189,7 +189,7 @@ extern int rltk_set_mode_posthandle(rtw_mode_t curr_mode, rtw_mode_t next_mode, #ifdef CONFIG_PMKSA_CACHING extern int wifi_set_pmk_cache_enable(unsigned char value); #endif -#if CHIP_PROJECT +#ifdef CHIP_PROJECT extern u8 matter_wifi_trigger; extern void matter_wifi_autoreconnect_hdl(rtw_security_t security_type, char *ssid, int ssid_len, char *password, int password_len, int key_id); #endif @@ -694,7 +694,7 @@ static void wifi_disconn_hdl( char* buf, int buf_len, int flags, void* userdata) } #endif -#if CHIP_PROJECT +#ifdef CHIP_PROJECT if(matter_wifi_trigger) { join_user_data = NULL; @@ -3365,7 +3365,7 @@ int wifi_config_autoreconnect(__u8 mode, __u8 retry_times, __u16 timeout) { if(mode == RTW_AUTORECONNECT_DISABLE) p_wlan_autoreconnect_hdl = NULL; -#if CHIP_PROJECT +#ifdef CHIP_PROJECT else if (matter_wifi_trigger) p_wlan_autoreconnect_hdl = matter_wifi_autoreconnect_hdl; #endif diff --git a/component/common/drivers/wlan/realtek/include/wifi_constants.h b/component/common/drivers/wlan/realtek/include/wifi_constants.h index 82f8483b..24b41ad5 100644 --- a/component/common/drivers/wlan/realtek/include/wifi_constants.h +++ b/component/common/drivers/wlan/realtek/include/wifi_constants.h @@ -626,7 +626,7 @@ enum _WIFI_EVENT_INDICATE{ WIFI_EVENT_TARGET_SSID_RSSI = 26, WIFI_EVENT_DHCP_RENEW = 27, WIFI_EVENT_SWITCH_CHANNE = 28, -#if CHIP_PROJECT +#ifdef CHIP_PROJECT WIFI_EVENT_DHCP6_DONE = 29, #endif WIFI_EVENT_MAX, diff --git a/component/common/network/lwip/lwip_v2.1.2/src/core/netif.c b/component/common/network/lwip/lwip_v2.1.2/src/core/netif.c index d728b82d..f998ab60 100644 --- a/component/common/network/lwip/lwip_v2.1.2/src/core/netif.c +++ b/component/common/network/lwip/lwip_v2.1.2/src/core/netif.c @@ -1513,7 +1513,7 @@ netif_create_ip6_linklocal_address(struct netif *netif, u8_t from_mac_48bit) LWIP_ASSERT("netif_create_ip6_linklocal_address: invalid netif", netif != NULL); -#if CHIP_PROJECT +#ifdef CHIP_PROJECT /*Realtek Added Start*/ if(ip6_addr_isvalid(netif_ip6_addr_state(netif, 0))){ printf("IPv6 Linklocal address already exist\n");