PL PCDU Update Mode Handling #200
@ -662,8 +662,8 @@ void ObjectFactory::createPayloadComponents(LinuxLibgpioIF* gpioComIF) {
|
|||||||
auto supvGpioCookie = new GpioCookie;
|
auto supvGpioCookie = new GpioCookie;
|
||||||
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
|
supvGpioCookie->addGpio(gpioIds::ENABLE_SUPV_UART, gpioConfigSupv);
|
||||||
gpioComIF->addGpios(supvGpioCookie);
|
gpioComIF->addGpios(supvGpioCookie);
|
||||||
auto supervisorCookie = new UartCookie(
|
auto supervisorCookie = new UartCookie(objects::PLOC_SUPERVISOR_HANDLER,
|
||||||
objects::PLOC_SUPERVISOR_HANDLER, q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL,
|
q7s::UART_PLOC_SUPERVSIOR_DEV, UartModes::NON_CANONICAL,
|
||||||
uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20);
|
uart::PLOC_SUPERVISOR_BAUD, supv::MAX_PACKET_SIZE * 20);
|
||||||
supervisorCookie->setNoFixedSizeReply();
|
supervisorCookie->setNoFixedSizeReply();
|
||||||
new PlocSupervisorHandler(objects::PLOC_SUPERVISOR_HANDLER, objects::UART_COM_IF,
|
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> isSet =
|
||||||
lp_var_t<uint32_t>(sid.objectId, PoolIds::LATCHUP_RPT_TIME_IS_SET, this);
|
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_ */
|
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_PLOCSVPDEFINITIONS_H_ */
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
#include "PlocMPSoCHandler.h"
|
#include "PlocMPSoCHandler.h"
|
||||||
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
|
|
||||||
|
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
#include "fsfw/datapool/PoolReadGuard.h"
|
#include "fsfw/datapool/PoolReadGuard.h"
|
||||||
#include "fsfw/globalfunctions/CRC.h"
|
#include "fsfw/globalfunctions/CRC.h"
|
||||||
|
#include "linux/devices/devicedefinitions/PlocSupervisorDefinitions.h"
|
||||||
|
|
||||||
PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid,
|
PlocMPSoCHandler::PlocMPSoCHandler(object_id_t objectId, object_id_t uartComIFid,
|
||||||
CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper,
|
CookieIF* comCookie, PlocMPSoCHelper* plocMPSoCHelper,
|
||||||
@ -87,8 +87,8 @@ void PlocMPSoCHandler::performOperationHook() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
CommandMessage message;
|
CommandMessage message;
|
||||||
for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message); result == RETURN_OK;
|
for (ReturnValue_t result = commandActionHelperQueue->receiveMessage(&message);
|
||||||
result = commandActionHelperQueue->receiveMessage(&message)) {
|
result == RETURN_OK; result = commandActionHelperQueue->receiveMessage(&message)) {
|
||||||
result = commandActionHelper.handleReply(&message);
|
result = commandActionHelper.handleReply(&message);
|
||||||
if (result == RETURN_OK) {
|
if (result == RETURN_OK) {
|
||||||
continue;
|
continue;
|
||||||
@ -703,32 +703,25 @@ size_t PlocMPSoCHandler::getNextReplyLength(DeviceCommandId_t commandId) {
|
|||||||
return replyLen;
|
return replyLen;
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() {
|
MessageQueueIF* PlocMPSoCHandler::getCommandQueuePtr() { return commandActionHelperQueue; }
|
||||||
return commandActionHelperQueue;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) {
|
void PlocMPSoCHandler::stepSuccessfulReceived(ActionId_t actionId, uint8_t step) { return; }
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
void PlocMPSoCHandler::stepFailedReceived(ActionId_t actionId, uint8_t step,
|
||||||
ReturnValue_t returnCode) {
|
ReturnValue_t returnCode) {
|
||||||
switch (actionId) {
|
switch (actionId) {
|
||||||
case supv::START_MPSOC:
|
case supv::START_MPSOC:
|
||||||
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC"
|
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to start MPSoC" << std::endl;
|
||||||
<< std::endl;
|
|
||||||
powerState = PowerState::OFF;
|
powerState = PowerState::OFF;
|
||||||
break;
|
break;
|
||||||
case supv::SHUTDOWN_MPSOC:
|
case supv::SHUTDOWN_MPSOC:
|
||||||
triggerEvent(MPSOC_SHUTDOWN_FAILED);
|
triggerEvent(MPSOC_SHUTDOWN_FAILED);
|
||||||
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC"
|
sif::warning << "PlocMPSoCHandler::stepFailedReceived: Failed to shutdown MPSoC" << std::endl;
|
||||||
<< std::endl;
|
|
||||||
// TODO: Setting state to on or off here?
|
// TODO: Setting state to on or off here?
|
||||||
powerState = PowerState::ON;
|
powerState = PowerState::ON;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sif::debug
|
sif::debug << "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
|
||||||
<< "PlocMPSoCHandler::stepFailedReceived: Received unexpected action reply"
|
|
||||||
<< std::endl;
|
<< std::endl;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -489,8 +489,8 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
|
|||||||
switch (command->first) {
|
switch (command->first) {
|
||||||
case supv::GET_HK_REPORT: {
|
case supv::GET_HK_REPORT: {
|
||||||
enabledReplies = 3;
|
enabledReplies = 3;
|
||||||
result = DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true,
|
result =
|
||||||
supv::HK_REPORT);
|
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::HK_REPORT);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
|
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
|
||||||
<< supv::HK_REPORT << " not in replyMap" << std::endl;
|
<< supv::HK_REPORT << " not in replyMap" << std::endl;
|
||||||
@ -589,15 +589,15 @@ ReturnValue_t PlocSupervisorHandler::enableReplyInReplyMap(DeviceCommandMap::ite
|
|||||||
result =
|
result =
|
||||||
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT);
|
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::ACK_REPORT);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
|
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::ACK_REPORT
|
||||||
<< supv::ACK_REPORT << " not in replyMap" << std::endl;
|
<< " not in replyMap" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
result =
|
result =
|
||||||
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT);
|
DeviceHandlerBase::enableReplyInReplyMap(command, enabledReplies, true, supv::EXE_REPORT);
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id "
|
sif::debug << "PlocSupervisorHandler::enableReplyInReplyMap: Reply with id " << supv::EXE_REPORT
|
||||||
<< supv::EXE_REPORT << " not in replyMap" << std::endl;
|
<< " not in replyMap" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
@ -1459,8 +1459,7 @@ ReturnValue_t PlocSupervisorHandler::handleMramDumpFile(DeviceCommandId_t id) {
|
|||||||
return MRAM_FILE_NOT_EXISTS;
|
return MRAM_FILE_NOT_EXISTS;
|
||||||
}
|
}
|
||||||
std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out);
|
std::ofstream file(activeMramFile, std::ios_base::app | std::ios_base::out);
|
||||||
file.write(
|
file.write(reinterpret_cast<const char*>(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH),
|
||||||
reinterpret_cast<const char*>(spacePacketBuffer + supv::SPACE_PACKET_HEADER_LENGTH),
|
|
||||||
packetLen - 1);
|
packetLen - 1);
|
||||||
file.close();
|
file.close();
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
|
@ -262,12 +262,11 @@ void PlocUpdater::commandUpdateAvailable() {
|
|||||||
calcImageCrc();
|
calcImageCrc();
|
||||||
|
|
||||||
supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image),
|
supv::UpdateInfo packet(supv::APID_UPDATE_AVAILABLE, static_cast<uint8_t>(image),
|
||||||
static_cast<uint8_t>(partition), imageSize, imageCrc,
|
static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
|
||||||
numOfUpdatePackets);
|
|
||||||
|
|
||||||
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER,
|
result =
|
||||||
supv::UPDATE_AVAILABLE, packet.getWholeData(),
|
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_AVAILABLE,
|
||||||
packet.getFullSize());
|
packet.getWholeData(), packet.getFullSize());
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
|
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
|
||||||
<< " packet to supervisor handler" << std::endl;
|
<< " packet to supervisor handler" << std::endl;
|
||||||
@ -311,9 +310,9 @@ void PlocUpdater::commandUpdatePacket() {
|
|||||||
}
|
}
|
||||||
packet.makeCrc();
|
packet.makeCrc();
|
||||||
|
|
||||||
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER,
|
result =
|
||||||
supv::UPDATE_IMAGE_DATA, packet.getWholeData(),
|
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_IMAGE_DATA,
|
||||||
packet.getFullSize());
|
packet.getWholeData(), packet.getFullSize());
|
||||||
|
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update"
|
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update"
|
||||||
@ -335,11 +334,9 @@ void PlocUpdater::commandUpdateVerify() {
|
|||||||
ReturnValue_t result = RETURN_OK;
|
ReturnValue_t result = RETURN_OK;
|
||||||
|
|
||||||
supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast<uint8_t>(image),
|
supv::UpdateInfo packet(supv::APID_UPDATE_VERIFY, static_cast<uint8_t>(image),
|
||||||
static_cast<uint8_t>(partition), imageSize, imageCrc,
|
static_cast<uint8_t>(partition), imageSize, imageCrc, numOfUpdatePackets);
|
||||||
numOfUpdatePackets);
|
|
||||||
|
|
||||||
result =
|
result = commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
|
||||||
commandActionHelper.commandAction(objects::PLOC_SUPERVISOR_HANDLER, supv::UPDATE_VERIFY,
|
|
||||||
packet.getWholeData(), packet.getFullSize());
|
packet.getWholeData(), packet.getFullSize());
|
||||||
if (result != RETURN_OK) {
|
if (result != RETURN_OK) {
|
||||||
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
|
sif::warning << "PlocUpdater::commandUpdateAvailable: Failed to send update available"
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
#include "ArcsecJsonParamBase.h"
|
#include "ArcsecJsonParamBase.h"
|
||||||
#include "OBSWConfig.h"
|
#include "OBSWConfig.h"
|
||||||
#include "StrHelper.h"
|
#include "StrHelper.h"
|
||||||
|
#include "devices/powerSwitcherList.h"
|
||||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||||
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
|
#include "fsfw/src/fsfw/serialize/SerializeAdapter.h"
|
||||||
#include "fsfw/timemanager/Countdown.h"
|
#include "fsfw/timemanager/Countdown.h"
|
||||||
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h"
|
||||||
#include "thirdparty/arcsec_star_tracker/common/SLIP.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.
|
* @brief This is the device handler for the star tracker from arcsec.
|
||||||
|
@ -441,6 +441,9 @@ ReturnValue_t P60DockHandler::initializeLocalDataPool(localpool::DataPool &local
|
|||||||
localDataPoolMap.emplace(P60System::P60DOCK_ANT6_DEPL, new PoolEntry<int8_t>({0}));
|
localDataPoolMap.emplace(P60System::P60DOCK_ANT6_DEPL, new PoolEntry<int8_t>({0}));
|
||||||
localDataPoolMap.emplace(P60System::P60DOCK_AR6_DEPL, new PoolEntry<int8_t>({0}));
|
localDataPoolMap.emplace(P60System::P60DOCK_AR6_DEPL, new PoolEntry<int8_t>({0}));
|
||||||
|
|
||||||
|
#if OBSW_ENABLE_PERIODIC_HK == 1
|
||||||
|
poolManager.subscribeForPeriodicPacket(p60dockHkTableDataset.getSid(), false, 0.8, true);
|
||||||
|
#endif
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ void PayloadPcduHandler::doTransition(Mode_t modeFrom, Submode_t subModeFrom) {
|
|||||||
|
|
||||||
ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subModeFrom) {
|
ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_t subModeFrom) {
|
||||||
using namespace plpcdu;
|
using namespace plpcdu;
|
||||||
if (submode == NormalSubmodes::SOLID_STATE_RELAYS_ADC_ON) {
|
if (((submode >> SOLID_STATE_RELAYS_ADC_ON) & 0b1) == 1) {
|
||||||
if (state == States::PL_PCDU_OFF) {
|
if (state == States::PL_PCDU_OFF) {
|
||||||
sif::error << "PayloadPcduHandler::stateMachineToNormal: Unexpected state PL_PCDU_OFF"
|
sif::error << "PayloadPcduHandler::stateMachineToNormal: Unexpected state PL_PCDU_OFF"
|
||||||
<< "detected" << std::endl;
|
<< "detected" << std::endl;
|
||||||
@ -116,7 +116,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (submode == NormalSubmodes::DRO_ON) {
|
if (((submode >> DRO_ON) & 1) == 1) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
sif::info << "Enabling PL PCDU DRO module" << std::endl;
|
sif::info << "Enabling PL PCDU DRO module" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -127,7 +127,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
|||||||
setMode(MODE_NORMAL, submode);
|
setMode(MODE_NORMAL, submode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (submode == NormalSubmodes::X8_ON) {
|
if (((submode >> X8_ON) & 1) == 1) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
sif::info << "Enabling PL PCDU X8 module" << std::endl;
|
sif::info << "Enabling PL PCDU X8 module" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -138,7 +138,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
|||||||
setMode(MODE_NORMAL, submode);
|
setMode(MODE_NORMAL, submode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (submode == NormalSubmodes::TX_ON) {
|
if (((submode >> TX_ON) & 1) == 1) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
sif::info << "Enabling PL PCDU TX module" << std::endl;
|
sif::info << "Enabling PL PCDU TX module" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -149,7 +149,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
|||||||
setMode(MODE_NORMAL, submode);
|
setMode(MODE_NORMAL, submode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (submode == NormalSubmodes::MPA_ON) {
|
if (((submode >> MPA_ON) & 1) == 1) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
sif::info << "Enabling PL PCDU MPA module" << std::endl;
|
sif::info << "Enabling PL PCDU MPA module" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -160,7 +160,7 @@ ReturnValue_t PayloadPcduHandler::stateMachineToNormal(Mode_t modeFrom, Submode_
|
|||||||
setMode(MODE_NORMAL, submode);
|
setMode(MODE_NORMAL, submode);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (submode == NormalSubmodes::HPA_ON) {
|
if (((submode >> HPA_ON) & 1) == 1) {
|
||||||
#if OBSW_VERBOSE_LEVEL >= 1
|
#if OBSW_VERBOSE_LEVEL >= 1
|
||||||
sif::info << "Enabling PL PCDU HPA module" << std::endl;
|
sif::info << "Enabling PL PCDU HPA module" << std::endl;
|
||||||
#endif
|
#endif
|
||||||
@ -549,24 +549,30 @@ ReturnValue_t PayloadPcduHandler::isModeCombinationValid(Mode_t mode, Submode_t
|
|||||||
using namespace plpcdu;
|
using namespace plpcdu;
|
||||||
if (mode == MODE_NORMAL) {
|
if (mode == MODE_NORMAL) {
|
||||||
// Also deals with the case where the mode is MODE_ON, submode should be 0 here
|
// Also deals with the case where the mode is MODE_ON, submode should be 0 here
|
||||||
if (submode == NormalSubmodes::SOLID_STATE_RELAYS_ADC_ON and
|
if ((((submode >> SOLID_STATE_RELAYS_ADC_ON) & 0b1) == SOLID_STATE_RELAYS_ADC_ON) and
|
||||||
(this->mode == MODE_NORMAL and this->submode != NormalSubmodes::ALL_OFF)) {
|
(this->mode == MODE_NORMAL and this->submode != ALL_OFF_SUBMODE)) {
|
||||||
return TRANS_NOT_ALLOWED;
|
return TRANS_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
if ((submode == NormalSubmodes::DRO_ON and
|
if (((((submode >> DRO_ON) & 1) == 1) and
|
||||||
this->submode != NormalSubmodes::SOLID_STATE_RELAYS_ADC_ON)) {
|
(this->submode != (1 << SOLID_STATE_RELAYS_ADC_ON)))) {
|
||||||
return TRANS_NOT_ALLOWED;
|
return TRANS_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
if ((submode == NormalSubmodes::X8_ON and this->submode != NormalSubmodes::DRO_ON)) {
|
if ((((submode >> X8_ON) & 1) == 1) and
|
||||||
|
(this->submode != ((1 << SOLID_STATE_RELAYS_ADC_ON) | (1 << DRO_ON)))) {
|
||||||
return TRANS_NOT_ALLOWED;
|
return TRANS_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
if ((submode == NormalSubmodes::TX_ON and this->submode != NormalSubmodes::X8_ON)) {
|
if (((((submode >> TX_ON) & 1) == 1) and
|
||||||
|
(this->submode != ((1 << X8_ON) | (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) {
|
||||||
return TRANS_NOT_ALLOWED;
|
return TRANS_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
if ((submode == NormalSubmodes::MPA_ON and this->submode != NormalSubmodes::TX_ON)) {
|
if ((((submode >> MPA_ON) & 1) == 1 and
|
||||||
|
(this->submode !=
|
||||||
|
((1 << TX_ON) | (1 << X8_ON) | (1 << DRO_ON) | (1 << SOLID_STATE_RELAYS_ADC_ON))))) {
|
||||||
return TRANS_NOT_ALLOWED;
|
return TRANS_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
if ((submode == NormalSubmodes::HPA_ON and this->submode != NormalSubmodes::MPA_ON)) {
|
if ((((submode >> HPA_ON) & 1) == 1 and
|
||||||
|
(this->submode != ((1 << MPA_ON) | (1 << TX_ON) | (1 << X8_ON) | (1 << DRO_ON) |
|
||||||
|
(1 << SOLID_STATE_RELAYS_ADC_ON))))) {
|
||||||
return TRANS_NOT_ALLOWED;
|
return TRANS_NOT_ALLOWED;
|
||||||
}
|
}
|
||||||
return HasReturnvaluesIF::RETURN_OK;
|
return HasReturnvaluesIF::RETURN_OK;
|
||||||
|
@ -139,42 +139,45 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic
|
|||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
case (SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE): {
|
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();
|
rawPacketLen = readTxAgcValueHighByte.size();
|
||||||
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE;
|
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_HIGH_BYTE;
|
||||||
rawPacket = commandBuffer;
|
rawPacket = commandBuffer;
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
case (SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE): {
|
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();
|
rawPacketLen = readTxAgcValueLowByte.size();
|
||||||
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE;
|
rememberCommandId = SYRLINKS::READ_TX_AGC_VALUE_LOW_BYTE;
|
||||||
rawPacket = commandBuffer;
|
rawPacket = commandBuffer;
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
case (SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE):
|
||||||
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardHighByte.size(),
|
tempPowerAmpBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||||
0);
|
tempPowerAmpBoardHighByte.size(), 0);
|
||||||
rawPacketLen = tempPowerAmpBoardHighByte.size();
|
rawPacketLen = tempPowerAmpBoardHighByte.size();
|
||||||
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_HIGH_BYTE;
|
||||||
rawPacket = commandBuffer;
|
rawPacket = commandBuffer;
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
case (SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE):
|
||||||
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer), tempPowerAmpBoardLowByte.size(),
|
tempPowerAmpBoardLowByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||||
0);
|
tempPowerAmpBoardLowByte.size(), 0);
|
||||||
rawPacketLen = tempPowerAmpBoardLowByte.size();
|
rawPacketLen = tempPowerAmpBoardLowByte.size();
|
||||||
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
rememberCommandId = SYRLINKS::TEMP_POWER_AMPLIFIER_LOW_BYTE;
|
||||||
rawPacket = commandBuffer;
|
rawPacket = commandBuffer;
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE):
|
case (SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE):
|
||||||
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer), tempBasebandBoardHighByte.size(),
|
tempBasebandBoardHighByte.copy(reinterpret_cast<char*>(commandBuffer),
|
||||||
0);
|
tempBasebandBoardHighByte.size(), 0);
|
||||||
rawPacketLen = tempBasebandBoardHighByte.size();
|
rawPacketLen = tempBasebandBoardHighByte.size();
|
||||||
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_HIGH_BYTE;
|
||||||
rawPacket = commandBuffer;
|
rawPacket = commandBuffer;
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
case (SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE):
|
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();
|
rawPacketLen = tempBasebandBoardLowByte.size();
|
||||||
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
rememberCommandId = SYRLINKS::TEMP_BASEBAND_BOARD_LOW_BYTE;
|
||||||
rawPacket = commandBuffer;
|
rawPacket = commandBuffer;
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
#ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
#ifndef MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
||||||
#define MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
#define MISSION_DEVICES_SYRLINKSHKHANDLER_H_
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "devices/powerSwitcherList.h"
|
#include "devices/powerSwitcherList.h"
|
||||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief This is the device handler for the syrlinks transceiver. It handles the command
|
* @brief This is the device handler for the syrlinks transceiver. It handles the command
|
||||||
|
@ -91,16 +91,17 @@ static constexpr DeviceCommandId_t SETUP_CMD = 1;
|
|||||||
static constexpr DeviceCommandId_t READ_TEMP_EXT = 2;
|
static constexpr DeviceCommandId_t READ_TEMP_EXT = 2;
|
||||||
static constexpr DeviceCommandId_t READ_WITH_TEMP_EXT = 3;
|
static constexpr DeviceCommandId_t READ_WITH_TEMP_EXT = 3;
|
||||||
|
|
||||||
enum NormalSubmodes {
|
enum NormalSubmodeBits {
|
||||||
ALL_OFF = 0,
|
SOLID_STATE_RELAYS_ADC_ON = 0,
|
||||||
SOLID_STATE_RELAYS_ADC_ON = 1,
|
DRO_ON = 1,
|
||||||
DRO_ON = 2,
|
X8_ON = 2,
|
||||||
X8_ON = 3,
|
TX_ON = 3,
|
||||||
TX_ON = 4,
|
MPA_ON = 4,
|
||||||
MPA_ON = 5,
|
HPA_ON = 5
|
||||||
HPA_ON = 6
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static constexpr Submode_t ALL_OFF_SUBMODE = 0;
|
||||||
|
|
||||||
// 12 ADC values * 2 + trailing zero
|
// 12 ADC values * 2 + trailing zero
|
||||||
static constexpr size_t ADC_REPLY_SIZE = 25;
|
static constexpr size_t ADC_REPLY_SIZE = 25;
|
||||||
// Conversion byte + 24 * zero
|
// Conversion byte + 24 * zero
|
||||||
|
Loading…
Reference in New Issue
Block a user