added test to retrieve pdu config
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
This commit is contained in:
@ -3,15 +3,17 @@
|
||||
#include <fsfw/datapool/PoolReadGuard.h>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "p60dock_hk.h"
|
||||
|
||||
P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
|
||||
FailureIsolationBase *customFdir)
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir,
|
||||
P60Dock::MAX_CONFIGTABLE_ADDRESS, P60Dock::MAX_HKTABLE_ADDRESS,
|
||||
P60DOCK_HK_SIZE),
|
||||
: GomspaceDeviceHandler(objectId, comIF, comCookie, cfg, customFdir),
|
||||
coreHk(this),
|
||||
auxHk(this) {}
|
||||
auxHk(this) {
|
||||
cfg.maxConfigTableAddress = P60Dock::MAX_CONFIGTABLE_ADDRESS;
|
||||
cfg.maxHkTableAddress = P60Dock::MAX_HKTABLE_ADDRESS;
|
||||
cfg.hkTableSize = P60Dock::HK_TABLE_SIZE;
|
||||
cfg.cfgTableSize = P60Dock::CONFIG_TABLE_SIZE;
|
||||
}
|
||||
|
||||
P60DockHandler::~P60DockHandler() {}
|
||||
|
||||
@ -33,8 +35,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
|
||||
using namespace P60Dock;
|
||||
PoolReadGuard pg0(&coreHk);
|
||||
PoolReadGuard pg1(&auxHk);
|
||||
if (pg0.getReadResult() != returnvalue::OK or
|
||||
pg1.getReadResult() != returnvalue::OK) {
|
||||
if (pg0.getReadResult() != returnvalue::OK or pg1.getReadResult() != returnvalue::OK) {
|
||||
coreHk.setValidity(false, true);
|
||||
auxHk.setValidity(false, true);
|
||||
return;
|
||||
@ -44,10 +45,10 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
|
||||
* address.
|
||||
*/
|
||||
for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
|
||||
coreHk.currents[idx] = as<int16_t>(packet + (idx*2));
|
||||
coreHk.currents[idx] = as<int16_t>(packet + (idx * 2));
|
||||
}
|
||||
for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
|
||||
coreHk.voltages[idx] = as<uint16_t>(packet + 0x1a + (idx*2));
|
||||
coreHk.voltages[idx] = as<uint16_t>(packet + 0x1a + (idx * 2));
|
||||
}
|
||||
for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
|
||||
coreHk.outputEnables[idx] = *(packet + 0x34 + idx);
|
||||
@ -75,7 +76,7 @@ void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
|
||||
auxHk.converter5VStatus = *(packet + 0x58);
|
||||
|
||||
for (uint8_t idx = 0; idx < hk::CHNLS_LEN; idx++) {
|
||||
auxHk.latchups[idx] = as<uint16_t>(packet + 0x5a + (idx*2));
|
||||
auxHk.latchups[idx] = as<uint16_t>(packet + 0x5a + (idx * 2));
|
||||
}
|
||||
|
||||
auxHk.dockVbatVoltageValue = as<uint16_t>(packet + 0x74);
|
||||
@ -183,8 +184,7 @@ ReturnValue_t P60DockHandler::printStatus(DeviceCommandId_t cmd) {
|
||||
case (GOMSPACE::PRINT_SWITCH_V_I): {
|
||||
PoolReadGuard pg0(&coreHk);
|
||||
PoolReadGuard pg1(&auxHk);
|
||||
if (pg0.getReadResult() != returnvalue::OK or
|
||||
pg1.getReadResult() != returnvalue::OK) {
|
||||
if (pg0.getReadResult() != returnvalue::OK or pg1.getReadResult() != returnvalue::OK) {
|
||||
break;
|
||||
}
|
||||
printHkTableSwitchIV();
|
||||
|
Reference in New Issue
Block a user