Add support for RTW protocols #38

This commit is contained in:
Robert Strouse 2023-05-12 18:17:57 -07:00
parent ac6d6ee34d
commit 65e4caf3b2
10 changed files with 106 additions and 34 deletions

View file

@ -469,12 +469,14 @@ void Web::begin() {
});
server.on("/getNextShade", []() {
webServer.sendCORSHeaders();
StaticJsonDocument<128> doc;
StaticJsonDocument<256> doc;
uint8_t shadeId = somfy.getNextShadeId();
JsonObject obj = doc.to<JsonObject>();
obj["shadeId"] = shadeId;
obj["remoteAddress"] = somfy.getNextRemoteAddress(shadeId);
obj["bitLength"] = somfy.transceiver.config.type;
obj["stepSize"] = 100;
obj["proto"] = static_cast<uint8_t>(somfy.transceiver.config.proto);
serializeJson(doc, g_content);
server.send(200, _encoding_json, g_content);
});