fix reference and types
This commit is contained in:
parent
5b1948df26
commit
f1e67a80d4
@ -7,10 +7,10 @@ namespace RcDecoder {
|
||||
struct RcSwitch {
|
||||
bool state;
|
||||
char group;
|
||||
char device;
|
||||
byte device;
|
||||
};
|
||||
|
||||
void decode(unsigned long value, RcSwitch decoded) {
|
||||
void decode(unsigned long value, RcSwitch& decoded) {
|
||||
value = value >> 2;
|
||||
unsigned long res = 0;
|
||||
for (int i = 0; i < 12; i++) {
|
||||
|
||||
@ -99,7 +99,7 @@ void readRcSwitch(JsonDocument& jsonDoc) {
|
||||
RcDecoder::RcSwitch decoded;
|
||||
RcDecoder::decode(value, decoded);
|
||||
rcSwitch["state"] = decoded.state;
|
||||
rcSwitch["group"] = decoded.group;
|
||||
rcSwitch["group"] = String(decoded.group, BIN);
|
||||
rcSwitch["channel"] = decoded.device;
|
||||
} else {
|
||||
rcSwitch["value"] = value;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user