action
container
contrib
controller
coordinates
datalinklayer
datapool
CMakeLists.txt
DataSetIF.h
HkSwitchHelper.cpp
HkSwitchHelper.h
PoolDataSetBase.cpp
PoolDataSetBase.h
PoolDataSetIF.h
PoolEntry.cpp
PoolEntry.h
PoolEntryIF.h
PoolVarList.h
PoolVariableIF.h
SharedDataSetIF.h
datapoollocal
defaultcfg
devicehandlers
events
fdir
globalfunctions
health
housekeeping
internalError
ipc
logo
memory
modes
monitoring
objectmanager
osal
parameters
power
pus
returnvalues
rmap
serialize
serviceinterface
storagemanager
subsystem
tasks
tcdistribution
thermal
timemanager
tmstorage
tmtcpacket
tmtcservices
unittest
.gitignore
.gitmodules
CHANGELOG
CMakeLists.txt
FSFWVersion.h
LICENSE
NOTICE
README.md
fsfw.mk
76 lines
2.0 KiB
C++
76 lines
2.0 KiB
C++
#include "../datapool/HkSwitchHelper.h"
|
|
#include "../ipc/QueueFactory.h"
|
|
|
|
HkSwitchHelper::HkSwitchHelper(EventReportingProxyIF* eventProxy) :
|
|
commandActionHelper(this), eventProxy(eventProxy) {
|
|
actionQueue = QueueFactory::instance()->createMessageQueue();
|
|
}
|
|
|
|
HkSwitchHelper::~HkSwitchHelper() {
|
|
// TODO Auto-generated destructor stub
|
|
}
|
|
|
|
ReturnValue_t HkSwitchHelper::initialize() {
|
|
ReturnValue_t result = commandActionHelper.initialize();
|
|
|
|
if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
return result;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
ReturnValue_t HkSwitchHelper::performOperation(uint8_t operationCode) {
|
|
CommandMessage command;
|
|
while (actionQueue->receiveMessage(&command) == HasReturnvaluesIF::RETURN_OK) {
|
|
ReturnValue_t result = commandActionHelper.handleReply(&command);
|
|
if (result == HasReturnvaluesIF::RETURN_OK) {
|
|
continue;
|
|
}
|
|
command.setToUnknownCommand();
|
|
actionQueue->reply(&command);
|
|
}
|
|
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
}
|
|
|
|
void HkSwitchHelper::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) {
|
|
}
|
|
|
|
void HkSwitchHelper::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
|
ReturnValue_t returnCode) {
|
|
eventProxy->forwardEvent(SWITCHING_TM_FAILED, returnCode, actionId);
|
|
}
|
|
|
|
void HkSwitchHelper::dataReceived(ActionId_t actionId, const uint8_t* data,
|
|
uint32_t size) {
|
|
}
|
|
|
|
void HkSwitchHelper::completionSuccessfulReceived(ActionId_t actionId) {
|
|
}
|
|
|
|
void HkSwitchHelper::completionFailedReceived(ActionId_t actionId,
|
|
ReturnValue_t returnCode) {
|
|
eventProxy->forwardEvent(SWITCHING_TM_FAILED, returnCode, actionId);
|
|
}
|
|
|
|
ReturnValue_t HkSwitchHelper::switchHK(SerializeIF* sids, bool enable) {
|
|
// ActionId_t action = HKService::DISABLE_HK;
|
|
// if (enable) {
|
|
// action = HKService::ENABLE_HK;
|
|
// }
|
|
//
|
|
// ReturnValue_t result = commandActionHelper.commandAction(
|
|
// objects::PUS_HK_SERVICE, action, sids);
|
|
//
|
|
// if (result != HasReturnvaluesIF::RETURN_OK) {
|
|
// eventProxy->forwardEvent(SWITCHING_TM_FAILED, result);
|
|
// }
|
|
// return result;
|
|
return HasReturnvaluesIF::RETURN_OK;
|
|
}
|
|
|
|
MessageQueueIF* HkSwitchHelper::getCommandQueuePtr() {
|
|
return actionQueue;
|
|
}
|