diff --git a/linux/uart/UartComIF.cpp b/linux/uart/UartComIF.cpp index d0a78ee..eb12dee 100644 --- a/linux/uart/UartComIF.cpp +++ b/linux/uart/UartComIF.cpp @@ -305,10 +305,6 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF *cookie, size_t requestL std::string deviceFile; UartDeviceMapIter uartDeviceMapIter; - if(requestLen == 0) { - return RETURN_OK; - } - UartCookie* uartCookie = dynamic_cast(cookie); if(uartCookie == nullptr) { sif::debug << "UartComIF::requestReceiveMessage: Invalid Uart Cookie!" << std::endl; @@ -318,6 +314,11 @@ ReturnValue_t UartComIF::requestReceiveMessage(CookieIF *cookie, size_t requestL UartModes uartMode = uartCookie->getUartMode(); deviceFile = uartCookie->getDeviceFile(); uartDeviceMapIter = uartDeviceMap.find(deviceFile); + + if(uartMode == UartModes::NON_CANONICAL and requestLen == 0) { + return RETURN_OK; + } + if (uartDeviceMapIter == uartDeviceMap.end()) { sif::debug << "UartComIF::requestReceiveMessage: Device file " << deviceFile << " not in uart map" << std::endl; @@ -370,11 +371,6 @@ ReturnValue_t UartComIF::handleCanonicalRead(UartCookie& uartCookie, UartDeviceM if (bytesRead < 0) { return RETURN_FAILED; } - else if (bytesRead != static_cast(requestLen)) { - sif::debug << "UartComIF::requestReceiveMessage: Only read " << bytesRead << - " of " << requestLen << " bytes" << std::endl; - return RETURN_FAILED; - } else if(bytesRead > 0) { iter->second.replyLen += bytesRead; bufferPtr += bytesRead;