diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 3e515bca..66408254 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -161,7 +161,7 @@ void ObjectFactory::produce(void* args) { I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV); BpxBatteryHandler* bpxHandler = new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie); -#if OBSW_DEBUG_BPX_BATT == 1 +#if OBSW_TEST_BPX_BATT == 1 bpxHandler->setToGoToNormalMode(true); bpxHandler->setStartUpImmediately(); #else diff --git a/linux/fsfwconfig/OBSWConfig.h.in b/linux/fsfwconfig/OBSWConfig.h.in index df1bad64..bdaf4c4f 100644 --- a/linux/fsfwconfig/OBSWConfig.h.in +++ b/linux/fsfwconfig/OBSWConfig.h.in @@ -77,6 +77,7 @@ debugging. */ #define OBSW_TEST_RADIATION_SENSOR_HANDLER 0 #define OBSW_TEST_SUS_HANDLER 0 #define OBSW_TEST_PLOC_HANDLER 0 +#define OBSW_TEST_BPX_BATT 0 #define OBSW_TEST_CCSDS_BRIDGE 0 #define OBSW_TEST_CCSDS_PTME 0 #define OBSW_TEST_TE7020_HEATER 0 diff --git a/mission/devices/BpxBatteryHandler.cpp b/mission/devices/BpxBatteryHandler.cpp index 14e61125..b16f8d3c 100644 --- a/mission/devices/BpxBatteryHandler.cpp +++ b/mission/devices/BpxBatteryHandler.cpp @@ -44,9 +44,9 @@ ReturnValue_t BpxBatteryHandler::buildTransitionDeviceCommand(DeviceCommandId_t* void BpxBatteryHandler::fillCommandAndReplyMap() { insertInCommandAndReplyMap(BpxBattery::GET_HK, 1, &hkSet, 23); insertInCommandAndReplyMap(BpxBattery::PING, 1, nullptr, 3); - insertInCommandAndReplyMap(BpxBattery::REBOOT, 1); - insertInCommandAndReplyMap(BpxBattery::RESET_COUNTERS, 1); - insertInCommandAndReplyMap(BpxBattery::CONFIG_CMD, 1); + insertInCommandAndReplyMap(BpxBattery::REBOOT, 1, nullptr, 0); + insertInCommandAndReplyMap(BpxBattery::RESET_COUNTERS, 1, nullptr, 2); + insertInCommandAndReplyMap(BpxBattery::CONFIG_CMD, 1, nullptr, 2); insertInCommandAndReplyMap(BpxBattery::CONFIG_GET, 1, &cfgSet, 3); } @@ -181,10 +181,14 @@ ReturnValue_t BpxBatteryHandler::scanForReply(const uint8_t* start, size_t remai } ReturnValue_t BpxBatteryHandler::interpretDeviceReply(DeviceCommandId_t id, const uint8_t* packet) { + if (packet[1] != 0) { + return DeviceHandlerIF::DEVICE_REPORTED_ERROR; + } switch (id) { case (BpxBattery::GET_HK): { PoolReadGuard rg(&hkSet); ReturnValue_t result = hkSet.parseRawHk(packet + 2, 21); + hkSet.setValidity(true, true); if (result != HasReturnvaluesIF::RETURN_OK) { return result; } diff --git a/tmtc b/tmtc index 8da50e2c..1702d895 160000 --- a/tmtc +++ b/tmtc @@ -1 +1 @@ -Subproject commit 8da50e2c3f709def5b26fd9df1cd23beac35482e +Subproject commit 1702d895761311d115c2e79b459b4a6d6843fc97