counting per-channel traffic
This commit is contained in:
parent
3e14876e9e
commit
8ef2af44f3
|
@ -120,6 +120,10 @@ static void printTsStats(void) {
|
||||||
|
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
|
#if EFI_USB_SERIAL
|
||||||
|
printUsbConnectorStats();
|
||||||
|
#endif // EFI_USB_SERIAL
|
||||||
|
|
||||||
printErrorCounters();
|
printErrorCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,5 +9,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
void initializeConsole();
|
void initializeConsole();
|
||||||
|
|
||||||
void startUsbConsole();
|
void startUsbConsole();
|
||||||
|
void printUsbConnectorStats();
|
||||||
|
|
||||||
void startEthernetConsole();
|
void startEthernetConsole();
|
||||||
|
|
|
@ -24,11 +24,14 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void write(const uint8_t* buffer, size_t size, bool /*isEndOfPacket*/) override {
|
void write(const uint8_t* buffer, size_t size, bool /*isEndOfPacket*/) override {
|
||||||
chnWriteTimeout(m_channel, buffer, size, BINARY_IO_TIMEOUT);
|
size_t transferred = chnWriteTimeout(m_channel, buffer, size, BINARY_IO_TIMEOUT);
|
||||||
|
bytesOut += transferred;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t readTimeout(uint8_t* buffer, size_t size, int timeout) override {
|
size_t readTimeout(uint8_t* buffer, size_t size, int timeout) override {
|
||||||
return chnReadTimeout(m_channel, buffer, size, timeout);
|
size_t transferred = chnReadTimeout(m_channel, buffer, size, timeout);
|
||||||
|
bytesIn += transferred;
|
||||||
|
return transferred;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -54,4 +57,7 @@ void startUsbConsole() {
|
||||||
usbConsole.start();
|
usbConsole.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void printUsbConnectorStats() {
|
||||||
|
}
|
||||||
|
|
||||||
#endif // EFI_USB_SERIAL
|
#endif // EFI_USB_SERIAL
|
||||||
|
|
Loading…
Reference in New Issue