From cde1aba5611679e63bb939855c96edc293da2e58 Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Tue, 29 Jan 2019 16:49:49 +0300 Subject: [PATCH] partial sending of rfbridge codes --- code/espurna/rfbridge.ino | 19 ++++++++++++++----- code/html/custom.js | 3 ++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/code/espurna/rfbridge.ino b/code/espurna/rfbridge.ino index 6060aca7..fa8ff560 100644 --- a/code/espurna/rfbridge.ino +++ b/code/espurna/rfbridge.ino @@ -88,17 +88,18 @@ static bool _rfbToChar(byte * in, char * out, int n = RF_MESSAGE_SIZE) { #if WEB_SUPPORT -void _rfbWebSocketSendCodes() { +void _rfbWebSocketSendCodeArray(unsigned char start, unsigned char size) { DynamicJsonBuffer jsonBuffer; JsonObject& root = jsonBuffer.createObject(); - JsonObject& rfb = root.createObject("rfb"); - rfb["size"] = relayCount(); + JsonObject& rfb = root.createNestedObject("rfb"); + rfb["size"] = size; + rfb["start"] = start; JsonArray& on = rfb.createNestedArray("on"); JsonArray& off = rfb.createNestedArray("off"); - for (byte id=0; id