printout handling improvements

This commit is contained in:
Robin Müller 2022-11-28 08:42:08 +01:00
parent d6ee2ed400
commit d0e322d7e2
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC

View File

@ -168,12 +168,18 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe
int readLen = read(fd, replyBuffer, requestLen); int readLen = read(fd, replyBuffer, requestLen);
if (readLen != static_cast<int>(requestLen)) { if (readLen != static_cast<int>(requestLen)) {
#if FSFW_VERBOSE_LEVEL >= 1 and FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_VERBOSE_LEVEL >= 1
sif::error << "I2cComIF::requestReceiveMessage: Reading from I2C " #if FSFW_CPP_OSTREAM_ENABLED == 1
<< "device failed with error code " << errno << ". Description" if (readLen < 0) {
<< " of error: " << strerror(errno) << std::endl; sif::warning << "I2cComIF::requestReceiveMessage: Reading from I2C "
sif::error << "I2cComIF::requestReceiveMessage: Read only " << readLen << " from " << requestLen << "device failed with error code " << errno << " | " << strerror(errno)
<< " bytes" << std::endl; << std::endl;
} else {
sif::warning << "I2cComIF::requestReceiveMessage: Read only " << readLen << " from "
<< requestLen << " bytes" << std::endl;
}
#else
#endif
#endif #endif
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << "I2cComIF::requestReceiveMessage: Read " << readLen << " of " << requestLen sif::debug << "I2cComIF::requestReceiveMessage: Read " << readLen << " of " << requestLen