2016-06-15 23:48:41 +02:00
|
|
|
#include <framework/subsystem/SubsystemBase.h>
|
|
|
|
#include <framework/devicehandlers/ChildHandlerBase.h>
|
|
|
|
#include <framework/subsystem/SubsystemBase.h>
|
|
|
|
|
2020-03-23 19:09:42 +01:00
|
|
|
ChildHandlerBase::ChildHandlerBase(object_id_t setObjectId,
|
|
|
|
object_id_t deviceCommunication, CookieIF * cookie,
|
2016-06-15 23:48:41 +02:00
|
|
|
uint32_t maxDeviceReplyLen, uint8_t setDeviceSwitch,
|
|
|
|
uint32_t thermalStatePoolId, uint32_t thermalRequestPoolId,
|
2020-03-23 17:58:23 +01:00
|
|
|
uint32_t parent, FailureIsolationBase* customFdir, size_t cmdQueueSize) :
|
2020-03-23 19:09:42 +01:00
|
|
|
DeviceHandlerBase(setObjectId, deviceCommunication, cookie,
|
2020-04-01 12:41:54 +02:00
|
|
|
setDeviceSwitch, thermalStatePoolId,
|
2020-03-23 17:58:23 +01:00
|
|
|
thermalRequestPoolId, (customFdir == NULL? &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());
|
|
|
|
}
|
|
|
|
|
|
|
|
healthHelper.setParentQeueue(parentQueue);
|
|
|
|
|
|
|
|
modeHelper.setParentQueue(parentQueue);
|
|
|
|
|
|
|
|
return RETURN_OK;
|
|
|
|
}
|