Merge pull request 'printout handling improvements' (#717) from eive/fsfw:i2c_printout_improvements into development
fsfw/fsfw/pipeline/head This commit looks good Details

Reviewed-on: #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);
if (readLen != static_cast<int>(requestLen)) {
#if FSFW_VERBOSE_LEVEL >= 1 and FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "I2cComIF::requestReceiveMessage: Reading from I2C "
<< "device failed with error code " << errno << ". Description"
<< " of error: " << strerror(errno) << std::endl;
sif::error << "I2cComIF::requestReceiveMessage: Read only " << readLen << " from " << requestLen
<< " bytes" << std::endl;
#if FSFW_VERBOSE_LEVEL >= 1
#if FSFW_CPP_OSTREAM_ENABLED == 1
if (readLen < 0) {
sif::warning << "I2cComIF::requestReceiveMessage: Reading from I2C "
<< "device failed with error code " << errno << " | " << strerror(errno)
<< std::endl;
} else {
sif::warning << "I2cComIF::requestReceiveMessage: Read only " << readLen << " from "
<< requestLen << " bytes" << std::endl;
}
#else
#endif
#endif
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::debug << "I2cComIF::requestReceiveMessage: Read " << readLen << " of " << requestLen