v1.6.6: Set MCP as default IoT Protocol (#690)

This commit is contained in:
Xiaoxia
2025-05-27 14:58:49 +08:00
committed by GitHub
parent 0c83263762
commit d80f94387a
46 changed files with 524 additions and 428 deletions

View File

@@ -203,6 +203,9 @@ std::string WifiBoard::GetDeviceStatusJson() {
* "type": "wifi",
* "ssid": "Xiaozhi",
* "rssi": -60
* },
* "chip": {
* "temperature": 25
* }
* }
*/
@@ -255,6 +258,14 @@ std::string WifiBoard::GetDeviceStatusJson() {
}
cJSON_AddItemToObject(root, "network", network);
// Chip
float esp32temp = 0.0f;
if (board.GetTemperature(esp32temp)) {
auto chip = cJSON_CreateObject();
cJSON_AddNumberToObject(chip, "temperature", esp32temp);
cJSON_AddItemToObject(root, "chip", chip);
}
auto json_str = cJSON_PrintUnformatted(root);
std::string json(json_str);
cJSON_free(json_str);