important bugfixes

This commit is contained in:
Robin Müller 2020-09-28 22:38:36 +02:00
parent e48dbb8797
commit 7e9d095ed1
4 changed files with 21 additions and 3 deletions

View File

@ -59,6 +59,11 @@ uint16_t PoolDataSetBase::getFillCount() const {
ReturnValue_t PoolDataSetBase::readVariable(uint16_t count) { ReturnValue_t PoolDataSetBase::readVariable(uint16_t count) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK; ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
if(registeredVariables[count] == nullptr) {
// configuration error.
return HasReturnvaluesIF::RETURN_FAILED;
}
// These checks are often performed by the respective // These checks are often performed by the respective
// variable implementation too, but I guess a double check does not hurt. // variable implementation too, but I guess a double check does not hurt.
if (registeredVariables[count]->getReadWriteMode() != if (registeredVariables[count]->getReadWriteMode() !=

View File

@ -58,6 +58,7 @@ public:
static constexpr ReturnValue_t WRONG_HK_PACKET_TYPE = MAKE_RETURN_CODE(0x03); static constexpr ReturnValue_t WRONG_HK_PACKET_TYPE = MAKE_RETURN_CODE(0x03);
static constexpr ReturnValue_t REPORTING_STATUS_UNCHANGED = MAKE_RETURN_CODE(0x04); static constexpr ReturnValue_t REPORTING_STATUS_UNCHANGED = MAKE_RETURN_CODE(0x04);
static constexpr ReturnValue_t PERIODIC_HELPER_INVALID = MAKE_RETURN_CODE(0x05); static constexpr ReturnValue_t PERIODIC_HELPER_INVALID = MAKE_RETURN_CODE(0x05);
/** /**
* This constructor is used by a class which wants to implement * This constructor is used by a class which wants to implement
* a personal local data pool. The queueToUse can be supplied if it * a personal local data pool. The queueToUse can be supplied if it
@ -73,14 +74,20 @@ public:
virtual~ LocalDataPoolManager(); virtual~ LocalDataPoolManager();
/** /**
* Initializes the map by calling the map initialization function of the * Assigns the queue to use.
* owner and assigns the queue to use.
* @param queueToUse * @param queueToUse
* @param nonDiagInvlFactor See #setNonDiagnosticIntervalFactor doc * @param nonDiagInvlFactor See #setNonDiagnosticIntervalFactor doc
* @return * @return
*/ */
ReturnValue_t initialize(MessageQueueIF* queueToUse); ReturnValue_t initialize(MessageQueueIF* queueToUse);
/**
* Initializes the map by calling the map initialization function and
* setting the periodic factor for non-diagnostic packets.
* Don't forget to call this, otherwise the map will be invalid!
* @param nonDiagInvlFactor
* @return
*/
ReturnValue_t initializeAfterTaskCreation(uint8_t nonDiagInvlFactor = 5); ReturnValue_t initializeAfterTaskCreation(uint8_t nonDiagInvlFactor = 5);
/** /**

View File

@ -158,7 +158,7 @@ ReturnValue_t InternalErrorReporter::initializeLocalDataPool(
// todo: Only send HK if values have changed, will be supported by // todo: Only send HK if values have changed, will be supported by
// pool manager soon. // pool manager soon.
poolManager.subscribeForPeriodicPacket(internalErrorSid, false, poolManager.subscribeForPeriodicPacket(internalErrorSid, false,
getPeriodicOperationFrequency(), false); getPeriodicOperationFrequency(), true);
return HasReturnvaluesIF::RETURN_OK; return HasReturnvaluesIF::RETURN_OK;
} }
@ -185,3 +185,8 @@ ReturnValue_t InternalErrorReporter::initialize() {
} }
return SystemObject::initialize(); return SystemObject::initialize();
} }
ReturnValue_t InternalErrorReporter::initializeAfterTaskCreation() {
return poolManager.initializeAfterTaskCreation();
}

View File

@ -46,6 +46,7 @@ public:
virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override; virtual LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override;
virtual ReturnValue_t initialize() override; virtual ReturnValue_t initialize() override;
virtual ReturnValue_t initializeAfterTaskCreation() override;
virtual ReturnValue_t performOperation(uint8_t opCode) override; virtual ReturnValue_t performOperation(uint8_t opCode) override;
virtual void queueMessageNotSent(); virtual void queueMessageNotSent();