all retval replacements
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good
This commit is contained in:
@ -130,7 +130,7 @@ ArduinoComIF::~ArduinoComIF() {
|
||||
#endif
|
||||
}
|
||||
ReturnValue_t ArduinoComIF::initializeInterface(CookieIF *cookie) {
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t ArduinoComIF::sendMessage(CookieIF *cookie, const uint8_t *data, size_t len) {
|
||||
@ -142,10 +142,10 @@ ReturnValue_t ArduinoComIF::sendMessage(CookieIF *cookie, const uint8_t *data, s
|
||||
return sendMessage(arduinoCookie->command, arduinoCookie->address, data, len);
|
||||
}
|
||||
|
||||
ReturnValue_t ArduinoComIF::getSendSuccess(CookieIF *cookie) { return RETURN_OK; }
|
||||
ReturnValue_t ArduinoComIF::getSendSuccess(CookieIF *cookie) { return returnvalue::OK; }
|
||||
|
||||
ReturnValue_t ArduinoComIF::requestReceiveMessage(CookieIF *cookie, size_t requestLen) {
|
||||
return RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t ArduinoComIF::readReceivedMessage(CookieIF *cookie, uint8_t **buffer, size_t *size) {
|
||||
@ -158,7 +158,7 @@ ReturnValue_t ArduinoComIF::readReceivedMessage(CookieIF *cookie, uint8_t **buff
|
||||
|
||||
*buffer = arduinoCookie->replyBuffer.data();
|
||||
*size = arduinoCookie->receivedDataLen;
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t ArduinoComIF::sendMessage(uint8_t command, uint8_t address, const uint8_t *data,
|
||||
@ -178,14 +178,14 @@ ReturnValue_t ArduinoComIF::sendMessage(uint8_t command, uint8_t address, const
|
||||
|
||||
ReturnValue_t result =
|
||||
DleEncoder::encode(&command, 1, currentPosition, remainingLen, &encodedLen, false);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
currentPosition += encodedLen;
|
||||
remainingLen -= encodedLen; // DleEncoder will never return encodedLen > remainingLen
|
||||
|
||||
result = DleEncoder::encode(&address, 1, currentPosition, remainingLen, &encodedLen, false);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
currentPosition += encodedLen;
|
||||
@ -199,7 +199,7 @@ ReturnValue_t ArduinoComIF::sendMessage(uint8_t command, uint8_t address, const
|
||||
|
||||
result =
|
||||
DleEncoder::encode(temporaryBuffer, 2, currentPosition, remainingLen, &encodedLen, false);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
currentPosition += encodedLen;
|
||||
@ -207,7 +207,7 @@ ReturnValue_t ArduinoComIF::sendMessage(uint8_t command, uint8_t address, const
|
||||
|
||||
// encoding the actual data
|
||||
result = DleEncoder::encode(data, dataLen, currentPosition, remainingLen, &encodedLen, false);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
currentPosition += encodedLen;
|
||||
@ -224,7 +224,7 @@ ReturnValue_t ArduinoComIF::sendMessage(uint8_t command, uint8_t address, const
|
||||
|
||||
result =
|
||||
DleEncoder::encode(temporaryBuffer, 2, currentPosition, remainingLen, &encodedLen, false);
|
||||
if (result != RETURN_OK) {
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
currentPosition += encodedLen;
|
||||
@ -241,16 +241,16 @@ ReturnValue_t ArduinoComIF::sendMessage(uint8_t command, uint8_t address, const
|
||||
ssize_t writtenlen = ::write(serialPort, sendBuffer, encodedLen);
|
||||
if (writtenlen < 0) {
|
||||
// we could try to find out what happened...
|
||||
return RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
if (writtenlen != encodedLen) {
|
||||
// the OS failed us, we do not try to block until everything is written, as
|
||||
// we can not block the whole system here
|
||||
return RETURN_FAILED;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
return RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
#elif WIN32
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
return returnvalue::OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -297,7 +297,7 @@ void ArduinoComIF::handleSerialPortRx() {
|
||||
packet, sizeof(packet), &packetLen);
|
||||
|
||||
size_t toDelete = firstSTXinRawData;
|
||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
||||
if (result == returnvalue::OK) {
|
||||
handlePacket(packet, packetLen);
|
||||
|
||||
// after handling the packet, we can delete it from the raw stream,
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include <fsfw/container/SimpleRingBuffer.h>
|
||||
#include <fsfw/devicehandlers/DeviceCommunicationIF.h>
|
||||
#include <fsfw/objectmanager/SystemObject.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <fsfw/returnvalues/returnvalue.h>
|
||||
|
||||
#include <cstdint>
|
||||
#include <map>
|
||||
|
Reference in New Issue
Block a user