add start method for uart man
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
This commit is contained in:
@ -20,7 +20,7 @@ using namespace returnvalue;
|
||||
PlocSupervisorHandler::PlocSupervisorHandler(object_id_t objectId, object_id_t uartComIFid,
|
||||
CookieIF* comCookie, Gpio uartIsolatorSwitch,
|
||||
power::Switch_t powerSwitch,
|
||||
PlocSupvUartManager* supvHelper)
|
||||
PlocSupvUartManager& supvHelper)
|
||||
: DeviceHandlerBase(objectId, uartComIFid, comCookie),
|
||||
uartIsolatorSwitch(uartIsolatorSwitch),
|
||||
hkset(this),
|
||||
@ -33,9 +33,6 @@ PlocSupervisorHandler::PlocSupervisorHandler(object_id_t objectId, object_id_t u
|
||||
if (comCookie == nullptr) {
|
||||
sif::error << "PlocSupervisorHandler: Invalid com cookie" << std::endl;
|
||||
}
|
||||
if (supvHelper == nullptr) {
|
||||
sif::error << "PlocSupervisorHandler: Invalid PlocSupvHelper object" << std::endl;
|
||||
}
|
||||
spParams.buf = commandBuffer;
|
||||
spParams.maxSize = sizeof(commandBuffer);
|
||||
eventQueue = QueueFactory::instance()->createMessageQueue(EventMessage::EVENT_MESSAGE_SIZE * 5);
|
||||
@ -52,10 +49,6 @@ ReturnValue_t PlocSupervisorHandler::initialize() {
|
||||
#ifdef XIPHOS_Q7S
|
||||
sdcMan = SdCardManager::instance();
|
||||
#endif /* TE0720_1CFA */
|
||||
if (supvHelper == nullptr) {
|
||||
sif::warning << "PlocSupervisorHandler::initialize: Invalid supervisor helper" << std::endl;
|
||||
return ObjectManagerIF::CHILD_INIT_FAILED;
|
||||
}
|
||||
|
||||
result = eventSubscription();
|
||||
if (result != returnvalue::OK) {
|
||||
@ -87,10 +80,6 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
|
||||
switch (actionId) {
|
||||
case TERMINATE_SUPV_HELPER: {
|
||||
supvHelper->stop();
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@ -114,7 +103,7 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
result = supvHelper->performUpdate(params);
|
||||
result = supvHelper.performUpdate(params);
|
||||
if (result != returnvalue::OK) {
|
||||
return result;
|
||||
}
|
||||
@ -122,7 +111,7 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
case CONTINUE_UPDATE: {
|
||||
supvHelper->initiateUpdateContinuation();
|
||||
supvHelper.initiateUpdateContinuation();
|
||||
plocSupvHelperExecuting = true;
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
@ -135,7 +124,7 @@ ReturnValue_t PlocSupervisorHandler::executeAction(ActionId_t actionId,
|
||||
if (not std::filesystem::exists(params.file)) {
|
||||
return HasFileSystemIF::FILE_DOES_NOT_EXIST;
|
||||
}
|
||||
supvHelper->performMemCheck(params.file, params.memId, params.startAddr);
|
||||
supvHelper.performMemCheck(params.file, params.memId, params.startAddr);
|
||||
plocSupvHelperExecuting = true;
|
||||
return EXECUTION_FINISHED;
|
||||
}
|
||||
@ -150,6 +139,7 @@ void PlocSupervisorHandler::doStartUp() {
|
||||
switch (startupState) {
|
||||
case StartupState::OFF: {
|
||||
bootTimeout.resetTimer();
|
||||
supvHelper.start();
|
||||
startupState = StartupState::BOOTING;
|
||||
break;
|
||||
}
|
||||
@ -177,6 +167,7 @@ void PlocSupervisorHandler::doStartUp() {
|
||||
|
||||
void PlocSupervisorHandler::doShutDown() {
|
||||
setMode(_MODE_POWER_DOWN);
|
||||
supvHelper.stop();
|
||||
uartIsolatorSwitch.pullLow();
|
||||
startupState = StartupState::OFF;
|
||||
}
|
||||
|
Reference in New Issue
Block a user