issue with PDU Handler

This commit is contained in:
Jakob Meier 2021-02-08 11:48:58 +01:00
parent 181da3594d
commit 41ebbdd15c
8 changed files with 39 additions and 33 deletions

View File

@ -85,7 +85,7 @@ void ObjectFactory::produce(){
new PDU1Handler(objects::PDU1_HANDLER, objects::CSP_COM_IF, pdu1CspCookie);
new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie);
new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie);
new PCDUHandler(objects::PCDU_HANDLER);
new PCDUHandler(objects::PCDU_HANDLER, 50);
/* Temperature sensors */
Tmp1075Handler* tmp1075Handler_1 = new Tmp1075Handler(
objects::TMP1075_HANDLER_1, objects::I2C_COM_IF,

2
fsfw

@ -1 +1 @@
Subproject commit 2f374aef347a1b0e7a04305eadc768ea63e35077
Subproject commit 7d0916a44e18c87b00998448333023186b3d85b1

View File

@ -4,7 +4,7 @@
GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF,
CookieIF * comCookie, uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress,
uint16_t hkTableReplySize, LocalPoolDataSetBase* hkTableDataset) :
DeviceHandlerBase(objectId, comIF, comCookie), maxConfigTableAddress(maxConfigTableAddress),
DeviceHandlerBase(objectId, comIF, comCookie, nullptr, 60), maxConfigTableAddress(maxConfigTableAddress),
maxHkTableAddress(maxHkTableAddress), hkTableReplySize(hkTableReplySize), hkTableDataset(hkTableDataset) {
mode = MODE_NORMAL;
if (comCookie == NULL) {

View File

@ -55,18 +55,18 @@ ReturnValue_t PCDUHandler::initialize() {
}
/* Subscribing for housekeeping table update messages of the PDU1 */
HasLocalDataPoolIF* pdu1Handler = objectManager->get<HasLocalDataPoolIF>(objects::PDU1_HANDLER);
if(pdu1Handler == nullptr) {
sif::error << "PCDUHandler::initialize: Invalid pdu1Handler" << std::endl;
return RETURN_FAILED;
}
result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessages(
PDU1::HK_TABLE_DATA_SET_ID, this->getObjectId(), commandQueue->getId(), true);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from "
<< "PDU1Handler" << std::endl;
return result;
}
// HasLocalDataPoolIF* pdu1Handler = objectManager->get<HasLocalDataPoolIF>(objects::PDU1_HANDLER);
// if(pdu1Handler == nullptr) {
// sif::error << "PCDUHandler::initialize: Invalid pdu1Handler" << std::endl;
// return RETURN_FAILED;
// }
// result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessages(
// PDU1::HK_TABLE_DATA_SET_ID, this->getObjectId(), commandQueue->getId(), true);
// if (result != RETURN_OK) {
// sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from "
// << "PDU1Handler" << std::endl;
// return result;
// }
return RETURN_OK;
}
@ -116,7 +116,7 @@ void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId) {
updateHkTableDataset(storeId, &pdu2HkTableDataset, &timeStampPdu2HkDataset);
updatePdu2SwitchStates();
}
if (sid == sid_t(objects::PDU1_HANDLER, PDU1::HK_TABLE_DATA_SET_ID)) {
else if (sid == sid_t(objects::PDU1_HANDLER, PDU1::HK_TABLE_DATA_SET_ID)) {
updateHkTableDataset(storeId, &pdu1HkTableDataset, &timeStampPdu1HkDataset);
updatePdu1SwitchStates();
}
@ -130,7 +130,7 @@ void PCDUHandler::updateHkTableDataset(store_address_t storeId,
ReturnValue_t result;
HousekeepingSnapshot packetUpdate(reinterpret_cast<uint8_t*>(datasetTimeStamp),
sizeof(*datasetTimeStamp), dataset);
sizeof(CCSDSTime::CDS_short), dataset);
const uint8_t* packet_ptr = NULL;
size_t size;
result = IPCStore->getData(storeId, &packet_ptr, &size);
@ -173,14 +173,20 @@ void PCDUHandler::updatePdu2SwitchStates() {
}
void PCDUHandler::updatePdu1SwitchStates() {
switchStates[pcduSwitches::TCS_BOARD_3V3] = pdu1HkTableDataset.voltageOutTCSBoard3V3.value;
switchStates[pcduSwitches::SYRLINKS] = pdu1HkTableDataset.voltageOutSyrlinks.value;
switchStates[pcduSwitches::STAR_TRACKER] = pdu1HkTableDataset.voltageOutStarTracker.value;
switchStates[pcduSwitches::MGT] = pdu1HkTableDataset.voltageOutMGT.value;
switchStates[pcduSwitches::SUS_NOMINAL] = pdu1HkTableDataset.voltageOutSUSNominal.value;
switchStates[pcduSwitches::SOLAR_CELL_EXP] = pdu1HkTableDataset.voltageOutSolarCellExp.value;
switchStates[pcduSwitches::PLOC] = pdu1HkTableDataset.voltageOutPLOC.value;
switchStates[pcduSwitches::ACS_BORAD_SIDE_A] = pdu1HkTableDataset.voltageOutACSBoardSideA.value;
if (pdu1HkTableDataset.read() == RETURN_OK) {
switchStates[pcduSwitches::TCS_BOARD_3V3] = pdu1HkTableDataset.voltageOutTCSBoard3V3.value;
switchStates[pcduSwitches::SYRLINKS] = pdu1HkTableDataset.voltageOutSyrlinks.value;
switchStates[pcduSwitches::STAR_TRACKER] = pdu1HkTableDataset.voltageOutStarTracker.value;
switchStates[pcduSwitches::MGT] = pdu1HkTableDataset.voltageOutMGT.value;
switchStates[pcduSwitches::SUS_NOMINAL] = pdu1HkTableDataset.voltageOutSUSNominal.value;
switchStates[pcduSwitches::SOLAR_CELL_EXP] = pdu1HkTableDataset.voltageOutSolarCellExp.value;
switchStates[pcduSwitches::PLOC] = pdu1HkTableDataset.voltageOutPLOC.value;
switchStates[pcduSwitches::ACS_BORAD_SIDE_A] = pdu1HkTableDataset.voltageOutACSBoardSideA.value;
}
else {
sif::debug << "PCDUHandler::updatePdu1SwitchStates: Failed to read dataset" << std::endl;
}
pdu1HkTableDataset.commit();
}
LocalDataPoolManager* PCDUHandler::getHkManagerHandle() {

View File

@ -21,7 +21,7 @@ ReturnValue_t PDU1Handler::buildNormalDeviceCommand(
void PDU1Handler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *packet) {
parseHkTableReply(packet);
handleDeviceTM(&pdu1HkTableDataset, id, true);
// handleDeviceTM(&pdu1HkTableDataset, id, true);
#if OBSW_ENHANCED_PRINTOUT == 1 && PDU1_DEBUG == 1
pdu1HkTableDataset.read();

View File

@ -328,8 +328,8 @@ public:
* @param tableId_ The id of the requested table.
* @param tableDataset_ The dataset holding the table data.
*/
Pdu2FullTableReply(uint8_t action_, uint8_t tableId_, PDU2::PDU2HkTableDataset tableDataset_) :
action(action_), tableId(tableId_), tableDataset(tableDataset_) {
Pdu2FullTableReply(uint8_t action_, uint8_t tableId_, SerializeIF* tableDataset_) :
action(action_), tableId(tableId_), dataset(tableDataset_) {
setLinks();
}
@ -338,11 +338,11 @@ private:
void setLinks() {
setStart(&action);
action.setNext(&tableId);
tableId.setNext(&tableDataset);
tableId.setNext(&dataset);
}
SerializeElement<uint8_t> action;
SerializeElement<uint8_t> tableId;
SerializeElement<PDU2::PDU2HkTableDataset> tableDataset;
LinkedElement<SerializeIF> dataset;
};

View File

@ -637,11 +637,11 @@ namespace PDU1 {
public:
PDU1HkTableDataset(HasLocalDataPoolIF* owner):
StaticLocalDataSet(owner, PDU1::HK_TABLE_DATA_SET_ID) {
StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {
}
PDU1HkTableDataset(object_id_t objectId):
StaticLocalDataSet(sid_t(objectId, PDU1::HK_TABLE_DATA_SET_ID)) {
StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {
}
/** Measured output currents */

2
tmtc

@ -1 +1 @@
Subproject commit 39e8ff713431ed1a6484f6980b518aecd0d8288b
Subproject commit b4868b78e1eca3680e3d21924da80418737d11e9