Update to v1.8.0 #100
@ -99,6 +99,7 @@ void GomspaceDeviceHandler::fillCommandAndReplyMap(){
|
||||
this->insertInCommandAndReplyMap(GOMSPACE::PARAM_GET, 3);
|
||||
this->insertInCommandAndReplyMap(GOMSPACE::REQUEST_HK_TABLE, 3);
|
||||
this->insertInCommandMap(GOMSPACE::GNDWDT_RESET);
|
||||
this->insertInCommandMap(GOMSPACE::PRINT_OUT_ENB_STATUS);
|
||||
}
|
||||
|
||||
ReturnValue_t GomspaceDeviceHandler::scanForReply(const uint8_t *start,
|
||||
|
@ -1,11 +1,13 @@
|
||||
#include "OBSWConfig.h"
|
||||
#include "PDU2Handler.h"
|
||||
|
||||
#include <mission/devices/devicedefinitions/GomSpacePackets.h>
|
||||
#include <OBSWConfig.h>
|
||||
#include <fsfw/datapool/PoolReadGuard.h>
|
||||
|
||||
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF * comCookie) :
|
||||
GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
|
||||
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, &pdu2HkTableDataset), pdu2HkTableDataset(
|
||||
this) {
|
||||
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE, &pdu2HkTableDataset),
|
||||
pdu2HkTableDataset(this) {
|
||||
}
|
||||
|
||||
PDU2Handler::~PDU2Handler() {
|
||||
@ -34,23 +36,7 @@ void PDU2Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pac
|
||||
sif::info << "PDU2 VBAT: " << vbat << std::endl;
|
||||
float temperatureC = pdu2HkTableDataset.temperature.value * 0.1;
|
||||
sif::info << "PDU2 Temperature: " << temperatureC << " °C" << std::endl;
|
||||
sif::info << "PDU2 Q7S enable state: " << unsigned(pdu2HkTableDataset.outEnabledQ7S.value) << std::endl;
|
||||
sif::info << "PDU2 Payload PCDU channel 1 enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh1.value) << std::endl;
|
||||
sif::info << "PDU2 reaction wheels enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledReactionWheels.value) << std::endl;
|
||||
sif::info << "PDU2 TCS Board 8V heater input enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value) << std::endl;
|
||||
sif::info << "PDU2 redundant SUS group enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledSUSRedundant.value) << std::endl;
|
||||
sif::info << "PDU2 deployment mechanism enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledDeplMechanism.value) << std::endl;
|
||||
sif::info << "PDU2 PCDU channel 6 enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh6.value) << std::endl;
|
||||
sif::info << "PDU2 ACS board side B enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledAcsBoardSideB.value) << std::endl;
|
||||
sif::info << "PDU2 payload camera enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledPayloadCamera.value) << std::endl;
|
||||
printOutputSwitchStates();
|
||||
sif::info << "PDU2 uptime: " << pdu2HkTableDataset.uptime << " seconds" << std::endl;
|
||||
sif::info << "PDU2 battery mode: " << unsigned(pdu2HkTableDataset.battMode.value) << std::endl;
|
||||
sif::info << "PDU2 ground watchdog reboots: " << pdu2HkTableDataset.gndWdtReboots << std::endl;
|
||||
@ -323,3 +309,42 @@ ReturnValue_t PDU2Handler::initializeLocalDataPool(
|
||||
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PDU2Handler::printStatus(DeviceCommandId_t cmd) {
|
||||
switch(cmd) {
|
||||
case(GOMSPACE::PRINT_OUT_ENB_STATUS): {
|
||||
PoolReadGuard pg(&pdu2HkTableDataset);
|
||||
ReturnValue_t readResult = pg.getReadResult();
|
||||
if(readResult != HasReturnvaluesIF::RETURN_OK) {
|
||||
sif::warning << "Reading PDU2 HK table failed!" << std::endl;
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
printOutputSwitchStates();
|
||||
return HasReturnvaluesIF::RETURN_OK;
|
||||
}
|
||||
default: {
|
||||
return HasReturnvaluesIF::RETURN_FAILED;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PDU2Handler::printOutputSwitchStates() {
|
||||
sif::info << "PDU2 Q7S enable state: " <<
|
||||
unsigned(pdu2HkTableDataset.outEnabledQ7S.value) << std::endl;
|
||||
sif::info << "PDU2 Payload PCDU channel 1 enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh1.value) << std::endl;
|
||||
sif::info << "PDU2 reaction wheels enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledReactionWheels.value) << std::endl;
|
||||
sif::info << "PDU2 TCS Board 8V heater input enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledTCSBoardHeaterIn.value) << std::endl;
|
||||
sif::info << "PDU2 redundant SUS group enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledSUSRedundant.value) << std::endl;
|
||||
sif::info << "PDU2 deployment mechanism enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledDeplMechanism.value) << std::endl;
|
||||
sif::info << "PDU2 PCDU channel 6 enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledPlPCDUCh6.value) << std::endl;
|
||||
sif::info << "PDU2 ACS board side B enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledAcsBoardSideB.value) << std::endl;
|
||||
sif::info << "PDU2 payload camera enable state: "
|
||||
<< unsigned(pdu2HkTableDataset.outEnabledPayloadCamera.value) << std::endl;
|
||||
}
|
||||
|
@ -32,12 +32,14 @@ protected:
|
||||
*/
|
||||
virtual ReturnValue_t buildNormalDeviceCommand(DeviceCommandId_t * id) override;
|
||||
virtual void letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) override;
|
||||
ReturnValue_t printStatus(DeviceCommandId_t cmd) override;
|
||||
|
||||
private:
|
||||
|
||||
/** Dataset for the housekeeping table of the PDU2 */
|
||||
PDU2::PDU2HkTableDataset pdu2HkTableDataset;
|
||||
|
||||
void printOutputSwitchStates();
|
||||
void parseHkTableReply(const uint8_t *packet);
|
||||
};
|
||||
|
||||
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit b1e89d40467b269774ac8c707c122a7524c90f39
|
||||
Subproject commit d84c6a7e70e68f28dcfb21ccfdaae6a0300eab40
|
Loading…
Reference in New Issue
Block a user