Revert "device handler base update"

This reverts commit 44dcd3104e.
This commit is contained in:
Robin Müller 2020-12-30 22:17:08 +01:00
parent 44dcd3104e
commit 56eac46472
2 changed files with 10 additions and 13 deletions

View File

@ -16,8 +16,8 @@
#include <iomanip>
object_id_t DeviceHandlerBase::defaultPowerSwitcherId = objects::NO_OBJECT;
object_id_t DeviceHandlerBase::defaultRawDataReceiverId = objects::NO_OBJECT;
object_id_t DeviceHandlerBase::powerSwitcherId = objects::NO_OBJECT;
object_id_t DeviceHandlerBase::rawDataReceiverId = objects::NO_OBJECT;
object_id_t DeviceHandlerBase::defaultFdirParentId = objects::NO_OBJECT;
DeviceHandlerBase::DeviceHandlerBase(object_id_t setObjectId,
@ -151,9 +151,9 @@ ReturnValue_t DeviceHandlerBase::initialize() {
return ObjectManagerIF::CHILD_INIT_FAILED;
}
if(defaultRawDataReceiverId != objects::NO_OBJECT) {
if(rawDataReceiverId != objects::NO_OBJECT) {
AcceptsDeviceResponsesIF *rawReceiver = objectManager->get<
AcceptsDeviceResponsesIF>(defaultRawDataReceiverId);
AcceptsDeviceResponsesIF>(rawDataReceiverId);
if (rawReceiver == nullptr) {
sif::error << "DeviceHandlerBase::initialize: Raw receiver object "
@ -165,9 +165,8 @@ ReturnValue_t DeviceHandlerBase::initialize() {
defaultRawReceiver = rawReceiver->getDeviceQueue();
}
if(defaultPowerSwitcherId != objects::NO_OBJECT) {
powerSwitcher = objectManager->get<PowerSwitchIF>(
defaultPowerSwitcherId);
if(powerSwitcherId != objects::NO_OBJECT) {
powerSwitcher = objectManager->get<PowerSwitchIF>(powerSwitcherId);
if (powerSwitcher == nullptr) {
sif::error << "DeviceHandlerBase::initialize: Power switcher "
<< "object ID set but no valid object found." << std::endl;
@ -683,11 +682,9 @@ void DeviceHandlerBase::doGetRead() {
replyRawData(receivedData, receivedDataLen, requestedRawTraffic);
}
if (mode == MODE_RAW) {
if(defaultRawReceiver != MessageQueueIF::NO_QUEUE) {
if (mode == MODE_RAW and defaultRawReceiver != MessageQueueIF::NO_QUEUE) {
replyRawReplyIfnotWiretapped(receivedData, receivedDataLen);
}
}
else {
parseReply(receivedData, receivedDataLen);
}

View File

@ -739,10 +739,10 @@ protected:
PeriodicTaskIF* executingTask = nullptr;
//!< Object which switches power on and off.
static object_id_t defaultPowerSwitcherId;
static object_id_t powerSwitcherId;
//!< Object which receives RAW data by default.
static object_id_t defaultRawDataReceiverId;
static object_id_t rawDataReceiverId;
//!< Object which may be the root cause of an identified fault.
static object_id_t defaultFdirParentId;