split up p60 hk packets
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
Robin Müller 2022-04-07 12:53:51 +02:00
parent 4e3fa54ae2
commit 5e4c3728ed
No known key found for this signature in database
GPG Key ID: 71B58F8A3CDFA9AC
3 changed files with 35 additions and 32 deletions

View File

@ -51,7 +51,8 @@ ReturnValue_t PCDUHandler::initialize() {
return RETURN_FAILED;
}
result = pdu2Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage(
PDU2::HK_TABLE_DATA_SET_ID, this->getObjectId(), commandQueue->getId(), true);
static_cast<uint32_t>(P60System::SetIds::PDU_2), this->getObjectId(), commandQueue->getId(),
true);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from "
<< "PDU2Handler" << std::endl;
@ -66,7 +67,8 @@ ReturnValue_t PCDUHandler::initialize() {
return RETURN_FAILED;
}
result = pdu1Handler->getSubscriptionInterface()->subscribeForSetUpdateMessage(
PDU1::HK_TABLE_DATA_SET_ID, this->getObjectId(), commandQueue->getId(), true);
static_cast<uint32_t>(P60System::SetIds::PDU_1), this->getObjectId(), commandQueue->getId(),
true);
if (result != RETURN_OK) {
sif::error << "PCDUHandler::initialize: Failed to subscribe for set update messages from "
<< "PDU1Handler" << std::endl;
@ -101,10 +103,10 @@ void PCDUHandler::readCommandQueue() {
MessageQueueId_t PCDUHandler::getCommandQueue() const { return commandQueue->getId(); }
void PCDUHandler::handleChangedDataset(sid_t sid, store_address_t storeId, bool* clearMessage) {
if (sid == sid_t(objects::PDU2_HANDLER, PDU2::HK_TABLE_DATA_SET_ID)) {
if (sid == sid_t(objects::PDU2_HANDLER, static_cast<uint32_t>(P60System::SetIds::PDU_2))) {
updateHkTableDataset(storeId, &pdu2HkTableDataset, &timeStampPdu2HkDataset);
updatePdu2SwitchStates();
} else if (sid == sid_t(objects::PDU1_HANDLER, PDU1::HK_TABLE_DATA_SET_ID)) {
} else if (sid == sid_t(objects::PDU1_HANDLER, static_cast<uint32_t>(P60System::SetIds::PDU_1))) {
updateHkTableDataset(storeId, &pdu1HkTableDataset, &timeStampPdu1HkDataset);
updatePdu1SwitchStates();
} else {

View File

@ -43,6 +43,8 @@ static const DeviceCommandId_t PRINT_LATCHUPS = 33;
namespace P60System {
enum class SetIds : uint32_t { PDU_1 = 1, PDU_2 = 2, P60_CORE = 3, P60_AUX = 4, ACU = 5 };
namespace pool {
enum Ids : lp_id_t {
@ -351,9 +353,6 @@ static const uint16_t MAX_CONFIGTABLE_ADDRESS = 408;
static const uint16_t MAX_HKTABLE_ADDRESS = 187;
static const uint16_t HK_TABLE_SIZE = 188;
static constexpr uint32_t CORE_TABLE_SET_ID = 0x3;
static constexpr uint32_t AUX_TABLE_DATA_SET_ID = 0x4;
static const uint8_t HK_TABLE_ENTRIES = 100;
/**
@ -364,9 +363,11 @@ static const uint16_t HK_TABLE_REPLY_SIZE = 407;
class CoreHkSet : public StaticLocalDataSet<16> {
public:
CoreHkSet(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, CORE_TABLE_SET_ID) {}
CoreHkSet(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::P60_CORE)) {}
CoreHkSet(object_id_t objectId) : StaticLocalDataSet(sid_t(objectId, CORE_TABLE_SET_ID)) {}
CoreHkSet(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::P60_CORE))) {}
/** Measured output currents */
lp_vec_t<int16_t, P60Dock::hk::Index::CHNLS_LEN> currents =
@ -406,10 +407,16 @@ class CoreHkSet : public StaticLocalDataSet<16> {
*/
class HkTableDataset : public StaticLocalDataSet<32> {
public:
HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, AUX_TABLE_DATA_SET_ID) {}
HkTableDataset(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::P60_AUX)) {}
HkTableDataset(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, AUX_TABLE_DATA_SET_ID)) {}
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::P60_AUX))) {}
/** Number of detected latchups on each output channel */
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN> latchups =
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::LATCHUPS,
this);
lp_var_t<uint32_t> bootcause =
lp_var_t<uint32_t>(sid.objectId, P60System::pool::P60DOCK_BOOT_CAUSE, this);
@ -424,11 +431,6 @@ class HkTableDataset : public StaticLocalDataSet<32> {
lp_var_t<uint8_t> converter5VStatus =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::P60DOCK_CONV_5V_ENABLE_STATUS, this);
/** Number of detected latchups on each output channel */
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN> latchups =
lp_vec_t<uint16_t, P60Dock::hk::Index::CHNLS_LEN>(sid.objectId, P60System::pool::LATCHUPS,
this);
lp_var_t<uint16_t> dockVbatVoltageValue =
lp_var_t<uint16_t>(sid.objectId, P60System::pool::P60DOCK_DOCK_VBAT, this);
lp_var_t<int16_t> dockVccCurrent =
@ -439,11 +441,6 @@ class HkTableDataset : public StaticLocalDataSet<32> {
lp_var_t<int16_t> batteryTemperature2 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::P60DOCK_BATTERY_TEMPERATURE_2, this);
lp_vec_t<uint8_t, P60Dock::NUM_DEVS> devicesType =
lp_vec_t<uint8_t, P60Dock::NUM_DEVS>(sid.objectId, P60System::pool::DEVICES_TYPE, this);
lp_vec_t<uint8_t, P60Dock::NUM_DEVS> devicesStatus =
lp_vec_t<uint8_t, P60Dock::NUM_DEVS>(sid.objectId, P60System::pool::DEVICES_STATUS, this);
lp_var_t<uint8_t> dearmStatus =
lp_var_t<uint8_t>(sid.objectId, P60System::pool::P60DOCK_DEARM_STATUS, this);
@ -477,6 +474,11 @@ class HkTableDataset : public StaticLocalDataSet<32> {
lp_var_t<int8_t>(sid.objectId, P60System::pool::P60DOCK_ANT6_DEPL, this);
lp_var_t<int8_t> ar6Depl =
lp_var_t<int8_t>(sid.objectId, P60System::pool::P60DOCK_AR6_DEPL, this);
lp_vec_t<uint8_t, P60Dock::NUM_DEVS> devicesType =
lp_vec_t<uint8_t, P60Dock::NUM_DEVS>(sid.objectId, P60System::pool::DEVICES_TYPE, this);
lp_vec_t<uint8_t, P60Dock::NUM_DEVS> devicesStatus =
lp_vec_t<uint8_t, P60Dock::NUM_DEVS>(sid.objectId, P60System::pool::DEVICES_STATUS, this);
};
} // namespace P60Dock
@ -494,7 +496,6 @@ static const uint8_t HK_TABLE_ENTRIES = 73;
} // namespace PDU
namespace PDU1 {
static const uint32_t HK_TABLE_DATA_SET_ID = 0x1; // hk table has table id 4
enum SwitchChannels : uint8_t {
TCS_BOARD_3V3 = 0,
@ -527,10 +528,11 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_CHANNEL8 = 0x50;
*/
class PDU1HkTableDataset : public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> {
public:
PDU1HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {}
PDU1HkTableDataset(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_1)) {}
PDU1HkTableDataset(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {}
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_1))) {}
/** Measured output currents */
lp_var_t<int16_t> currentOutTCSBoard3V3 =
@ -698,7 +700,6 @@ class PDU1HkTableDataset : public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> {
} // namespace PDU1
namespace PDU2 {
static const uint32_t HK_TABLE_DATA_SET_ID = 0x2;
enum SwitchChannels : uint8_t {
Q7S = 0,
@ -731,10 +732,11 @@ static const uint16_t CONFIG_ADDRESS_OUT_EN_PAYLOAD_CAMERA = 0x50;
*/
class PDU2HkTableDataset : public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> {
public:
PDU2HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {}
PDU2HkTableDataset(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::PDU_2)) {}
PDU2HkTableDataset(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {}
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::PDU_2))) {}
/** Measured output currents */
lp_var_t<int16_t> currentOutQ7S =
@ -903,8 +905,6 @@ class PDU2HkTableDataset : public StaticLocalDataSet<PDU::HK_TABLE_ENTRIES> {
namespace ACU {
static const uint32_t HK_TABLE_DATA_SET_ID = 0x4;
/* When receiving full housekeeping (telemetry) table */
static const uint16_t MAX_REPLY_LENGTH = 262;
static const uint16_t MAX_CONFIGTABLE_ADDRESS = 26;
@ -917,10 +917,11 @@ static const uint16_t HK_TABLE_REPLY_SIZE = 262;
*/
class HkTableDataset : public StaticLocalDataSet<HK_TABLE_ENTRIES> {
public:
HkTableDataset(HasLocalDataPoolIF* owner) : StaticLocalDataSet(owner, HK_TABLE_DATA_SET_ID) {}
HkTableDataset(HasLocalDataPoolIF* owner)
: StaticLocalDataSet(owner, static_cast<uint32_t>(::P60System::SetIds::ACU)) {}
HkTableDataset(object_id_t objectId)
: StaticLocalDataSet(sid_t(objectId, HK_TABLE_DATA_SET_ID)) {}
: StaticLocalDataSet(sid_t(objectId, static_cast<uint32_t>(::P60System::SetIds::ACU))) {}
lp_var_t<int16_t> currentInChannel0 =
lp_var_t<int16_t>(sid.objectId, P60System::pool::ACU_CURRENT_IN_CHANNEL0, this);

2
tmtc

@ -1 +1 @@
Subproject commit 8f2ff3034fff627b807f32c02fd9e676126bae5f
Subproject commit ab5cca85bfb71875ba0c49e8ed6ef575f851c0c5