mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 13:08:13 +08:00
返回扫描结果
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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,\
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user