visibility changes

This commit is contained in:
Robin Müller 2023-11-09 10:45:21 +01:00
parent 0a40391a75
commit 133ca51d18
Signed by: muellerr
GPG Key ID: A649FB78196E3849
2 changed files with 42 additions and 45 deletions

View File

@ -83,6 +83,7 @@ ReturnValue_t FreshDeviceHandlerBase::handleQueue() {
command.setToUnknownCommand();
messageQueue->reply(&command);
}
return result;
}
HasHealthIF::HealthState FreshDeviceHandlerBase::getHealth() { return healthHelper.getHealth(); }
@ -112,9 +113,7 @@ ReturnValue_t FreshDeviceHandlerBase::initializeAfterTaskCreation() {
}
ReturnValue_t FreshDeviceHandlerBase::setHealth(HasHealthIF::HealthState health) {
if (health == HasHealthIF::FAULTY or health == HasHealthIF::PERMANENT_FAULTY) {
// TODO: Go to off where applicable. Health state machine? How does DHB do it?
}
// Assembly should handle commanding to OFF.
healthHelper.setHealth(health);
return returnvalue::OK;
}
@ -140,3 +139,4 @@ ReturnValue_t FreshDeviceHandlerBase::initialize() {
}
return SystemObject::initialize();
}
void FreshDeviceHandlerBase::setToExternalControl() { setHealth(HealthState::EXTERNAL_CONTROL); }

View File

@ -31,7 +31,12 @@ class FreshDeviceHandlerBase : public SystemObject,
public HasLocalDataPoolIF {
public:
explicit FreshDeviceHandlerBase(DhbConfig config);
virtual ~FreshDeviceHandlerBase() override;
~FreshDeviceHandlerBase() override;
/**
* Periodic helper executed function, implemented by child class.
*/
virtual void performDeviceOperation(uint8_t opCode) = 0;
/**
* Implemented by child class. Handle all command messages which are
@ -41,60 +46,23 @@ class FreshDeviceHandlerBase : public SystemObject,
*/
virtual ReturnValue_t handleCommandMessage(CommandMessage* message) = 0;
// HK manager abstract functions.
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override = 0;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override = 0;
// Mode abstract functions
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) override = 0;
/**
* Periodic helper executed function, implemented by child class.
*/
virtual void performDeviceOperation(uint8_t opCode) = 0;
[[nodiscard]] object_id_t getObjectId() const override;
// Executable overrides.
ReturnValue_t performOperation(uint8_t opCode) override;
ReturnValue_t initializeAfterTaskCreation() override;
// System Object overrides.
ReturnValue_t initialize() override;
[[nodiscard]] MessageQueueId_t getCommandQueue() const override;
// Health Overrides.
ReturnValue_t setHealth(HealthState health) override;
HasHealthIF::HealthState getHealth() override;
// Executable Overrides.
void setTaskIF(PeriodicTaskIF* task) override;
// Mode Tree Overrides.
[[nodiscard]] const HasHealthIF* getOptHealthIF() const override;
[[nodiscard]] const HasModesIF& getModeIF() const override;
ReturnValue_t connectModeTreeParent(HasModeTreeChildrenIF& parent) override;
ModeTreeChildIF& getModeTreeChildIF() override;
// Action overrides.
virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) = 0;
[[nodiscard]] uint32_t getPeriodicOperationFrequency() const override;
protected:
virtual ReturnValue_t handleQueue();
// Mode Helpers.
virtual void modeChanged(Mode_t mode, Submode_t submode);
void startTransition(Mode_t mode, Submode_t submode) override;
void getMode(Mode_t* mode, Submode_t* submode) override;
void setToExternalControl() override;
void announceMode(bool recursive) override;
private:
// Pool Manager overrides.
LocalDataPoolManager* getHkManagerHandle() override;
ActionHelper actionHelper;
ModeHelper modeHelper;
HealthHelper healthHelper;
@ -111,6 +79,35 @@ class FreshDeviceHandlerBase : public SystemObject,
MessageQueueIF* messageQueue;
// Pool Manager overrides.
LocalDataPoolManager* getHkManagerHandle() override;
virtual ReturnValue_t handleQueue();
// Mode Helpers.
virtual void modeChanged(Mode_t mode, Submode_t submode);
void startTransition(Mode_t mode, Submode_t submode) override;
void getMode(Mode_t* mode, Submode_t* submode) override;
void setToExternalControl() override;
void announceMode(bool recursive) override;
// System Object overrides.
ReturnValue_t initialize() override;
// HK manager abstract functions.
LocalPoolDataSetBase* getDataSetHandle(sid_t sid) override = 0;
ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override = 0;
// Mode abstract functions
ReturnValue_t checkModeCommand(Mode_t mode, Submode_t submode,
uint32_t* msToReachTheMode) override = 0;
// Health Overrides.
ReturnValue_t setHealth(HealthState health) override;
// Action override. Forward to user.
ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
const uint8_t* data, size_t size) override = 0;
// Executable overrides.
ReturnValue_t performOperation(uint8_t opCode) override;
ReturnValue_t initializeAfterTaskCreation() override;
private:
// Executable Overrides.
void setTaskIF(PeriodicTaskIF* task) override;
};