diff --git a/devicehandlers/DeviceHandlerBase.cpp b/devicehandlers/DeviceHandlerBase.cpp index fd8d6141..09c27c87 100644 --- a/devicehandlers/DeviceHandlerBase.cpp +++ b/devicehandlers/DeviceHandlerBase.cpp @@ -21,7 +21,7 @@ DeviceHandlerBase::DeviceHandlerBase(uint32_t logicalAddress_, uint8_t setDeviceSwitch, object_id_t deviceCommunication, uint32_t thermalStatePoolId, uint32_t thermalRequestPoolId, FailureIsolationBase* fdirInstance, uint32_t cmdQueueSize) : - SystemObject(setObjectId),logicalAddress(logicalAddress_), rawPacket(0), rawPacketLen(0), mode(MODE_OFF), + SystemObject(setObjectId), rawPacket(0), rawPacketLen(0), mode(MODE_OFF), submode(SUBMODE_NONE), pstStep(0), maxDeviceReplyLen(maxDeviceReplyLen), wiretappingMode(OFF), defaultRawReceiver(0), storedRawData(StorageManagerIF::INVALID_ADDRESS), requestedRawTraffic(0), powerSwitcher(NULL), IPCStore(NULL), @@ -31,7 +31,7 @@ DeviceHandlerBase::DeviceHandlerBase(uint32_t logicalAddress_, modeHelper(this), parameterHelper(this), childTransitionFailure(RETURN_OK), ignoreMissedRepliesCount(0), fdirInstance(fdirInstance), hkSwitcher(this), defaultFDIRUsed(fdirInstance == NULL), switchOffWasReported(false), - executingTask(NULL), actionHelper(this, NULL), cookieInfo(), + executingTask(NULL), actionHelper(this, NULL), cookieInfo(), logicalAddress(logicalAddress_), timeoutStart(0), childTransitionDelay(5000), transitionSourceMode(_MODE_POWER_DOWN), transitionSourceSubMode(SUBMODE_NONE), deviceSwitch(setDeviceSwitch) { commandQueue = QueueFactory::instance()->createMessageQueue(cmdQueueSize, @@ -1018,6 +1018,7 @@ void DeviceHandlerBase::replyRawReplyIfnotWiretapped(const uint8_t* data, } } + ReturnValue_t DeviceHandlerBase::handleDeviceHandlerMessage( CommandMessage * message) { ReturnValue_t result; @@ -1271,4 +1272,6 @@ void DeviceHandlerBase::setTaskIF(PeriodicTaskIF* task_){ void DeviceHandlerBase::debugInterface(uint8_t positionTracker) { } - +uint32_t DeviceHandlerBase::getLogicalAddress() { + return logicalAddress; +} diff --git a/devicehandlers/DeviceHandlerBase.h b/devicehandlers/DeviceHandlerBase.h index 8f7f065a..4c83b230 100644 --- a/devicehandlers/DeviceHandlerBase.h +++ b/devicehandlers/DeviceHandlerBase.h @@ -146,11 +146,6 @@ public: */ virtual void setTaskIF(PeriodicTaskIF* task_); protected: - /** - * cached from ctor for initialize() - */ - const uint32_t logicalAddress; - /** * The Returnvalues id of this class, required by HasReturnvaluesIF */ @@ -763,6 +758,11 @@ protected: */ virtual bool dontCheckQueue(); + /** + * Used to retrieve logical address + * @return + */ + virtual uint32_t getLogicalAddress(); Mode_t getBaseMode(Mode_t transitionMode); bool isAwaitingReply(); @@ -775,7 +775,6 @@ protected: virtual void startTransition(Mode_t mode, Submode_t submode); virtual void setToExternalControl(); virtual void announceMode(bool recursive); - virtual ReturnValue_t letChildHandleMessage(CommandMessage *message); /** @@ -862,6 +861,8 @@ protected: private: + + /** * State a cookie is in. * @@ -892,6 +893,10 @@ private: */ CookieInfo cookieInfo; + /** + * cached from ctor for initialize() + */ + const uint32_t logicalAddress; /** * Used for timing out mode transitions.