Merge remote-tracking branch 'origin/develop' into mueller/pus-15-tm-storage

This commit is contained in:
Robin Müller 2022-12-12 09:02:04 +01:00
commit 75fc7a056d
2 changed files with 9 additions and 4 deletions

View File

@ -109,14 +109,17 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s
}
if (write(fd, sendData, sendLen) != static_cast<int>(sendLen)) {
i2cCookie->errorCounter++;
if (i2cCookie->errorCounter < 3) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::error << "I2cComIF::sendMessage: Failed to send data to I2C "
"device with error code "
<< errno << ". Error description: " << strerror(errno) << std::endl;
sif::error << "I2cComIF::sendMessage: Failed to send data to I2C "
"device with error code "
<< errno << ". Error description: " << strerror(errno) << std::endl;
#endif
}
return returnvalue::FAILED;
}
i2cCookie->errorCounter = 0;
#if FSFW_HAL_I2C_WIRETAPPING == 1
sif::info << "Sent I2C data to bus " << deviceFile << ":" << std::endl;
arrayprinter::print(sendData, sendLen);

View File

@ -27,6 +27,8 @@ class I2cCookie : public CookieIF {
size_t getMaxReplyLen() const;
std::string getDeviceFile() const;
uint8_t errorCounter = 0;
private:
address_t i2cAddress = 0;
size_t maxReplyLen = 0;