apply auto-formatter #197
@ -662,8 +662,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
|
||||
auto supvGpioCookie = new GpioCookie;
|
||||
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
|
||||
gpioComIF->addGpios(supvGpioCookie);
|
||||
auto supervisorCookie = new UartCookie(
|
||||
objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL,
|
||||
auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER,
|
||||
q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL,
|
||||
uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20);
|
||||
supervisorCookie->setNoFixedSizeReply();
|
||||
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
|
||||
|
@ -1541,6 +1541,6 @@ class LatchupStatusReport : public StaticLocalDataSet<LATCHUP_RPT_SET_ENTRIES> {
|
||||
lp_var_t<uint32_t> isSet =
|
||||
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this);
|
||||
};
|
||||
} // namespace PLOC_SPV
|
||||
} // namespace supv
|
||||
|
||||
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */
|
||||
|
@ -1,9 +1,9 @@
|
||||
#include "PlocMPSoCHandler.h"
|
||||
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/datapool/PoolReadGuard.h"
|
||||
#include "fsfw/globalfunctions/CRC.h"
|
||||
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
|
||||
|
||||
PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid,
|
||||
CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper,
|
||||
@ -87,8 +87,8 @@ void PlocMPSoCHandler::performOperationHook() {
|
||||
}
|
||||
}
|
||||
CommandMessage message;
|
||||
for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); result == RETURN_OK;
|
||||
result = commandActionHelperQueue->receiveMessage(&message)) {
|
||||
for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message);
|
||||
result == RETURN_OK; result = commandActionHelperQueue->receiveMessage(&message)) {
|
||||
result = commandActionHelper.handleReply(&message);
|
||||
if (result == RETURN_OK) {
|
||||
continue;
|
||||
@ -703,32 +703,25 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
|
||||
return replyLen;
|
||||
}
|
||||
|
||||
MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() {
|
||||
return commandActionHelperQueue;
|
||||
}
|
||||
MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; }
|
||||
|
||||
void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) {
|
||||
return;
|
||||
}
|
||||
void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; }
|
||||
|
||||
void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
||||
ReturnValue_t returnCode) {
|
||||
switch (actionId) {
|
||||
case supv::START_MPSOC:
|
||||
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC"
|
||||
<< std::endl;
|
||||
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl;
|
||||
powerState = PowerState::OFF;
|
||||
break;
|
||||
case supv::SHUTDOWN_MPSOC:
|
||||
triggerEvent(MPSOC_SHUTDOWN_FAILED);
|
||||
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC"
|
||||
<< std::endl;
|
||||
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl;
|
||||
// TODO: Setting state to on or off here?
|
||||
powerState = PowerState::ON;
|
||||
break;
|
||||
default:
|
||||
sif::debug
|
||||
<< "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
|
||||
sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
|
||||
<< std::endl;
|
||||
break;
|
||||
}
|
||||
|
@ -489,8 +489,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
|
||||
switch (command->first) {
|
||||
case supv::GET_HK_REPORT: {
|
||||
enabledReplies = 3;
|
||||
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true,
|
||||
supv::HK_REPORT);
|
||||
result =
|
||||
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::HK_REPORT);
|
||||
if (result != RETURN_OK) {
|
||||
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
|
||||
<< supv::HK_REPORT << " not in replyMap" << std::endl;
|
||||
@ -589,15 +589,15 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
|
||||
result =
|
||||
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT);
|
||||
if (result != RETURN_OK) {
|
||||
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
|
||||
<< supv::ACK_REPORT << " not in replyMap" << std::endl;
|
||||
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::ACK_REPORT
|
||||
<< " not in replyMap" << std::endl;
|
||||
}
|
||||
|
||||
result =
|
||||
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT);
|
||||
if (result != RETURN_OK) {
|
||||
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
|
||||
<< supv::EXE_REPORT << " not in replyMap" << std::endl;
|
||||
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::EXE_REPORT
|
||||
<< " not in replyMap" << std::endl;
|
||||
}
|
||||
|
||||
return RETURN_OK;
|
||||
@ -1459,8 +1459,7 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) {
|
||||
return MRAM_FILE_NOT_EXISTS;
|
||||
}
|
||||
std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out);
|
||||
file.write(
|
||||
reinterpret_cast<const char*>(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH),
|
||||
file.write(reinterpret_cast<const char*>(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH),
|
||||
packetLen - 1);
|
||||
file.close();
|
||||
return RETURN_OK;
|
||||
|
@ -262,12 +262,11 @@ void PlocUpdater::commandUpdateAvailable() {
|
||||
calcImageCrc();
|
||||
|
||||
supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image),
|
||||
static_cast<uint8_t>(partition), imageSize, imageCrc,
|
||||
numOfUpdatePackets);
|
||||
static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
|
||||
|
||||
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER,
|
||||
supv::UPDATE_AVAILABLE, packet.getWholeData(),
|
||||
packet.getFullSize());
|
||||
result =
|
||||
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE,
|
||||
packet.getWholeData(), packet.getFullSize());
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
|
||||
<< " packet to supervisor handler" << std::endl;
|
||||
@ -311,9 +310,9 @@ void PlocUpdater::commandUpdatePacket() {
|
||||
}
|
||||
packet.makeCrc();
|
||||
|
||||
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER,
|
||||
supv::UPDATE_IMAGE_DATA, packet.getWholeData(),
|
||||
packet.getFullSize());
|
||||
result =
|
||||
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA,
|
||||
packet.getWholeData(), packet.getFullSize());
|
||||
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update"
|
||||
@ -335,11 +334,9 @@ void PlocUpdater::commandUpdateVerify() {
|
||||
ReturnValue_t result = RETURN_OK;
|
||||
|
||||
supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast<uint8_t>(image),
|
||||
static_cast<uint8_t>(partition), imageSize, imageCrc,
|
||||
numOfUpdatePackets);
|
||||
static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
|
||||
|
||||
result =
|
||||
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
|
||||
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
|
||||
packet.getWholeData(), packet.getFullSize());
|
||||
if (result != RETURN_OK) {
|
||||
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
|
||||
|
@ -7,12 +7,12 @@
|
||||
#include "ArcsecJsonParamBase.h"
|
||||
#include "OBSWConfig.h"
|
||||
#include "StrHelper.h"
|
||||
#include "devices/powerSwitcherList.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
|
||||
#include "fsfw/timemanager/Countdown.h"
|
||||
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
||||
#include "thirdparty/arcsec_star_tracker/common/SLIP.h"
|
||||
#include "devices/powerSwitcherList.h"
|
||||
|
||||
/**
|
||||
* @brief This is the device handler for the star tracker from arcsec.
|
||||
|
@ -139,42 +139,45 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic
|
||||
return RETURN_OK;
|
||||
}
|
||||
case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): {
|
||||
readTxAgcValueHighByte.copy(reinterpret_cast<char*>(commandBuffer), readTxAgcValueHighByte.size(), 0);
|
||||
readTxAgcValueHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
readTxAgcValueHighByte.size(), 0);
|
||||
rawPacketLen = readTxAgcValueHighByte.size();
|
||||
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
}
|
||||
case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): {
|
||||
readTxAgcValueLowByte.copy(reinterpret_cast<char*>(commandBuffer), readTxAgcValueLowByte.size(), 0);
|
||||
readTxAgcValueLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
readTxAgcValueLowByte.size(), 0);
|
||||
rawPacketLen = readTxAgcValueLowByte.size();
|
||||
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
}
|
||||
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
||||
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardHighByte.size(),
|
||||
0);
|
||||
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
tempPowerAmpBoardHighByte.size(), 0);
|
||||
rawPacketLen = tempPowerAmpBoardHighByte.size();
|
||||
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
||||
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardLowByte.size(),
|
||||
0);
|
||||
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
tempPowerAmpBoardLowByte.size(), 0);
|
||||
rawPacketLen = tempPowerAmpBoardLowByte.size();
|
||||
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE):
|
||||
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempBasebandBoardHighByte.size(),
|
||||
0);
|
||||
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
tempBasebandBoardHighByte.size(), 0);
|
||||
rawPacketLen = tempBasebandBoardHighByte.size();
|
||||
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
return RETURN_OK;
|
||||
case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE):
|
||||
tempBasebandBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer), tempBasebandBoardLowByte.size(), 0);
|
||||
tempBasebandBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||
tempBasebandBoardLowByte.size(), 0);
|
||||
rawPacketLen = tempBasebandBoardLowByte.size();
|
||||
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
||||
rawPacket = commandBuffer;
|
||||
|
@ -1,10 +1,11 @@
|
||||
#ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
||||
#define MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "devices/powerSwitcherList.h"
|
||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||
#include <string.h>
|
||||
|
||||
/**
|
||||
* @brief This is the device handler for the syrlinks transceiver. It handles the command
|
||||
|
Loading…
Reference in New Issue
Block a user