renamed to pool manager for consistency
This commit is contained in:
parent
0b08ac1004
commit
634a8f3469
@ -24,7 +24,7 @@ DeviceHandlerBase::DeviceHandlerBase(object_id_t setObjectId,
|
|||||||
wiretappingMode(OFF), storedRawData(StorageManagerIF::INVALID_ADDRESS),
|
wiretappingMode(OFF), storedRawData(StorageManagerIF::INVALID_ADDRESS),
|
||||||
deviceCommunicationId(deviceCommunication), comCookie(comCookie),
|
deviceCommunicationId(deviceCommunication), comCookie(comCookie),
|
||||||
healthHelper(this,setObjectId), modeHelper(this), parameterHelper(this),
|
healthHelper(this,setObjectId), modeHelper(this), parameterHelper(this),
|
||||||
actionHelper(this, nullptr), hkManager(this, nullptr),
|
actionHelper(this, nullptr), poolManager(this, nullptr),
|
||||||
childTransitionFailure(RETURN_OK), fdirInstance(fdirInstance),
|
childTransitionFailure(RETURN_OK), fdirInstance(fdirInstance),
|
||||||
hkSwitcher(this), defaultFDIRUsed(fdirInstance == nullptr),
|
hkSwitcher(this), defaultFDIRUsed(fdirInstance == nullptr),
|
||||||
switchOffWasReported(false), childTransitionDelay(5000),
|
switchOffWasReported(false), childTransitionDelay(5000),
|
||||||
@ -107,7 +107,7 @@ ReturnValue_t DeviceHandlerBase::performOperation(uint8_t counter) {
|
|||||||
doGetRead();
|
doGetRead();
|
||||||
// This will be performed after datasets have been updated by the
|
// This will be performed after datasets have been updated by the
|
||||||
// custom device implementation.
|
// custom device implementation.
|
||||||
hkManager.performHkOperation();
|
poolManager.performHkOperation();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -210,7 +210,7 @@ ReturnValue_t DeviceHandlerBase::initialize() {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = hkManager.initialize(commandQueue);
|
result = poolManager.initialize(commandQueue);
|
||||||
if (result != HasReturnvaluesIF::RETURN_OK) {
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -280,7 +280,7 @@ void DeviceHandlerBase::readCommandQueue() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = hkManager.handleHousekeepingMessage(&command);
|
result = poolManager.handleHousekeepingMessage(&command);
|
||||||
if (result == RETURN_OK) {
|
if (result == RETURN_OK) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1438,7 +1438,7 @@ ReturnValue_t DeviceHandlerBase::initializeAfterTaskCreation() {
|
|||||||
if(executingTask != nullptr) {
|
if(executingTask != nullptr) {
|
||||||
pstIntervalMs = executingTask->getPeriodMs();
|
pstIntervalMs = executingTask->getPeriodMs();
|
||||||
}
|
}
|
||||||
this->hkManager.initializeAfterTaskCreation();
|
this->poolManager.initializeAfterTaskCreation();
|
||||||
|
|
||||||
if(setStartupImmediately) {
|
if(setStartupImmediately) {
|
||||||
startTransition(MODE_ON, SUBMODE_NONE);
|
startTransition(MODE_ON, SUBMODE_NONE);
|
||||||
@ -1484,7 +1484,7 @@ void DeviceHandlerBase::setNormalDatapoolEntriesInvalid() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
AccessPoolManagerIF* DeviceHandlerBase::getAccessorHandle() {
|
AccessPoolManagerIF* DeviceHandlerBase::getAccessorHandle() {
|
||||||
return &hkManager;
|
return &poolManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceHandlerBase::printWarningOrError(sif::OutputTypes errorType,
|
void DeviceHandlerBase::printWarningOrError(sif::OutputTypes errorType,
|
||||||
@ -1533,5 +1533,5 @@ void DeviceHandlerBase::printWarningOrError(sif::OutputTypes errorType,
|
|||||||
}
|
}
|
||||||
|
|
||||||
ProvidesDataPoolSubscriptionIF* DeviceHandlerBase::getSubscriptionInterface() {
|
ProvidesDataPoolSubscriptionIF* DeviceHandlerBase::getSubscriptionInterface() {
|
||||||
return &hkManager;
|
return &poolManager;
|
||||||
}
|
}
|
||||||
|
@ -517,12 +517,14 @@ protected:
|
|||||||
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
|
||||||
LocalDataPoolManager& poolManager) override;
|
LocalDataPoolManager& poolManager) override;
|
||||||
|
|
||||||
|
/**
|
||||||
/** Get the HK manager object handle */
|
* Provides the subscription handle which can be used by classes like controllers
|
||||||
//LocalDataPoolManager* getHkManagerHandle() override;
|
* to get messages on data updates.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() override;
|
ProvidesDataPoolSubscriptionIF* getSubscriptionInterface() override;
|
||||||
|
|
||||||
|
//! Accessor handle required for internal handling.
|
||||||
AccessPoolManagerIF* getAccessorHandle() override;
|
AccessPoolManagerIF* getAccessorHandle() override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -653,7 +655,7 @@ protected:
|
|||||||
/** Action helper for HasActionsIF */
|
/** Action helper for HasActionsIF */
|
||||||
ActionHelper actionHelper;
|
ActionHelper actionHelper;
|
||||||
/** Housekeeping Manager */
|
/** Housekeeping Manager */
|
||||||
LocalDataPoolManager hkManager;
|
LocalDataPoolManager poolManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Information about commands
|
* @brief Information about commands
|
||||||
|
@ -27,7 +27,7 @@ TEST_CASE("LocalPoolManagerTest" , "[LocManTest]") {
|
|||||||
// Subscribe for an update message.
|
// Subscribe for an update message.
|
||||||
poolOwner->dataset.setChanged(true);
|
poolOwner->dataset.setChanged(true);
|
||||||
// Now the update message should be generated.
|
// Now the update message should be generated.
|
||||||
REQUIRE(poolOwner->hkManager.performHkOperation() == retval::CATCH_OK);
|
REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK);
|
||||||
REQUIRE(mqMock->wasMessageSent() == true);
|
REQUIRE(mqMock->wasMessageSent() == true);
|
||||||
|
|
||||||
REQUIRE(mqMock->receiveMessage(&messageSent) == retval::CATCH_OK);
|
REQUIRE(mqMock->receiveMessage(&messageSent) == retval::CATCH_OK);
|
||||||
@ -38,7 +38,7 @@ TEST_CASE("LocalPoolManagerTest" , "[LocManTest]") {
|
|||||||
CHECK(poolOwner->dataset.hasChanged() == false);
|
CHECK(poolOwner->dataset.hasChanged() == false);
|
||||||
// Set changed again, result should be the same.
|
// Set changed again, result should be the same.
|
||||||
poolOwner->dataset.setChanged(true);
|
poolOwner->dataset.setChanged(true);
|
||||||
REQUIRE(poolOwner->hkManager.performHkOperation() == retval::CATCH_OK);
|
REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK);
|
||||||
|
|
||||||
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
||||||
CHECK(messagesSent == 1);
|
CHECK(messagesSent == 1);
|
||||||
@ -49,7 +49,7 @@ TEST_CASE("LocalPoolManagerTest" , "[LocManTest]") {
|
|||||||
// now subscribe for set update HK as well.
|
// now subscribe for set update HK as well.
|
||||||
REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == retval::CATCH_OK);
|
REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == retval::CATCH_OK);
|
||||||
poolOwner->dataset.setChanged(true);
|
poolOwner->dataset.setChanged(true);
|
||||||
REQUIRE(poolOwner->hkManager.performHkOperation() == retval::CATCH_OK);
|
REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK);
|
||||||
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
||||||
CHECK(messagesSent == 2);
|
CHECK(messagesSent == 2);
|
||||||
// first message sent should be the update notification, considering
|
// first message sent should be the update notification, considering
|
||||||
@ -77,7 +77,7 @@ TEST_CASE("LocalPoolManagerTest" , "[LocManTest]") {
|
|||||||
poolOwner->getPoolObjectHandle(lpool::uint8VarId));
|
poolOwner->getPoolObjectHandle(lpool::uint8VarId));
|
||||||
REQUIRE(poolVar != nullptr);
|
REQUIRE(poolVar != nullptr);
|
||||||
poolVar->setChanged(true);
|
poolVar->setChanged(true);
|
||||||
REQUIRE(poolOwner->hkManager.performHkOperation() == retval::CATCH_OK);
|
REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK);
|
||||||
|
|
||||||
// Check update notification was sent.
|
// Check update notification was sent.
|
||||||
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
||||||
@ -93,7 +93,7 @@ TEST_CASE("LocalPoolManagerTest" , "[LocManTest]") {
|
|||||||
REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == retval::CATCH_OK);
|
REQUIRE(poolOwner->subscribeWrapperSetUpdateHk() == retval::CATCH_OK);
|
||||||
|
|
||||||
poolOwner->dataset.setChanged(true);
|
poolOwner->dataset.setChanged(true);
|
||||||
REQUIRE(poolOwner->hkManager.performHkOperation() == retval::CATCH_OK);
|
REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK);
|
||||||
// now two messages should be sent.
|
// now two messages should be sent.
|
||||||
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
||||||
CHECK(messagesSent == 2);
|
CHECK(messagesSent == 2);
|
||||||
@ -101,7 +101,7 @@ TEST_CASE("LocalPoolManagerTest" , "[LocManTest]") {
|
|||||||
|
|
||||||
poolOwner->dataset.setChanged(true);
|
poolOwner->dataset.setChanged(true);
|
||||||
poolVar->setChanged(true);
|
poolVar->setChanged(true);
|
||||||
REQUIRE(poolOwner->hkManager.performHkOperation() == retval::CATCH_OK);
|
REQUIRE(poolOwner->poolManager.performHkOperation() == retval::CATCH_OK);
|
||||||
// now three messages should be sent.
|
// now three messages should be sent.
|
||||||
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
REQUIRE(mqMock->wasMessageSent(&messagesSent) == true);
|
||||||
CHECK(messagesSent == 3);
|
CHECK(messagesSent == 3);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user