mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-13 05:28:14 +08:00
不显示隐藏wifi
This commit is contained in:
@@ -311,7 +311,7 @@ void mqtt_client_thread(mico_thread_arg_t arg)
|
|||||||
micoWlanGetLinkStatus(&LinkStatus);
|
micoWlanGetLinkStatus(&LinkStatus);
|
||||||
if (LinkStatus.is_connected != 1)
|
if (LinkStatus.is_connected != 1)
|
||||||
{
|
{
|
||||||
mqtt_log("ERROR:WIFI not connection , waiting 3s for connecting and then connecting MQTT ");
|
mqtt_log("ERROR:WIFI not connect, waiting 3s for connecting and then connecting MQTT ");
|
||||||
mico_rtos_thread_sleep(3);
|
mico_rtos_thread_sleep(3);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,8 +81,13 @@ void WifiScanCallback(ScanResult_adv* scan_ret, void* arg)
|
|||||||
char* tmp2 = secs;
|
char* tmp2 = secs;
|
||||||
for (; i < count; i++)
|
for (; i < count; i++)
|
||||||
{
|
{
|
||||||
|
ApInfo* ap = (ApInfo*)&scan_ret->ApList[i];
|
||||||
|
uint8_t* mac = (uint8_t*)ap->bssid;
|
||||||
|
os_log("wifi_scan_callback ssid[%16s] bssid[%02X-%02X-%02X-%02X-%02X-%02X] security[%d]",
|
||||||
|
ap->ssid, mac[0], mac[1], mac[2], mac[3], mac[4], mac[5], ap->security);
|
||||||
char* ssid = scan_ret->ApList[i].ssid;
|
char* ssid = scan_ret->ApList[i].ssid;
|
||||||
if (strstr(ssid, "'") || strstr(ssid, "\"")) continue;
|
//排除隐藏的wifi和SSID带'或"的我wifi
|
||||||
|
if (!ssid || strstr(ssid, "'") || strstr(ssid, "\"")) continue;
|
||||||
sprintf(tmp1, "'%s',", ssid);
|
sprintf(tmp1, "'%s',", ssid);
|
||||||
tmp1 += (strlen(ssid) + 3);
|
tmp1 += (strlen(ssid) + 3);
|
||||||
sprintf(tmp2, "%d,", scan_ret->ApList[i].security%10);
|
sprintf(tmp2, "%d,", scan_ret->ApList[i].security%10);
|
||||||
|
|||||||
@@ -32,6 +32,14 @@ typedef struct {
|
|||||||
char mask[16];
|
char mask[16];
|
||||||
} IpStatus;
|
} IpStatus;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
char ssid[32];
|
||||||
|
char bssid[6];
|
||||||
|
char channel;
|
||||||
|
wlan_sec_type_t security;
|
||||||
|
int16_t rssi;
|
||||||
|
} ApInfo;
|
||||||
|
|
||||||
extern IpStatus ip_status;
|
extern IpStatus ip_status;
|
||||||
|
|
||||||
extern void WifiInit(void);
|
extern void WifiInit(void);
|
||||||
|
|||||||
Reference in New Issue
Block a user