mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-24 23:07:17 +00:00
Cleanup JSON message
This commit is contained in:
parent
4037184ee0
commit
e327c6194f
@ -129,8 +129,8 @@ void CmndWifiScan(void)
|
||||
char stemp1[20];
|
||||
ResponseAppend_P(PSTR("{"));
|
||||
for (uint32_t i = 0; i < WiFi.scanComplete(); i++) {
|
||||
ResponseAppend_P(PSTR("\"" D_STATUS5_NETWORK "%d\":{\"" D_SSID "\":\"%s\", \"" D_BSSID "\":\"%s\", \"" D_CHANNEL
|
||||
"\":\"%d\", \"" D_JSON_SIGNAL "\":\"%d\", \"" D_RSSI "\":\"%d\", \"" D_JSON_ENCRYPTION "\":\"%s\"}"),
|
||||
ResponseAppend_P(PSTR("\"" D_STATUS5_NETWORK "%d\":{\"" D_SSID "\":\"%s\",\"" D_BSSID "\":\"%s\",\"" D_CHANNEL
|
||||
"\":\"%d\",\"" D_JSON_SIGNAL "\":\"%d\",\"" D_RSSI "\":\"%d\",\"" D_JSON_ENCRYPTION "\":\"%s\"}"),
|
||||
i+1,
|
||||
WiFi.SSID(indexes[i]).c_str(),
|
||||
WiFi.BSSIDstr(indexes[i]).c_str(),
|
||||
@ -139,7 +139,7 @@ void CmndWifiScan(void)
|
||||
WifiGetRssiAsQuality(WiFi.RSSI(indexes[i])),
|
||||
GetTextIndexed(stemp1, sizeof(stemp1), WiFi.encryptionType(indexes[i]), kWifiEncryptionTypes));
|
||||
if ( ResponseSize() < ResponseLength() + 300 ) { break; }
|
||||
if ( i < WiFi.scanComplete() -1 ) { ResponseAppend_P(PSTR(", ")); }
|
||||
if ( i < WiFi.scanComplete() -1 ) { ResponseAppend_P(PSTR(",")); }
|
||||
//AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_WIFI "MAX SIZE: %d, SIZE: %d"),ResponseSize(),ResponseLength());
|
||||
}
|
||||
ResponseJsonEnd();
|
||||
|
@ -358,7 +358,7 @@ void WifiBeginAfterScan(void)
|
||||
Wifi.scan_state++;
|
||||
|
||||
ResponseClear();
|
||||
|
||||
|
||||
uint32_t initial_item = (Wifi.scan_state - 9)*10;
|
||||
|
||||
if ( wifi_scan_result > initial_item ) {
|
||||
@ -380,8 +380,8 @@ void WifiBeginAfterScan(void)
|
||||
char stemp1[20];
|
||||
uint32_t end_item = ( wifi_scan_result > initial_item + 10 ) ? initial_item + 10 : wifi_scan_result;
|
||||
for (uint32_t i = initial_item; i < end_item; i++) {
|
||||
Response_P(PSTR("{\"" D_CMND_WIFISCAN "\":{\"" D_STATUS5_NETWORK "%d\":{\"" D_SSID "\":\"%s\", \"" D_BSSID "\":\"%s\", \"" D_CHANNEL
|
||||
"\":\"%d\", \"" D_JSON_SIGNAL "\":\"%d\", \"" D_RSSI "\":\"%d\", \"" D_JSON_ENCRYPTION "\":\"%s\"}}}"),
|
||||
Response_P(PSTR("{\"" D_CMND_WIFISCAN "\":{\"" D_STATUS5_NETWORK "%d\":{\"" D_SSID "\":\"%s\",\"" D_BSSID "\":\"%s\",\"" D_CHANNEL
|
||||
"\":\"%d\",\"" D_JSON_SIGNAL "\":\"%d\",\"" D_RSSI "\":\"%d\",\"" D_JSON_ENCRYPTION "\":\"%s\"}}}"),
|
||||
i+1,
|
||||
WiFi.SSID(indexes[i]).c_str(),
|
||||
WiFi.BSSIDstr(indexes[i]).c_str(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user