missing replacements
This commit is contained in:
parent
f91ad84bdc
commit
f5866ddace
@ -51,7 +51,7 @@ void EventManager::notifyListeners(EventMessage* message) {
|
|||||||
if (listener.second.match(message)) {
|
if (listener.second.match(message)) {
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
MessageQueueSenderIF::sendMessage(listener.first, message, message->getSender());
|
MessageQueueSenderIF::sendMessage(listener.first, message, message->getSender());
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
sif::error << std::hex << "EventManager::notifyListeners: MSG to 0x" << std::setfill('0')
|
sif::error << std::hex << "EventManager::notifyListeners: MSG to 0x" << std::setfill('0')
|
||||||
<< std::setw(8) << listener.first << " failed with result 0x" << std::setw(4)
|
<< std::setw(8) << listener.first << " failed with result 0x" << std::setw(4)
|
||||||
|
@ -23,12 +23,12 @@ DleParser::DleParser(SimpleRingBuffer& decodeRingBuf, DleEncoder& decoder, BufPa
|
|||||||
|
|
||||||
ReturnValue_t DleParser::passData(uint8_t* data, size_t len) {
|
ReturnValue_t DleParser::passData(uint8_t* data, size_t len) {
|
||||||
if (data == nullptr or len == 0 or handler == nullptr) {
|
if (data == nullptr or len == 0 or handler == nullptr) {
|
||||||
return RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
size_t copyIntoRingBufFromHere = 0;
|
size_t copyIntoRingBufFromHere = 0;
|
||||||
size_t copyAmount = len;
|
size_t copyAmount = len;
|
||||||
size_t startIdx = 0;
|
size_t startIdx = 0;
|
||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
bool startFoundInThisPacket = false;
|
bool startFoundInThisPacket = false;
|
||||||
for (size_t idx = 0; idx < len; idx++) {
|
for (size_t idx = 0; idx < len; idx++) {
|
||||||
if (data[idx] == DleEncoder::STX_CHAR) {
|
if (data[idx] == DleEncoder::STX_CHAR) {
|
||||||
@ -54,7 +54,7 @@ ReturnValue_t DleParser::passData(uint8_t* data, size_t len) {
|
|||||||
size_t decodedLen = 0;
|
size_t decodedLen = 0;
|
||||||
result = decoder.decode(data + startIdx, idx + 1 - startIdx, &readLen, decodedBuf.first,
|
result = decoder.decode(data + startIdx, idx + 1 - startIdx, &readLen, decodedBuf.first,
|
||||||
decodedBuf.second, &decodedLen);
|
decodedBuf.second, &decodedLen);
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
ctx.setType(ContextType::PACKET_FOUND);
|
ctx.setType(ContextType::PACKET_FOUND);
|
||||||
ctx.decodedPacket.first = decodedBuf.first;
|
ctx.decodedPacket.first = decodedBuf.first;
|
||||||
ctx.decodedPacket.second = decodedLen;
|
ctx.decodedPacket.second = decodedLen;
|
||||||
@ -81,7 +81,7 @@ ReturnValue_t DleParser::passData(uint8_t* data, size_t len) {
|
|||||||
// ETX found but STX was found in another mini packet. Reconstruct the full packet
|
// ETX found but STX was found in another mini packet. Reconstruct the full packet
|
||||||
// to decode it
|
// to decode it
|
||||||
result = decodeRingBuf.writeData(data, idx + 1);
|
result = decodeRingBuf.writeData(data, idx + 1);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ErrorInfo info;
|
ErrorInfo info;
|
||||||
info.res = result;
|
info.res = result;
|
||||||
prepareErrorContext(ErrorTypes::RING_BUF_ERROR, info);
|
prepareErrorContext(ErrorTypes::RING_BUF_ERROR, info);
|
||||||
@ -100,7 +100,7 @@ ReturnValue_t DleParser::passData(uint8_t* data, size_t len) {
|
|||||||
decodeRingBuf.readData(encodedBuf.first, fullEncodedLen, true);
|
decodeRingBuf.readData(encodedBuf.first, fullEncodedLen, true);
|
||||||
result = decoder.decode(encodedBuf.first, fullEncodedLen, &readLen, decodedBuf.first,
|
result = decoder.decode(encodedBuf.first, fullEncodedLen, &readLen, decodedBuf.first,
|
||||||
decodedBuf.second, &decodedLen);
|
decodedBuf.second, &decodedLen);
|
||||||
if (result == HasReturnvaluesIF::RETURN_OK) {
|
if (result == returnvalue::OK) {
|
||||||
if (this->handler != nullptr) {
|
if (this->handler != nullptr) {
|
||||||
ctx.setType(ContextType::PACKET_FOUND);
|
ctx.setType(ContextType::PACKET_FOUND);
|
||||||
ctx.decodedPacket.first = decodedBuf.first;
|
ctx.decodedPacket.first = decodedBuf.first;
|
||||||
@ -148,14 +148,14 @@ ReturnValue_t DleParser::passData(uint8_t* data, size_t len) {
|
|||||||
}
|
}
|
||||||
if (copyAmount > 0) {
|
if (copyAmount > 0) {
|
||||||
result = decodeRingBuf.writeData(data + copyIntoRingBufFromHere, copyAmount);
|
result = decodeRingBuf.writeData(data + copyIntoRingBufFromHere, copyAmount);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != returnvalue::OK) {
|
||||||
ErrorInfo info;
|
ErrorInfo info;
|
||||||
info.res = result;
|
info.res = result;
|
||||||
prepareErrorContext(ErrorTypes::RING_BUF_ERROR, info);
|
prepareErrorContext(ErrorTypes::RING_BUF_ERROR, info);
|
||||||
handler(ctx);
|
handler(ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DleParser::defaultFoundPacketHandler(uint8_t* packet, size_t len, void* args) {
|
void DleParser::defaultFoundPacketHandler(uint8_t* packet, size_t len, void* args) {
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <fsfw/container/SimpleRingBuffer.h>
|
#include <fsfw/container/SimpleRingBuffer.h>
|
||||||
#include <fsfw/globalfunctions/DleEncoder.h>
|
#include <fsfw/globalfunctions/DleEncoder.h>
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
#include <fsfw/returnvalues/returnvalue.h>
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
@ -16,7 +16,7 @@
|
|||||||
* overriding two provided virtual methods. This also allows detecting multiple DLE packets
|
* overriding two provided virtual methods. This also allows detecting multiple DLE packets
|
||||||
* inside one passed packet.
|
* inside one passed packet.
|
||||||
*/
|
*/
|
||||||
class DleParser : public HasReturnvaluesIF {
|
class DleParser {
|
||||||
public:
|
public:
|
||||||
using BufPair = std::pair<uint8_t*, size_t>;
|
using BufPair = std::pair<uint8_t*, size_t>;
|
||||||
|
|
||||||
|
@ -17,11 +17,11 @@ class HasHealthIF {
|
|||||||
|
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::HAS_HEALTH_IF;
|
static const uint8_t INTERFACE_ID = CLASS_ID::HAS_HEALTH_IF;
|
||||||
static constexpr ReturnValue_t OBJECT_NOT_HEALTHY =
|
static constexpr ReturnValue_t OBJECT_NOT_HEALTHY =
|
||||||
HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 1);
|
returnvalue::makeCode(INTERFACE_ID, 1);
|
||||||
static constexpr ReturnValue_t INVALID_HEALTH_STATE =
|
static constexpr ReturnValue_t INVALID_HEALTH_STATE =
|
||||||
HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 2);
|
returnvalue::makeCode(INTERFACE_ID, 2);
|
||||||
static constexpr ReturnValue_t IS_EXTERNALLY_CONTROLLED =
|
static constexpr ReturnValue_t IS_EXTERNALLY_CONTROLLED =
|
||||||
HasReturnvaluesIF::makeReturnCode(INTERFACE_ID, 3);
|
returnvalue::makeCode(INTERFACE_ID, 3);
|
||||||
|
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SYSTEM_MANAGER_1;
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SYSTEM_MANAGER_1;
|
||||||
//! P1: New Health, P2: Old Health
|
//! P1: New Health, P2: Old Health
|
||||||
|
@ -66,7 +66,7 @@ class HasParametersIF {
|
|||||||
* @param newValues
|
* @param newValues
|
||||||
* @param startAtIndex Linear index, runs left to right, top to bottom for
|
* @param startAtIndex Linear index, runs left to right, top to bottom for
|
||||||
* matrix indexes.
|
* matrix indexes.
|
||||||
* @return RETURN_OK if parameter is valid and a set function of the parameter wrapper was called.
|
* @return returnvalue::OK if parameter is valid and a set function of the parameter wrapper was called.
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueIdentifier,
|
virtual ReturnValue_t getParameter(uint8_t domainId, uint8_t uniqueIdentifier,
|
||||||
ParameterWrapper *parameterWrapper,
|
ParameterWrapper *parameterWrapper,
|
||||||
|
@ -208,7 +208,7 @@ ReturnValue_t Service3Housekeeping::handleReply(const CommandMessage* reply,
|
|||||||
ReturnValue_t error = returnvalue::FAILED;
|
ReturnValue_t error = returnvalue::FAILED;
|
||||||
HousekeepingMessage::getHkRequestFailureReply(reply, &error);
|
HousekeepingMessage::getHkRequestFailureReply(reply, &error);
|
||||||
failureParameter2 = error;
|
failureParameter2 = error;
|
||||||
return RETURN_FAILED;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -223,7 +223,7 @@ void CommandingServiceBase::handleReplyHandlerResult(ReturnValue_t result, Comma
|
|||||||
|
|
||||||
// In case a new command is to be sent immediately, this is performed here.
|
// In case a new command is to be sent immediately, this is performed here.
|
||||||
// If no new command is sent, only analyse reply result by initializing
|
// If no new command is sent, only analyse reply result by initializing
|
||||||
// sendResult as RETURN_OK
|
// sendResult as returnvalue::OK
|
||||||
ReturnValue_t sendResult = returnvalue::OK;
|
ReturnValue_t sendResult = returnvalue::OK;
|
||||||
if (nextCommand->getCommand() != CommandMessage::CMD_NONE) {
|
if (nextCommand->getCommand() != CommandMessage::CMD_NONE) {
|
||||||
sendResult = commandQueue->sendMessage(reply->getSender(), nextCommand);
|
sendResult = commandQueue->sendMessage(reply->getSender(), nextCommand);
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "fsfw/ipc/MutexIF.h"
|
#include "fsfw/ipc/MutexIF.h"
|
||||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
#include "fsfw_hal/common/gpio/GpioIF.h"
|
#include "fsfw_hal/common/gpio/GpioIF.h"
|
||||||
|
|
||||||
class ManualCsLockWrapper : public HasReturnvaluesIF {
|
class ManualCsLockWrapper {
|
||||||
public:
|
public:
|
||||||
ManualCsLockWrapper(MutexIF* lock, GpioIF* gpioIF, SpiCookie* cookie,
|
ManualCsLockWrapper(MutexIF* lock, GpioIF* gpioIF, SpiCookie* cookie,
|
||||||
MutexIF::TimeoutType type = MutexIF::TimeoutType::BLOCKING,
|
MutexIF::TimeoutType type = MutexIF::TimeoutType::BLOCKING,
|
||||||
@ -16,18 +16,18 @@ class ManualCsLockWrapper : public HasReturnvaluesIF {
|
|||||||
}
|
}
|
||||||
cookie->setCsLockManual(true);
|
cookie->setCsLockManual(true);
|
||||||
lockResult = lock->lockMutex(type, timeoutMs);
|
lockResult = lock->lockMutex(type, timeoutMs);
|
||||||
if (lockResult != RETURN_OK) {
|
if (lockResult != returnvalue::OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
gpioResult = gpioIF->pullLow(cookie->getChipSelectPin());
|
gpioResult = gpioIF->pullLow(cookie->getChipSelectPin());
|
||||||
}
|
}
|
||||||
|
|
||||||
~ManualCsLockWrapper() {
|
~ManualCsLockWrapper() {
|
||||||
if (gpioResult == RETURN_OK) {
|
if (gpioResult == returnvalue::OK) {
|
||||||
gpioIF->pullHigh(cookie->getChipSelectPin());
|
gpioIF->pullHigh(cookie->getChipSelectPin());
|
||||||
}
|
}
|
||||||
cookie->setCsLockManual(false);
|
cookie->setCsLockManual(false);
|
||||||
if (lockResult == RETURN_OK) {
|
if (lockResult == returnvalue::OK) {
|
||||||
lock->unlockMutex();
|
lock->unlockMutex();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -646,7 +646,7 @@ ReturnValue_t TestDevice::initializeLocalDataPool(localpool::DataPool& localData
|
|||||||
/* Subscribe for periodic HK packets but do not enable reporting for now.
|
/* Subscribe for periodic HK packets but do not enable reporting for now.
|
||||||
Non-diangostic with a period of one second */
|
Non-diangostic with a period of one second */
|
||||||
poolManager.subscribeForRegularPeriodicPacket({sid, false, 1.0});
|
poolManager.subscribeForRegularPeriodicPacket({sid, false, 1.0});
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId,
|
ReturnValue_t TestDevice::getParameter(uint8_t domainId, uint8_t uniqueId,
|
||||||
|
@ -269,7 +269,7 @@ TEST_CASE("DataSetTest", "[DataSetTest]") {
|
|||||||
|
|
||||||
{
|
{
|
||||||
// PoolReadGuard rg(&sharedSet);
|
// PoolReadGuard rg(&sharedSet);
|
||||||
// CHECK(rg.getReadResult() == result::OK);
|
// CHECK(rg.getReadResult() == returnvalue::OK);
|
||||||
localSet.localPoolVarUint8.value = 5;
|
localSet.localPoolVarUint8.value = 5;
|
||||||
localSet.localPoolUint16Vec.value[0] = 1;
|
localSet.localPoolUint16Vec.value[0] = 1;
|
||||||
localSet.localPoolUint16Vec.value[1] = 2;
|
localSet.localPoolUint16Vec.value[1] = 2;
|
||||||
|
@ -19,7 +19,7 @@ TEST_CASE("Binary Semaphore Test" , "[BinSemaphore]") {
|
|||||||
REQUIRE(binSemaph->release() ==
|
REQUIRE(binSemaph->release() ==
|
||||||
static_cast<int>(SemaphoreIF::SEMAPHORE_NOT_OWNED));
|
static_cast<int>(SemaphoreIF::SEMAPHORE_NOT_OWNED));
|
||||||
REQUIRE(binSemaph->acquire(SemaphoreIF::POLLING) ==
|
REQUIRE(binSemaph->acquire(SemaphoreIF::POLLING) ==
|
||||||
result::OK);
|
returnvalue::OK);
|
||||||
{
|
{
|
||||||
// not precise enough on linux.. should use clock instead..
|
// not precise enough on linux.. should use clock instead..
|
||||||
//Stopwatch stopwatch(false);
|
//Stopwatch stopwatch(false);
|
||||||
@ -29,7 +29,7 @@ TEST_CASE("Binary Semaphore Test" , "[BinSemaphore]") {
|
|||||||
//CHECK(time == 5);
|
//CHECK(time == 5);
|
||||||
}
|
}
|
||||||
REQUIRE(binSemaph->getSemaphoreCounter() == 0);
|
REQUIRE(binSemaph->getSemaphoreCounter() == 0);
|
||||||
REQUIRE(binSemaph->release() == result::OK);
|
REQUIRE(binSemaph->release() == returnvalue::OK);
|
||||||
}
|
}
|
||||||
SemaphoreFactory::instance()->deleteSemaphore(binSemaph);
|
SemaphoreFactory::instance()->deleteSemaphore(binSemaph);
|
||||||
// perform tear-down here
|
// perform tear-down here
|
||||||
|
Loading…
Reference in New Issue
Block a user