返回扫描结果

This commit is contained in:
zogodo
2019-09-29 21:54:54 +08:00
parent b457d576e4
commit d2eb6a3c7d
6 changed files with 65 additions and 9 deletions

View File

@@ -148,10 +148,22 @@ exit:
static int http_get_wifi_scan(httpd_request_t *req)
{
static int n = 1;
OSStatus err = kNoErr;
if (scaned)
{
scaned = false;
send_http(wifi_ret, strlen(wifi_ret), exit, &err);
}
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

@@ -43,7 +43,7 @@
*(P_ERR) = httpd_send_body(req->sock, (const unsigned char*)DATA, LEN); \
require_noerr_action(*(P_ERR), LABEL, app_httpd_log("ERROR: Unable to send http DATA body.")); \
#define TC1_STATUS_JSON \
#define TC1_STATUS_JSON \
"{\
'sockets':'%s',\
'mode':%d,\

View File

@@ -333,7 +333,8 @@ function Rescan() {
function GetScanResult() {
HttpGet("/wifi/scan", function (re) {
if (re == "OK") {
if (re != "NO") {
var ret = JSON.parse(re);
rescan_btn.innerHTML = "Rescan";
rescan_btn.disabled = false;
return;

File diff suppressed because one or more lines are too long