Getter method for logicalAddress

This commit is contained in:
Robin Müller 2019-11-09 13:29:12 +01:00
parent ee765eafc7
commit 537e2ceb18
2 changed files with 17 additions and 9 deletions

View File

@ -21,7 +21,7 @@ DeviceHandlerBase::DeviceHandlerBase(uint32_t logicalAddress_,
uint8_t setDeviceSwitch, object_id_t deviceCommunication, uint8_t setDeviceSwitch, object_id_t deviceCommunication,
uint32_t thermalStatePoolId, uint32_t thermalRequestPoolId, uint32_t thermalStatePoolId, uint32_t thermalRequestPoolId,
FailureIsolationBase* fdirInstance, uint32_t cmdQueueSize) : 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), submode(SUBMODE_NONE), pstStep(0), maxDeviceReplyLen(maxDeviceReplyLen),
wiretappingMode(OFF), defaultRawReceiver(0), storedRawData(StorageManagerIF::INVALID_ADDRESS), wiretappingMode(OFF), defaultRawReceiver(0), storedRawData(StorageManagerIF::INVALID_ADDRESS),
requestedRawTraffic(0), powerSwitcher(NULL), IPCStore(NULL), requestedRawTraffic(0), powerSwitcher(NULL), IPCStore(NULL),
@ -31,7 +31,7 @@ DeviceHandlerBase::DeviceHandlerBase(uint32_t logicalAddress_,
modeHelper(this), parameterHelper(this), childTransitionFailure(RETURN_OK), modeHelper(this), parameterHelper(this), childTransitionFailure(RETURN_OK),
ignoreMissedRepliesCount(0), fdirInstance(fdirInstance), hkSwitcher(this), ignoreMissedRepliesCount(0), fdirInstance(fdirInstance), hkSwitcher(this),
defaultFDIRUsed(fdirInstance == NULL), switchOffWasReported(false), 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), timeoutStart(0), childTransitionDelay(5000), transitionSourceMode(_MODE_POWER_DOWN),
transitionSourceSubMode(SUBMODE_NONE), deviceSwitch(setDeviceSwitch) { transitionSourceSubMode(SUBMODE_NONE), deviceSwitch(setDeviceSwitch) {
commandQueue = QueueFactory::instance()->createMessageQueue(cmdQueueSize, commandQueue = QueueFactory::instance()->createMessageQueue(cmdQueueSize,
@ -1018,6 +1018,7 @@ void DeviceHandlerBase::replyRawReplyIfnotWiretapped(const uint8_t* data,
} }
} }
ReturnValue_t DeviceHandlerBase::handleDeviceHandlerMessage( ReturnValue_t DeviceHandlerBase::handleDeviceHandlerMessage(
CommandMessage * message) { CommandMessage * message) {
ReturnValue_t result; ReturnValue_t result;
@ -1271,4 +1272,6 @@ void DeviceHandlerBase::setTaskIF(PeriodicTaskIF* task_){
void DeviceHandlerBase::debugInterface(uint8_t positionTracker) { void DeviceHandlerBase::debugInterface(uint8_t positionTracker) {
} }
uint32_t DeviceHandlerBase::getLogicalAddress() {
return logicalAddress;
}

View File

@ -146,11 +146,6 @@ public:
*/ */
virtual void setTaskIF(PeriodicTaskIF* task_); virtual void setTaskIF(PeriodicTaskIF* task_);
protected: protected:
/**
* cached from ctor for initialize()
*/
const uint32_t logicalAddress;
/** /**
* The Returnvalues id of this class, required by HasReturnvaluesIF * The Returnvalues id of this class, required by HasReturnvaluesIF
*/ */
@ -763,6 +758,11 @@ protected:
*/ */
virtual bool dontCheckQueue(); virtual bool dontCheckQueue();
/**
* Used to retrieve logical address
* @return
*/
virtual uint32_t getLogicalAddress();
Mode_t getBaseMode(Mode_t transitionMode); Mode_t getBaseMode(Mode_t transitionMode);
bool isAwaitingReply(); bool isAwaitingReply();
@ -775,7 +775,6 @@ protected:
virtual void startTransition(Mode_t mode, Submode_t submode); virtual void startTransition(Mode_t mode, Submode_t submode);
virtual void setToExternalControl(); virtual void setToExternalControl();
virtual void announceMode(bool recursive); virtual void announceMode(bool recursive);
virtual ReturnValue_t letChildHandleMessage(CommandMessage *message); virtual ReturnValue_t letChildHandleMessage(CommandMessage *message);
/** /**
@ -862,6 +861,8 @@ protected:
private: private:
/** /**
* State a cookie is in. * State a cookie is in.
* *
@ -892,6 +893,10 @@ private:
*/ */
CookieInfo cookieInfo; CookieInfo cookieInfo;
/**
* cached from ctor for initialize()
*/
const uint32_t logicalAddress;
/** /**
* Used for timing out mode transitions. * Used for timing out mode transitions.