wtf is this interface

This commit is contained in:
Robin Müller 2023-02-18 13:51:24 +01:00
parent 5f9eb01d94
commit 2d6622b8b8
1 changed files with 3 additions and 5 deletions

View File

@ -102,13 +102,12 @@ ReturnValue_t I2cComIF::sendMessage(CookieIF* cookie, const uint8_t* sendData, s
if (fileHelper.getOpenResult() != returnvalue::OK) { if (fileHelper.getOpenResult() != returnvalue::OK) {
return fileHelper.getOpenResult(); return fileHelper.getOpenResult();
} }
int slaveFd = 0; result = openI2cSlave(deviceFile, i2cAddress, fd);
result = openI2cSlave(deviceFile, i2cAddress, slaveFd);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }
if (write(slaveFd, sendData, sendLen) != static_cast<int>(sendLen)) { if (write(fd, sendData, sendLen) != static_cast<int>(sendLen)) {
i2cCookie->errorCounter++; i2cCookie->errorCounter++;
if (i2cCookie->errorCounter < 3) { if (i2cCookie->errorCounter < 3) {
#if FSFW_CPP_OSTREAM_ENABLED == 1 #if FSFW_CPP_OSTREAM_ENABLED == 1
@ -161,8 +160,7 @@ ReturnValue_t I2cComIF::requestReceiveMessage(CookieIF* cookie, size_t requestLe
if (fileHelper.getOpenResult() != returnvalue::OK) { if (fileHelper.getOpenResult() != returnvalue::OK) {
return fileHelper.getOpenResult(); return fileHelper.getOpenResult();
} }
int slaveFd = 0; result = openI2cSlave(deviceFile, i2cAddress, fd);
result = openI2cSlave(deviceFile, i2cAddress, slaveFd);
if (result != returnvalue::OK) { if (result != returnvalue::OK) {
return result; return result;
} }