diff --git a/components/network/lwip/bouffalo.mk b/components/network/lwip/bouffalo.mk index c5608cabb..f631bb376 100644 --- a/components/network/lwip/bouffalo.mk +++ b/components/network/lwip/bouffalo.mk @@ -24,7 +24,7 @@ COMPONENT_PRIV_INCLUDEDIRS := src/apps/altcp_tls #COMPONENT_SRCS := #COMPONENT_OBJS := $(patsubst %.c,%.o, $(COMPONENT_SRCS)) -COMPONENT_SRCDIRS := src/api src/core src/core/ipv4 src/netif lwip-port/FreeRTOS lwip-port src/apps/altcp_tls src/apps/mqtt +COMPONENT_SRCDIRS := src/api src/core src/core/ipv4 src/netif lwip-port/FreeRTOS lwip-port src/apps/altcp_tls src/apps/mqtt src/apps/mdns ifeq ($(CONFIG_COMPONENT_BUGKILLER_ENABLE),1) COMPONENT_ADD_INCLUDEDIRS += bugkiller/include diff --git a/components/network/wifi_manager/bl60x_wifi_driver/include/wifi_mgmr_ext.h b/components/network/wifi_manager/bl60x_wifi_driver/include/wifi_mgmr_ext.h index 6f9ce729d..bc405bc0a 100644 --- a/components/network/wifi_manager/bl60x_wifi_driver/include/wifi_mgmr_ext.h +++ b/components/network/wifi_manager/bl60x_wifi_driver/include/wifi_mgmr_ext.h @@ -320,6 +320,8 @@ int wifi_mgmr_bcnind_cipher_to_ext(int cipher); struct sm_connect_tlv_desc* wifi_mgmr_diagnose_tlv_get_ele(void); void wifi_mgmr_diagnose_tlv_free_ele(struct sm_connect_tlv_desc* ele); +void wifi_mgmr_set_hostname(char *hostname); + #if defined(__cplusplus) } #endif diff --git a/components/network/wifi_manager/bl60x_wifi_driver/wifi_mgmr_ext.c b/components/network/wifi_manager/bl60x_wifi_driver/wifi_mgmr_ext.c index 7f3019375..cee0a84cb 100644 --- a/components/network/wifi_manager/bl60x_wifi_driver/wifi_mgmr_ext.c +++ b/components/network/wifi_manager/bl60x_wifi_driver/wifi_mgmr_ext.c @@ -919,16 +919,14 @@ int wifi_mgmr_scan_ap(char *ssid, wifi_mgmr_ap_item_t *item) for (i = 0; i < sizeof(wifiMgmr.scan_items)/sizeof(wifiMgmr.scan_items[0]); i++) { if (wifiMgmr.scan_items[i].is_used && (!wifi_mgmr_scan_item_is_timeout(&wifiMgmr, &(wifiMgmr.scan_items[i]))) && 0 == strcmp(wifiMgmr.scan_items[i].ssid, ssid)) { - /*found the ssid*/ - index = i; if (wifiMgmr.scan_items[i].rssi > rssi) { - /*found ap with better rssi*/ + /*found ap with better rssi - select it*/ rssi = wifiMgmr.scan_items[i].rssi; + index = i; } - break; } } - if ((sizeof(wifiMgmr.scan_items)/sizeof(wifiMgmr.scan_items[0]) != i) && (index >= 0)) { + if (index >= 0) { /*proper item found, copy back data now*/ //TODO FIXME we should scan the ap from the cache within the Wi-Fi manager thread scan = &wifiMgmr.scan_items[index]; @@ -1159,3 +1157,8 @@ void wifi_mgmr_diagnose_tlv_free_ele(struct sm_connect_tlv_desc *ele) bl_os_free(ele); } + +void wifi_mgmr_set_hostname(char *hostname) { + snprintf(wifiMgmr.hostname, sizeof(wifiMgmr.hostname), "%s", hostname); + wifiMgmr.hostname[sizeof(wifiMgmr.hostname) - 1] = '\0'; +}