Merge pull request 'printout handling improvements' (#717) from eive/fsfw:i2c_printout_improvements into development

Reviewed-on: fsfw/fsfw#717
This commit is contained in:
Steffen Gaisser 2022-12-19 14:45:04 +01:00
commit f0b89e98df
1 changed files with 12 additions and 6 deletions

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