PCDU P60 HK Set Update #204

Merged
meierj merged 8 commits from mueller/pcdu-hk-core-sets into develop 2022-04-08 17:48:51 +02:00
4 changed files with 27 additions and 1 deletions
Showing only changes of commit 64b3afae22 - Show all commits

View File

@ -24,6 +24,10 @@ enum: uint8_t {
ACS_BOARD_ASS = 123, ACS_BOARD_ASS = 123,
SUS_BOARD_ASS = 124, SUS_BOARD_ASS = 124,
TCS_BOARD_ASS = 125, TCS_BOARD_ASS = 125,
P60_DOCK_HANDLER = 126,
PDU1_HANDLER = 127,
PDU2_HANDLER = 128,
ACU_HANDLER = 129,
COMMON_SUBSYSTEM_ID_END COMMON_SUBSYSTEM_ID_END
}; };
} }

View File

@ -116,8 +116,16 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
*(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3); *(packet + dataOffset + 2) << 8 | *(packet + dataOffset + 3);
dataOffset += 6; dataOffset += 6;
auxHk.resetcause = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1); auxHk.resetcause = *(packet + dataOffset) << 8 | *(packet + dataOffset + 1);
dataOffset += 4; dataOffset += 4;
coreHk.battMode = *(packet + dataOffset); uint8_t newBattMode = packet[dataOffset];
if (firstHk) {
triggerEvent(BATT_MODE, newBattMode);
} else if (newBattMode != coreHk.battMode.value) {
triggerEvent(BATT_MODE_CHANGED, coreHk.battMode.value, newBattMode);
}
coreHk.battMode = newBattMode;
dataOffset += 3; dataOffset += 3;
auxHk.heaterOn = *(packet + dataOffset); auxHk.heaterOn = *(packet + dataOffset);
/* + 13 because here begins a new gomspace csp data field */ /* + 13 because here begins a new gomspace csp data field */
@ -195,6 +203,9 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
auxHk.ant6Depl = *(packet + dataOffset); auxHk.ant6Depl = *(packet + dataOffset);
dataOffset += 3; dataOffset += 3;
auxHk.ar6Depl = *(packet + dataOffset); auxHk.ar6Depl = *(packet + dataOffset);
if (firstHk) {
firstHk = false;
}
coreHk.setValidity(true, true); coreHk.setValidity(true, true);
auxHk.setValidity(true, true); auxHk.setValidity(true, true);
} }

View File

@ -4,6 +4,7 @@
#include <mission/devices/devicedefinitions/GomspaceDefinitions.h> #include <mission/devices/devicedefinitions/GomspaceDefinitions.h>
#include "GomspaceDeviceHandler.h" #include "GomspaceDeviceHandler.h"
#include "commonSubsystemIds.h"
/** /**
* @brief Device handler for the P60Dock. The P60Dock serves as carrier for the ACU, PDU1 and * @brief Device handler for the P60Dock. The P60Dock serves as carrier for the ACU, PDU1 and
@ -11,6 +12,13 @@
*/ */
class P60DockHandler : public GomspaceDeviceHandler { class P60DockHandler : public GomspaceDeviceHandler {
public: public:
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::P60_DOCK_HANDLER;
//! [EXPORT] : [COMMENT] Battery mode is broadcasted at startup. P1: Mode
static constexpr Event BATT_MODE = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
//! [EXPORT] : [COMMENT] Battery mode has changed. P1: Old mode. P2: New mode
static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie); P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
virtual ~P60DockHandler(); virtual ~P60DockHandler();
@ -39,6 +47,7 @@ class P60DockHandler : public GomspaceDeviceHandler {
private: private:
P60Dock::CoreHkSet coreHk; P60Dock::CoreHkSet coreHk;
P60Dock::HkTableDataset auxHk; P60Dock::HkTableDataset auxHk;
bool firstHk = true;
static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16; static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16;
PoolEntry<int16_t> hkCurrents = PoolEntry<int16_t>(P60Dock::hk::CHNLS_LEN); PoolEntry<int16_t> hkCurrents = PoolEntry<int16_t>(P60Dock::hk::CHNLS_LEN);

View File

@ -43,6 +43,8 @@ static const DeviceCommandId_t PRINT_LATCHUPS = 33;
namespace P60System { namespace P60System {
enum class BatteryModes : uint8_t { CRITICAL = 1, SAFE = 2, NORMAL = 3, FULL = 4 };
enum class SetIds : uint32_t { PDU_1 = 1, PDU_2 = 2, P60_CORE = 3, P60_AUX = 4, ACU = 5 }; enum class SetIds : uint32_t { PDU_1 = 1, PDU_2 = 2, P60_CORE = 3, P60_AUX = 4, ACU = 5 };
namespace pool { namespace pool {