dhb cached pst interval now

This commit is contained in:
Robin Müller 2020-06-29 16:37:55 +02:00
parent ae6314d8cd
commit 044aa259e6
2 changed files with 18 additions and 2 deletions

View File

@ -1374,6 +1374,15 @@ ReturnValue_t DeviceHandlerBase::changeCollectionInterval(sid_t sid,
return HasReturnvaluesIF::RETURN_OK;
}
ReturnValue_t DeviceHandlerBase::initializeAfterTaskCreation() {
// In this function, the task handle should be valid in any case.
// We still check to be 1000 % sure :-)
if(executingTask != nullptr) {
pstIntervalMs = executingTask->getPeriodMs();
}
return HasReturnvaluesIF::RETURN_OK;
}
DataSetIF* DeviceHandlerBase::getDataSetHandle(sid_t sid) {
auto iter = deviceReplyMap.find(sid.ownerSetId);
if(iter != deviceReplyMap.end()) {

View File

@ -11,6 +11,8 @@
#include <framework/modes/HasModesIF.h>
#include <framework/power/PowerSwitchIF.h>
#include <framework/ipc/MessageQueueIF.h>
#include <framework/tasks/PeriodicTaskIF.h>
#include <framework/action/ActionHelper.h>
#include <framework/health/HealthHelper.h>
#include <framework/parameters/ParameterHelper.h>
@ -18,6 +20,7 @@
#include <framework/datapoollocal/LocalDataPoolManager.h>
#include <framework/devicehandlers/DeviceHandlerFailureIsolation.h>
#include <framework/datapoollocal/OwnsLocalDataPoolIF.h>
#include <map>
namespace Factory{
@ -563,6 +566,8 @@ protected:
/** This is the counter value from performOperation(). */
uint8_t pstStep = 0;
uint32_t pstIntervalMs = 0;
/**
* Wiretapping flag:
*
@ -1196,9 +1201,11 @@ private:
ReturnValue_t handleDeviceHandlerMessage(CommandMessage *message);
void parseReply(const uint8_t* receivedData,
size_t receivedDataLen);
virtual ReturnValue_t initializeAfterTaskCreation() override;
DataSetIF* getDataSetHandle(sid_t sid) override;
void parseReply(const uint8_t* receivedData,
size_t receivedDataLen);
};
#endif /* DEVICEHANDLERBASE_H_ */