Merge pull request 'extend bpx handler' (#680) from extend-bpx-handler into main

Reviewed-on: #680
This commit is contained in:
Robin Müller 2023-06-14 06:08:02 +02:00
commit 693e11bcb2
3 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,5 @@
#include <fsfw/datapool/PoolReadGuard.h>
#include <fsfw/globalfunctions/arrayprinter.h>
#include <mission/power/BpxBatteryHandler.h>
BpxBatteryHandler::BpxBatteryHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
@ -51,6 +52,9 @@ void BpxBatteryHandler::fillCommandAndReplyMap() {
insertInCommandAndReplyMap(bpxBat::RESET_COUNTERS, 1, nullptr, EMPTY_REPLY_LEN);
insertInCommandAndReplyMap(bpxBat::CONFIG_CMD, 1, nullptr, EMPTY_REPLY_LEN);
insertInCommandAndReplyMap(bpxBat::CONFIG_GET, 1, &cfgSet, CONFIG_GET_REPLY_LEN);
insertInCommandAndReplyMap(bpxBat::CONFIG_SET, 1, nullptr, EMPTY_REPLY_LEN);
insertInCommandAndReplyMap(bpxBat::MAN_HEAT_ON, 1, nullptr, MAN_HEAT_REPLY_LEN);
insertInCommandAndReplyMap(bpxBat::MAN_HEAT_OFF, 1, nullptr, MAN_HEAT_REPLY_LEN);
}
ReturnValue_t BpxBatteryHandler::buildCommandFromCommand(DeviceCommandId_t deviceCommand,
@ -155,7 +159,7 @@ ReturnValue_t BpxBatteryHandler::scanForReply(const uint8_t* start, size_t remai
case (bpxBat::PING):
case (bpxBat::MAN_HEAT_ON):
case (bpxBat::MAN_HEAT_OFF): {
if (remainingSize != PING_REPLY_LEN) {
if (remainingSize != MAN_HEAT_REPLY_LEN) {
return DeviceHandlerIF::LENGTH_MISSMATCH;
}
break;

View File

@ -48,6 +48,7 @@ static constexpr uint32_t CFG_SET_ID = CONFIG_GET;
static constexpr size_t GET_HK_REPLY_LEN = 23;
static constexpr size_t PING_REPLY_LEN = 3;
static constexpr size_t EMPTY_REPLY_LEN = 2;
static constexpr size_t MAN_HEAT_REPLY_LEN = 3;
static constexpr size_t CONFIG_GET_REPLY_LEN = 5;
static constexpr uint8_t PORT_PING = 1;
@ -219,6 +220,7 @@ class BpxBatteryCfg : public StaticLocalDataSet<bpxBat::CFG_ENTRIES> {
if (size < 3) {
return SerializeIF::STREAM_TOO_SHORT;
}
battheatermode.value = data[0];
battheaterLow.value = data[1];
battheaterHigh.value = data[2];

2
tmtc

@ -1 +1 @@
Subproject commit 522f273c99845f9c50aaf135b1c6f52676b975dd
Subproject commit 8a87d836534d92d47debd42595cd66ef657c2f20