get scan OK

This commit is contained in:
zogodo
2019-09-29 21:58:53 +08:00
parent d2eb6a3c7d
commit dee3dea139
3 changed files with 2 additions and 15 deletions

View File

@@ -153,17 +153,13 @@ static int http_get_wifi_scan(httpd_request_t *req)
{
scaned = false;
send_http(wifi_ret, strlen(wifi_ret), exit, &err);
free(wifi_ret);
}
else
{
send_http("NO", 2, exit, &err);
}
/*
static int n = 1;
char* re = (n++)%4 == 0 ? "OK" : "NO";
send_http(re, 2, exit, &err);
*/
exit:
return err;
}

View File

@@ -102,6 +102,7 @@ void wifi_scan_callback(ScanResult_adv* scan_ret, void* arg)
scaned = true;
free(ssids);
free(secs);
}

View File

@@ -13,22 +13,12 @@ enum
WIFI_STATE_CONNECTED,
};
/*
typedef struct _WifiResult
{
char ssid[32];
wlan_sec_type_t security;
}
WifiResult;
*/
#define WIFI_SCAN_RESULT_JSON "{'success':%d,'ssids':[%s],'secs':[%s]}"
extern char* wifi_ret;
extern char wifi_status;
extern bool scaned;
//extern WifiResult* wifi_rets;
extern void wifi_init(void);
extern void ap_init(void);