2020-08-13 20:53:35 +02:00
|
|
|
#include "../subsystem/SubsystemBase.h"
|
|
|
|
#include "ChildHandlerBase.h"
|
|
|
|
#include "../subsystem/SubsystemBase.h"
|
2016-06-15 23:48:41 +02:00
|
|
|
|
2020-04-19 15:48:17 +02:00
|
|
|
ChildHandlerBase::ChildHandlerBase(object_id_t setObjectId,
|
|
|
|
object_id_t deviceCommunication, CookieIF * comCookie,
|
|
|
|
uint8_t setDeviceSwitch, uint32_t thermalStatePoolId,
|
|
|
|
uint32_t thermalRequestPoolId, uint32_t parent,
|
|
|
|
FailureIsolationBase* customFdir, size_t cmdQueueSize) :
|
|
|
|
DeviceHandlerBase(setObjectId, deviceCommunication, comCookie,
|
|
|
|
setDeviceSwitch, thermalStatePoolId,thermalRequestPoolId,
|
|
|
|
(customFdir == nullptr? &childHandlerFdir : customFdir),
|
|
|
|
cmdQueueSize),
|
|
|
|
parentId(parent), childHandlerFdir(setObjectId) {
|
2016-06-15 23:48:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
ChildHandlerBase::~ChildHandlerBase() {
|
|
|
|
}
|
|
|
|
|
|
|
|
ReturnValue_t ChildHandlerBase::initialize() {
|
|
|
|
ReturnValue_t result = DeviceHandlerBase::initialize();
|
|
|
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
MessageQueueId_t parentQueue = 0;
|
|
|
|
|
|
|
|
if (parentId != 0) {
|
|
|
|
SubsystemBase *parent = objectManager->get<SubsystemBase>(parentId);
|
|
|
|
if (parent == NULL) {
|
|
|
|
return RETURN_FAILED;
|
|
|
|
}
|
|
|
|
parentQueue = parent->getCommandQueue();
|
|
|
|
|
|
|
|
parent->registerChild(getObjectId());
|
|
|
|
}
|
|
|
|
|
2020-06-25 18:09:32 +02:00
|
|
|
healthHelper.setParentQueue(parentQueue);
|
2016-06-15 23:48:41 +02:00
|
|
|
|
|
|
|
modeHelper.setParentQueue(parentQueue);
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|