更新Wi-Fi组件版本,从OTA接口读取Websocket服务器

This commit is contained in:
Terrence
2025-04-21 15:12:52 +08:00
parent c380617cca
commit 3404180a77
15 changed files with 67 additions and 58 deletions

View File

@@ -114,14 +114,13 @@ Http* WifiBoard::CreateHttp() {
}
WebSocket* WifiBoard::CreateWebSocket() {
#ifdef CONFIG_CONNECTION_TYPE_WEBSOCKET
std::string url = CONFIG_WEBSOCKET_URL;
Settings settings("websocket", false);
std::string url = settings.GetString("url");
if (url.find("wss://") == 0) {
return new WebSocket(new TlsTransport());
} else {
return new WebSocket(new TcpTransport());
}
#endif
return nullptr;
}