This commit is contained in:
@ -1,10 +1,55 @@
|
||||
/*
|
||||
* FreshSupvHandler.cpp
|
||||
*
|
||||
* Created on: Nov 9, 2023
|
||||
* Author: rmueller
|
||||
*/
|
||||
#include "FreshSupvHandler.h"
|
||||
|
||||
FreshSupvHandler::FreshSupvHandler(DhbConfig cfg) : FreshDeviceHandlerBase(cfg) {}
|
||||
|
||||
void FreshSupvHandler::performDeviceOperation(uint8_t opCode) {
|
||||
if (!transitionActive and mode == MODE_OFF) {
|
||||
// Nothing to do for now.
|
||||
return;
|
||||
}
|
||||
if (opCode == OpCode::DEFAULT_OPERATION) {
|
||||
if (transitionActive) {
|
||||
// TODO: Perform transition handling: OFF to ON and ON to OFF.
|
||||
|
||||
} else {
|
||||
if (mode == MODE_NORMAL) {
|
||||
// Normal mode handling. Request normal datasets and add them to command map.
|
||||
}
|
||||
}
|
||||
// TODO: Check whether any active commands have timeouted.
|
||||
} else if (opCode == OpCode::HANDLE_ACTIVE_CMDS) {
|
||||
// TODO: Parse TM from ring buffer and check whether they complete any active commands.
|
||||
// If they do, check whether anyone needs to be informed.
|
||||
}
|
||||
}
|
||||
|
||||
ReturnValue_t FreshSupvHandler::handleCommandMessage(CommandMessage *message) {
|
||||
// No custom messages.
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
|
||||
LocalPoolDataSetBase *FreshSupvHandler::getDataSetHandle(sid_t sid) {
|
||||
// TODO: return all relevant datasets.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
ReturnValue_t FreshSupvHandler::initializeLocalDataPool(localpool::DataPool &localDataPoolMap,
|
||||
LocalDataPoolManager &poolManager) {
|
||||
// TODO: Copy code from god handler here.
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t FreshSupvHandler::executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||
const uint8_t *data, size_t size) {
|
||||
// TODO: Handle all commands here. Need to add them to some command map. Send command immediately
|
||||
// then.
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t FreshSupvHandler::checkModeCommand(Mode_t mode_, Submode_t submode_,
|
||||
uint32_t *msToReachTheMode) {
|
||||
if (mode_ != HasModesIF::MODE_OFF and mode_ != HasModesIF::MODE_ON and mode_ != MODE_NORMAL) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user