mirror of
https://github.com/thooge/esp32-nmea2000-obp60.git
synced 2025-12-16 07:23:07 +01:00
add status to Api
This commit is contained in:
@@ -190,4 +190,27 @@ GwChannel *GwChannelList::getChannelById(int sourceId){
|
||||
if ((*it)->isOwnSource(sourceId)) return *it;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void GwChannelList::fillStatus(GwApi::Status &status){
|
||||
GwChannel *channel=getChannelById(USB_CHANNEL_ID);
|
||||
if (channel){
|
||||
status.usbRx=channel->countRx();
|
||||
status.usbTx=channel->countTx();
|
||||
}
|
||||
channel=getChannelById(SERIAL1_CHANNEL_ID);
|
||||
if (channel){
|
||||
status.serRx=channel->countRx();
|
||||
status.serTx=channel->countTx();
|
||||
}
|
||||
channel=getChannelById(MIN_TCP_CHANNEL_ID);
|
||||
if (channel){
|
||||
status.tcpSerRx=channel->countRx();
|
||||
status.tcpSerTx=channel->countTx();
|
||||
}
|
||||
channel=getChannelById(TCP_CLIENT_CHANNEL_ID);
|
||||
if (channel){
|
||||
status.tcpClRx=channel->countRx();
|
||||
status.tcpClTx=channel->countTx();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user