also send counters for disabled channels in status
This commit is contained in:
parent
2a56adf3c5
commit
ad45dd6036
|
@ -144,14 +144,12 @@ bool GwChannel::canReceive(const char *buffer){
|
||||||
}
|
}
|
||||||
|
|
||||||
int GwChannel::getJsonSize(){
|
int GwChannel::getJsonSize(){
|
||||||
if (! enabled) return 0;
|
|
||||||
int rt=2;
|
int rt=2;
|
||||||
if (countIn) rt+=countIn->getJsonSize();
|
if (countIn) rt+=countIn->getJsonSize();
|
||||||
if (countOut) rt+=countOut->getJsonSize();
|
if (countOut) rt+=countOut->getJsonSize();
|
||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
void GwChannel::toJson(GwJsonDocument &doc){
|
void GwChannel::toJson(GwJsonDocument &doc){
|
||||||
if (! enabled) return;
|
|
||||||
if (countOut) countOut->toJson(doc);
|
if (countOut) countOut->toJson(doc);
|
||||||
if (countIn) countIn->toJson(doc);
|
if (countIn) countIn->toJson(doc);
|
||||||
}
|
}
|
||||||
|
@ -164,6 +162,8 @@ String GwChannel::toString(){
|
||||||
rt+=String("WF:") + (writeFilter?writeFilter->toString():"[]");
|
rt+=String("WF:") + (writeFilter?writeFilter->toString():"[]");
|
||||||
rt+=String(",")+ (toN2k?"n2k":"");
|
rt+=String(",")+ (toN2k?"n2k":"");
|
||||||
rt+=String(",")+ (seaSmartOut?"SM":"");
|
rt+=String(",")+ (seaSmartOut?"SM":"");
|
||||||
|
rt+=String(",")+(readActisense?"AR":"");
|
||||||
|
rt+=String(",")+(writeActisense?"AW":"");
|
||||||
return rt;
|
return rt;
|
||||||
}
|
}
|
||||||
void GwChannel::loop(bool handleRead, bool handleWrite){
|
void GwChannel::loop(bool handleRead, bool handleWrite){
|
||||||
|
|
|
@ -181,6 +181,10 @@ void GwChannelList::toJson(GwJsonDocument &doc){
|
||||||
doc["clientCon"]=client->isConnected();
|
doc["clientCon"]=client->isConnected();
|
||||||
doc["clientErr"]=client->getError();
|
doc["clientErr"]=client->getError();
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
doc["clientCon"]=false;
|
||||||
|
doc["clientErr"]="disabled";
|
||||||
|
}
|
||||||
allChannels([&](GwChannel *c){
|
allChannels([&](GwChannel *c){
|
||||||
c->toJson(doc);
|
c->toJson(doc);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue