Replace concurrentqueue with ringbuffer

This commit is contained in:
Jonathan Schwartz
2024-04-05 17:24:53 +00:00
parent 7d2d12c5cd
commit 63f0516318
22 changed files with 361 additions and 169 deletions
+2 -2
View File
@@ -268,7 +268,7 @@ void Communication::readTask() {
while(!closing) {
readBytes.clear();
if(driver->readWait(readBytes)) {
if(driver->readAvailable()) {
handleInput(*packetizer, readBytes);
}
}
@@ -291,7 +291,7 @@ void Communication::handleInput(Packetizer& p, std::vector<uint8_t>& readBytes)
handleInput(p, readBytes); // and we might as well process this input ourselves
}
} else {
if(p.input(readBytes)) {
if(p.input(driver->getReadBuffer())) {
for(const auto& packet : p.output()) {
std::shared_ptr<Message> msg;
if(!decoder->decode(msg, packet))