Merge branch 'mueller/acs-ss-init' into mueller/pl-ss
All checks were successful
EIVE/eive-obsw/pipeline/pr-develop This commit looks good

This commit is contained in:
2022-05-02 12:55:15 +02:00
55 changed files with 1242 additions and 871 deletions

View File

@ -2,8 +2,9 @@
#include "OBSWConfig.h"
ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
: GomspaceDeviceHandler(objectId, comIF, comCookie, ACU::MAX_CONFIGTABLE_ADDRESS,
ACUHandler::ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
FailureIsolationBase *customFdir)
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, ACU::MAX_CONFIGTABLE_ADDRESS,
ACU::MAX_HKTABLE_ADDRESS, ACU::HK_TABLE_REPLY_SIZE),
acuHkTableDataset(this) {}
@ -23,20 +24,22 @@ void ACUHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *pack
parseHkTableReply(packet);
handleDeviceTM(&acuHkTableDataset, id, true);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_ACU == 1
acuHkTableDataset.read();
float temperatureC_1 = acuHkTableDataset.temperature1.value * 0.1;
float temperatureC_2 = acuHkTableDataset.temperature2.value * 0.1;
float temperatureC_3 = acuHkTableDataset.temperature3.value * 0.1;
sif::info << "ACU: Temperature 1: " << temperatureC_1 << " °C" << std::endl;
sif::info << "ACU: Temperature 2: " << temperatureC_2 << " °C" << std::endl;
sif::info << "ACU: Temperature 3: " << temperatureC_3 << " °C" << std::endl;
sif::info << "ACU: Ground Watchdog Timer Count: " << acuHkTableDataset.wdtCntGnd.value
<< std::endl;
sif::info << "ACU: Ground watchdog timer, seconds left before reboot: "
<< acuHkTableDataset.wdtGndLeft.value << std::endl;
acuHkTableDataset.commit();
if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
acuHkTableDataset.read();
float temperatureC_1 = acuHkTableDataset.temperature1.value * 0.1;
float temperatureC_2 = acuHkTableDataset.temperature2.value * 0.1;
float temperatureC_3 = acuHkTableDataset.temperature3.value * 0.1;
sif::info << "ACU: Temperature 1: " << temperatureC_1 << " °C" << std::endl;
sif::info << "ACU: Temperature 2: " << temperatureC_2 << " °C" << std::endl;
sif::info << "ACU: Temperature 3: " << temperatureC_3 << " °C" << std::endl;
sif::info << "ACU: Ground Watchdog Timer Count: " << acuHkTableDataset.wdtCntGnd.value
<< std::endl;
sif::info << "ACU: Ground watchdog timer, seconds left before reboot: "
<< acuHkTableDataset.wdtGndLeft.value << std::endl;
acuHkTableDataset.commit();
#endif
}
}
LocalPoolDataSetBase *ACUHandler::getDataSetHandle(sid_t sid) {
@ -317,3 +320,5 @@ void ACUHandler::printChannelStats() {
<< static_cast<unsigned int>(acuHkTableDataset.currentInChannel5.value) << std::setw(15)
<< std::right << acuHkTableDataset.voltageInChannel5.value << std::endl;
}
void ACUHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -12,9 +12,12 @@
*/
class ACUHandler : public GomspaceDeviceHandler {
public:
ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
ACUHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
FailureIsolationBase* customFdir);
virtual ~ACUHandler();
void setDebugMode(bool enable);
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
@ -37,6 +40,7 @@ class ACUHandler : public GomspaceDeviceHandler {
static const DeviceCommandId_t PRINT_CHANNEL_STATS = 51;
ACU::HkTableDataset acuHkTableDataset;
bool debugMode = false;
/**
* @brief Function extracts the hk table information from the received csp packet and stores

View File

@ -197,19 +197,19 @@ ReturnValue_t BpxBatteryHandler::interpretDeviceReply(DeviceCommandId_t id, cons
if (result != HasReturnvaluesIF::RETURN_OK) {
return result;
}
#if OBSW_DEBUG_BPX_BATT == 1
sif::info << "BPX Battery HK output:" << std::endl;
sif::info << "Charge current [mA]: " << hkSet.chargeCurrent << std::endl;
sif::info << "Discharge current [mA]: " << hkSet.dischargeCurrent << std::endl;
sif::info << "Heater current [mA]: " << hkSet.heaterCurrent << std::endl;
sif::info << "Battery voltage [mV]: " << hkSet.battVoltage << std::endl;
sif::info << "Battery Temperature 1 [C]: " << hkSet.battTemp1 << std::endl;
sif::info << "Battery Temperature 2 [C]: " << hkSet.battTemp2 << std::endl;
sif::info << "Battery Temperature 3 [C]: " << hkSet.battTemp3 << std::endl;
sif::info << "Battery Temperature 4 [C]: " << hkSet.battTemp4 << std::endl;
sif::info << "Battery Reboot Counter: " << hkSet.rebootCounter << std::endl;
sif::info << "Battery Boot Cause: " << static_cast<int>(hkSet.bootcause.value) << std::endl;
#endif
if (debugMode) {
sif::info << "BPX Battery HK output:" << std::endl;
sif::info << "Charge current [mA]: " << hkSet.chargeCurrent << std::endl;
sif::info << "Discharge current [mA]: " << hkSet.dischargeCurrent << std::endl;
sif::info << "Heater current [mA]: " << hkSet.heaterCurrent << std::endl;
sif::info << "Battery voltage [mV]: " << hkSet.battVoltage << std::endl;
sif::info << "Battery Temperature 1 [C]: " << hkSet.battTemp1 << std::endl;
sif::info << "Battery Temperature 2 [C]: " << hkSet.battTemp2 << std::endl;
sif::info << "Battery Temperature 3 [C]: " << hkSet.battTemp3 << std::endl;
sif::info << "Battery Temperature 4 [C]: " << hkSet.battTemp4 << std::endl;
sif::info << "Battery Reboot Counter: " << hkSet.rebootCounter << std::endl;
sif::info << "Battery Boot Cause: " << static_cast<int>(hkSet.bootcause.value) << std::endl;
}
break;
}
case (BpxBattery::PING): {
@ -277,3 +277,5 @@ ReturnValue_t BpxBatteryHandler::initializeLocalDataPool(localpool::DataPool& lo
void BpxBatteryHandler::setToGoToNormalMode(bool enable) {
this->goToNormalModeImmediately = enable;
}
void BpxBatteryHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -11,6 +11,7 @@ class BpxBatteryHandler : public DeviceHandlerBase {
virtual ~BpxBatteryHandler();
void setToGoToNormalMode(bool enable);
void setDebugMode(bool enable);
protected:
enum class States {
@ -20,6 +21,7 @@ class BpxBatteryHandler : public DeviceHandlerBase {
States state = States::CHECK_COM;
bool commandExecuted = false;
bool debugMode = false;
bool goToNormalModeImmediately = false;
uint8_t sentPingByte = BpxBattery::DEFAULT_PING_SENT_BYTE;
BpxBatteryHk hkSet;

View File

@ -7,9 +7,10 @@
#include "devicedefinitions/powerDefinitions.h"
GomspaceDeviceHandler::GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF,
CookieIF* comCookie, uint16_t maxConfigTableAddress,
CookieIF* comCookie, FailureIsolationBase* customFdir,
uint16_t maxConfigTableAddress,
uint16_t maxHkTableAddress, uint16_t hkTableReplySize)
: DeviceHandlerBase(objectId, comIF, comCookie),
: DeviceHandlerBase(objectId, comIF, comCookie, customFdir),
maxConfigTableAddress(maxConfigTableAddress),
maxHkTableAddress(maxHkTableAddress),
hkTableReplySize(hkTableReplySize) {

View File

@ -38,8 +38,8 @@ class GomspaceDeviceHandler : public DeviceHandlerBase {
* device.
*/
GomspaceDeviceHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
uint16_t maxConfigTableAddress, uint16_t maxHkTableAddress,
uint16_t hkTableReplySize);
FailureIsolationBase *customFdir, uint16_t maxConfigTableAddress,
uint16_t maxHkTableAddress, uint16_t hkTableReplySize);
virtual ~GomspaceDeviceHandler();
/**

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,8 @@ class IMTQHandler : public DeviceHandlerBase {
*/
void setToGoToNormal(bool enable);
void setDebugMode(bool enable);
protected:
void doStartUp() override;
void doShutDown() override;
@ -99,6 +101,7 @@ class IMTQHandler : public DeviceHandlerBase {
uint8_t commandBuffer[IMTQ::MAX_COMMAND_SIZE];
bool goToNormalMode = false;
bool debugMode = false;
enum class CommunicationStep {
GET_ENG_HK_DATA,

View File

@ -399,20 +399,21 @@ ReturnValue_t Max31865PT1000Handler::interpretDeviceReply(DeviceCommandId_t id,
// calculate approximation
float approxTemp = adcCode / 32.0 - 256.0;
#if OBSW_DEBUG_RTD == 1
if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
if (debugDivider->checkAndIncrement()) {
if (debugDivider->checkAndIncrement()) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::info << "Max31865: ObjID " << std::hex << this->getObjectId() << " | RTD " << std::dec
<< static_cast<int>(deviceIdx) << ": R[Ohm] " << rtdValue
<< " Ohms | Approx T[C]: " << approxTemp << std::endl;
sif::info << "Max31865: ObjID " << std::hex << this->getObjectId() << " | RTD "
<< std::dec << static_cast<int>(deviceIdx) << ": R[Ohm] " << rtdValue
<< " Ohms | Approx T[C]: " << approxTemp << std::endl;
#else
sif::printInfo("Max31685: Measured resistance is %f Ohms\n", rtdValue);
sif::printInfo("Approximated temperature is %f C\n", approxTemp);
sif::printInfo("Max31685: Measured resistance is %f Ohms\n", rtdValue);
sif::printInfo("Approximated temperature is %f C\n", approxTemp);
#endif
}
#endif
}
#endif
#endif
PoolReadGuard pg(&sensorDataset);
if (pg.getReadResult() != HasReturnvaluesIF::RETURN_OK) {
// Configuration error
@ -530,3 +531,5 @@ void Max31865PT1000Handler::modeChanged() {
}
void Max31865PT1000Handler::setDeviceIdx(uint8_t idx) { deviceIdx = idx; }
void Max31865PT1000Handler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -33,6 +33,8 @@ class Max31865PT1000Handler : public DeviceHandlerBase {
Max31865PT1000Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie);
virtual ~Max31865PT1000Handler();
void setDebugMode(bool enable);
// Configuration in 8 digit code:
// 1. 1 for V_BIAS enabled, 0 for disabled
// 2. 1 for Auto-conversion, 0 for off
@ -85,6 +87,7 @@ class Max31865PT1000Handler : public DeviceHandlerBase {
private:
uint8_t switchId = 0;
bool instantNormal = false;
bool debugMode = false;
bool warningSwitch = true;
enum class InternalState {

View File

@ -4,9 +4,11 @@
#include "OBSWConfig.h"
P60DockHandler::P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
: GomspaceDeviceHandler(objectId, comIF, comCookie, P60Dock::MAX_CONFIGTABLE_ADDRESS,
P60Dock::MAX_HKTABLE_ADDRESS, P60Dock::HK_TABLE_REPLY_SIZE),
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_TABLE_REPLY_SIZE),
coreHk(this),
auxHk(this) {}
@ -24,50 +26,6 @@ void P60DockHandler::letChildHandleHkReply(DeviceCommandId_t id, const uint8_t *
* P60DockHandler itself.
*/
handleDeviceTM(&coreHk, id, true);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_P60DOCK == 1
p60dockHkTableDataset.read();
sif::info << "P60 Dock: ACU VCC switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateAcuVcc.value)
<< std::endl;
sif::info << "P60 Dock: PDU1 VCC switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu1Vcc.value)
<< std::endl;
sif::info << "P60 Dock: PDU2 VCC switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu2Vcc.value)
<< std::endl;
sif::info << "P60 Dock: ACU VBAT switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateAcuVbat.value)
<< std::endl;
sif::info << "P60 Dock: PDU1 VBAT switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu1Vbat.value)
<< std::endl;
sif::info << "P60 Dock: PDU2 VBAT switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStatePdu2Vbat.value)
<< std::endl;
sif::info << "P60 Dock: Stack VBAT switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStackVbat.value)
<< std::endl;
sif::info << "P60 Dock: Stack 3V3 switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStack3V3.value)
<< std::endl;
sif::info << "P60 Dock: Stack 5V switch: "
<< static_cast<unsigned int>(p60dockHkTableDataset.outputEnableStateStack5V.value)
<< std::endl;
float temperatureC = p60dockHkTableDataset.temperature1.value * 0.1;
sif::info << "P60 Dock: Temperature 1: " << temperatureC << " °C" << std::endl;
temperatureC = p60dockHkTableDataset.temperature2.value * 0.1;
sif::info << "P60 Dock: Temperature 2: " << temperatureC << " °C" << std::endl;
sif::info << "P60 Dock: Watchdog Timer seconds left before reboot: "
<< p60dockHkTableDataset.wdtGndLeft << " seconds" << std::endl;
sif::info << "P60 Dock: CSP 1, pings left before reboot: "
<< (int)p60dockHkTableDataset.wdtCspLeft1.value << std::endl;
sif::info << "P60 Dock: CSP 2, pings left before reboot: "
<< (int)p60dockHkTableDataset.wdtCspLeft1.value << std::endl;
p60dockHkTableDataset.commit();
#endif
}
void P60DockHandler::parseHkTableReply(const uint8_t *packet) {
@ -362,3 +320,5 @@ void P60DockHandler::printHkTableLatchups() {
genericPrintoutHandler("X3 VBAT", hk::X3_IDLE_VBAT);
genericPrintoutHandler("X3 VCC", hk::X3_IDLE_VCC);
}
void P60DockHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -21,9 +21,12 @@ class P60DockHandler : public GomspaceDeviceHandler {
//! [EXPORT] : [COMMENT] Battery mode has changed. P1: Old mode. P2: New mode
static constexpr Event BATT_MODE_CHANGED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM);
P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
P60DockHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
FailureIsolationBase* customFdir);
virtual ~P60DockHandler();
void setDebugMode(bool enable);
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,
LocalDataPoolManager& poolManager) override;
@ -50,6 +53,7 @@ class P60DockHandler : public GomspaceDeviceHandler {
P60Dock::CoreHkSet coreHk;
P60Dock::HkTableDataset auxHk;
bool firstHk = true;
bool debugMode = false;
static constexpr uint8_t MAX_CHANNEL_STR_WIDTH = 16;
PoolEntry<int16_t> hkCurrents = PoolEntry<int16_t>(P60Dock::hk::CHNLS_LEN);

View File

@ -95,17 +95,20 @@ void PCDUHandler::initializeSwitchStates() {
}
void PCDUHandler::readCommandQueue() {
ReturnValue_t result;
ReturnValue_t result = RETURN_OK;
CommandMessage command;
result = commandQueue->receiveMessage(&command);
if (result != RETURN_OK) {
return;
}
for (result = commandQueue->receiveMessage(&command); result == RETURN_OK;
result = commandQueue->receiveMessage(&command)) {
result = commandQueue->receiveMessage(&command);
if (result != RETURN_OK) {
return;
}
result = poolManager.handleHousekeepingMessage(&command);
if (result == RETURN_OK) {
return;
result = poolManager.handleHousekeepingMessage(&command);
if (result == RETURN_OK) {
return;
}
}
}

View File

@ -5,8 +5,9 @@
#include "devices/powerSwitcherList.h"
PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
: GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU1Handler::PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
FailureIsolationBase *customFdir)
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
coreHk(this),
auxHk(this) {}

View File

@ -21,7 +21,8 @@
*/
class PDU1Handler : public GomspaceDeviceHandler {
public:
PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
PDU1Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
FailureIsolationBase* customFdir);
virtual ~PDU1Handler();
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,

View File

@ -5,8 +5,9 @@
#include "devices/powerSwitcherList.h"
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie)
: GomspaceDeviceHandler(objectId, comIF, comCookie, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU2Handler::PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF *comCookie,
FailureIsolationBase *customFdir)
: GomspaceDeviceHandler(objectId, comIF, comCookie, customFdir, PDU::MAX_CONFIGTABLE_ADDRESS,
PDU::MAX_HKTABLE_ADDRESS, PDU::HK_TABLE_REPLY_SIZE),
coreHk(this),
auxHk(this) {}

View File

@ -21,7 +21,8 @@
*/
class PDU2Handler : public GomspaceDeviceHandler {
public:
PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie);
PDU2Handler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
FailureIsolationBase* customFdir);
virtual ~PDU2Handler();
virtual ReturnValue_t initializeLocalDataPool(localpool::DataPool& localDataPoolMap,

View File

@ -2,7 +2,9 @@
#include <fsfw/src/fsfw/datapool/PoolReadGuard.h>
#ifdef FSFW_OSAL_LINUX
#include "OBSWConfig.h"
#ifdef XIPHOS_Q7S
#include <fsfw_hal/linux/UnixFileGuard.h>
#include <fsfw_hal/linux/spi/SpiComIF.h>
#include <fsfw_hal/linux/spi/SpiCookie.h>
@ -663,7 +665,7 @@ ReturnValue_t PayloadPcduHandler::handleDoubleParamUpdate(std::string key,
return params.writeJsonFile();
}
#ifdef FSFW_OSAL_LINUX
#ifdef XIPHOS_Q7S
ReturnValue_t PayloadPcduHandler::extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie,
const uint8_t* sendData, size_t sendLen,
void* args) {

View File

@ -68,10 +68,9 @@ class PayloadPcduHandler : public DeviceHandlerBase {
void setToGoToNormalModeImmediately(bool enable);
void enablePeriodicPrintout(bool enable, uint8_t divider);
#ifdef XIPHOS_Q7S
static ReturnValue_t extConvAsTwoCallback(SpiComIF* comIf, SpiCookie* cookie,
const uint8_t* sendData, size_t sendLen, void* args);
#ifdef FSFW_OSAL_LINUX
static ReturnValue_t transferAsTwo(SpiComIF* comIf, SpiCookie* cookie, const uint8_t* sendData,
size_t sendLen, bool tempOnly);
#endif

View File

@ -341,12 +341,15 @@ void RwHandler::handleResetStatusReply(const uint8_t* packet) {
lastResetStatusSet.lastResetStatus = resetStatus;
}
lastResetStatusSet.currentResetStatus = resetStatus;
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1
sif::info << "RwHandler::handleResetStatusReply: Last reset status: "
<< static_cast<unsigned int>(lastResetStatusSet.lastResetStatus.value) << std::endl;
sif::info << "RwHandler::handleResetStatusReply: Current reset status: "
<< static_cast<unsigned int>(lastResetStatusSet.currentResetStatus.value) << std::endl;
if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "RwHandler::handleResetStatusReply: Last reset status: "
<< static_cast<unsigned int>(lastResetStatusSet.lastResetStatus.value) << std::endl;
sif::info << "RwHandler::handleResetStatusReply: Current reset status: "
<< static_cast<unsigned int>(lastResetStatusSet.currentResetStatus.value)
<< std::endl;
#endif
}
}
void RwHandler::handleGetRwStatusReply(const uint8_t* packet) {
@ -371,16 +374,18 @@ void RwHandler::handleGetRwStatusReply(const uint8_t* packet) {
sif::error << "RwHandler::handleGetRwStatusReply: Reaction wheel in error state" << std::endl;
}
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1
sif::info << "RwHandler::handleGetRwStatusReply: Current speed is: " << statusSet.currSpeed
<< " * 0.1 RPM" << std::endl;
sif::info << "RwHandler::handleGetRwStatusReply: Reference speed is: " << statusSet.referenceSpeed
<< " * 0.1 RPM" << std::endl;
sif::info << "RwHandler::handleGetRwStatusReply: State is: "
<< (unsigned int)statusSet.state.value << std::endl;
sif::info << "RwHandler::handleGetRwStatusReply: clc mode is: "
<< (unsigned int)statusSet.clcMode.value << std::endl;
if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "RwHandler::handleGetRwStatusReply: Current speed is: " << statusSet.currSpeed
<< " * 0.1 RPM" << std::endl;
sif::info << "RwHandler::handleGetRwStatusReply: Reference speed is: "
<< statusSet.referenceSpeed << " * 0.1 RPM" << std::endl;
sif::info << "RwHandler::handleGetRwStatusReply: State is: "
<< (unsigned int)statusSet.state.value << std::endl;
sif::info << "RwHandler::handleGetRwStatusReply: clc mode is: "
<< (unsigned int)statusSet.clcMode.value << std::endl;
#endif
}
}
void RwHandler::handleTemperatureReply(const uint8_t* packet) {
@ -388,10 +393,12 @@ void RwHandler::handleTemperatureReply(const uint8_t* packet) {
uint8_t offset = 2;
temperatureSet.temperatureCelcius = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 |
*(packet + offset + 1) << 8 | *(packet + offset);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1
sif::info << "RwHandler::handleTemperatureReply: Temperature: "
<< temperatureSet.temperatureCelcius << " °C" << std::endl;
if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "RwHandler::handleTemperatureReply: Temperature: "
<< temperatureSet.temperatureCelcius << " °C" << std::endl;
#endif
}
}
void RwHandler::handleGetTelemetryReply(const uint8_t* packet) {
@ -468,53 +475,57 @@ void RwHandler::handleGetTelemetryReply(const uint8_t* packet) {
offset += 4;
tmDataset.spiTotalNumOfErrors = *(packet + offset + 3) << 24 | *(packet + offset + 2) << 16 |
*(packet + offset + 1) << 8 | *(packet + offset);
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_RW == 1
sif::info << "RwHandler::handleGetTelemetryReply: Last reset status: "
<< static_cast<unsigned int>(tmDataset.lastResetStatus.value) << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: MCU temperature: " << tmDataset.mcuTemperature
<< std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Pressure sensor temperature: "
<< tmDataset.pressureSensorTemperature << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Pressure " << tmDataset.pressure << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: State: "
<< static_cast<unsigned int>(tmDataset.rwState.value) << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: CLC mode: "
<< static_cast<unsigned int>(tmDataset.rwClcMode.value) << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Current speed: " << tmDataset.rwCurrSpeed
<< std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Reference speed: " << tmDataset.rwRefSpeed
<< std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid CRC packets: "
<< tmDataset.numOfInvalidCrcPackets << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid length packets: "
<< tmDataset.numOfInvalidLenPackets << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid command packets: "
<< tmDataset.numOfInvalidCmdPackets << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of command executed replies: "
<< tmDataset.numOfCmdExecutedReplies << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of command replies: "
<< tmDataset.numOfCmdReplies << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of bytes written: "
<< tmDataset.uartNumOfBytesWritten << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of bytes read: "
<< tmDataset.uartNumOfBytesRead << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of parity errors: "
<< tmDataset.uartNumOfParityErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of noise errors: "
<< tmDataset.uartNumOfNoiseErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of frame errors: "
<< tmDataset.uartNumOfFrameErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of register overrun errors: "
<< tmDataset.uartNumOfRegisterOverrunErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of total errors: "
<< tmDataset.uartTotalNumOfErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: SPI number of bytes written: "
<< tmDataset.spiNumOfBytesWritten << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: SPI number of bytes read: "
<< tmDataset.spiNumOfBytesRead << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: SPI number of register overrun errors: "
<< tmDataset.spiNumOfRegisterOverrunErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: SPI number of register total errors: "
<< tmDataset.spiTotalNumOfErrors << std::endl;
if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "RwHandler::handleGetTelemetryReply: Last reset status: "
<< static_cast<unsigned int>(tmDataset.lastResetStatus.value) << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: MCU temperature: " << tmDataset.mcuTemperature
<< std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Pressure sensor temperature: "
<< tmDataset.pressureSensorTemperature << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Pressure " << tmDataset.pressure << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: State: "
<< static_cast<unsigned int>(tmDataset.rwState.value) << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: CLC mode: "
<< static_cast<unsigned int>(tmDataset.rwClcMode.value) << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Current speed: " << tmDataset.rwCurrSpeed
<< std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Reference speed: " << tmDataset.rwRefSpeed
<< std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid CRC packets: "
<< tmDataset.numOfInvalidCrcPackets << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid length packets: "
<< tmDataset.numOfInvalidLenPackets << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of invalid command packets: "
<< tmDataset.numOfInvalidCmdPackets << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of command executed replies: "
<< tmDataset.numOfCmdExecutedReplies << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: Number of command replies: "
<< tmDataset.numOfCmdReplies << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of bytes written: "
<< tmDataset.uartNumOfBytesWritten << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of bytes read: "
<< tmDataset.uartNumOfBytesRead << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of parity errors: "
<< tmDataset.uartNumOfParityErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of noise errors: "
<< tmDataset.uartNumOfNoiseErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of frame errors: "
<< tmDataset.uartNumOfFrameErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of register overrun errors: "
<< tmDataset.uartNumOfRegisterOverrunErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: UART number of total errors: "
<< tmDataset.uartTotalNumOfErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: SPI number of bytes written: "
<< tmDataset.spiNumOfBytesWritten << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: SPI number of bytes read: "
<< tmDataset.spiNumOfBytesRead << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: SPI number of register overrun errors: "
<< tmDataset.spiNumOfRegisterOverrunErrors << std::endl;
sif::info << "RwHandler::handleGetTelemetryReply: SPI number of register total errors: "
<< tmDataset.spiTotalNumOfErrors << std::endl;
#endif
}
}
void RwHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -30,6 +30,9 @@ class RwHandler : public DeviceHandlerBase {
*/
RwHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie, LinuxLibgpioIF* gpioComIF,
gpioId_t enableGpio);
void setDebugMode(bool enable);
virtual ~RwHandler();
static const uint8_t INTERFACE_ID = CLASS_ID::RW_HANDLER;
@ -86,6 +89,7 @@ class RwHandler : public DeviceHandlerBase {
LinuxLibgpioIF* gpioComIF = nullptr;
gpioId_t enableGpio = gpio::NO_GPIO;
bool debugMode = false;
RwDefinitions::TemperatureSet temperatureSet;
RwDefinitions::StatusSet statusSet;

View File

@ -5,8 +5,8 @@
#include "OBSWConfig.h"
SyrlinksHkHandler::SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
power::Switch_t powerSwitch)
: DeviceHandlerBase(objectId, comIF, comCookie),
power::Switch_t powerSwitch, FailureIsolationBase* customFdir)
: DeviceHandlerBase(objectId, comIF, comCookie, customFdir),
rxDataset(this),
txDataset(this),
temperatureSet(this),
@ -166,12 +166,12 @@ ReturnValue_t SyrlinksHkHandler::buildCommandFromCommand(DeviceCommandId_t devic
return RETURN_OK;
}
case (syrlinks::ENABLE_DEBUG): {
debug = true;
debugMode = true;
rawPacketLen = 0;
return RETURN_OK;
}
case (syrlinks::DISABLE_DEBUG): {
debug = false;
debugMode = false;
rawPacketLen = 0;
return RETURN_OK;
}
@ -363,7 +363,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
tempBasebandBoard = calcTempVal(rawTempBasebandBoard);
temperatureSet.temperatureBasebandBoard = tempBasebandBoard;
PoolReadGuard rg(&temperatureSet);
if (debug) {
if (debugMode) {
sif::info << "Syrlinks temperature baseband board: " << tempBasebandBoard << " °C"
<< std::endl;
}
@ -394,7 +394,7 @@ ReturnValue_t SyrlinksHkHandler::interpretDeviceReply(DeviceCommandId_t id, cons
tempPowerAmplifier = calcTempVal(rawTempPowerAmplifier);
PoolReadGuard rg(&temperatureSet);
temperatureSet.temperaturePowerAmplifier = tempPowerAmplifier;
if (debug) {
if (debugMode) {
sif::info << "Syrlinks temperature power amplifier board: " << tempPowerAmplifier << " °C"
<< std::endl;
}
@ -540,8 +540,8 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
offset += 6;
rxDataset.rxDataRate = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_VERBOSE_LEVEL >= 1 && OBSW_DEBUG_SYRLINKS == 1
if (debug) {
if (debugMode) {
#if OBSW_VERBOSE_LEVEL >= 1
sif::info << "Syrlinks RX Status: 0x" << std::hex << (unsigned int)rxDataset.rxStatus.value
<< std::endl;
sif::info << "Syrlinks RX Sensitivity: " << std::dec << rxDataset.rxSensitivity << std::endl;
@ -551,14 +551,14 @@ void SyrlinksHkHandler::parseRxStatusRegistersReply(const uint8_t* packet) {
sif::info << "Syrlinks RX Demod Eb: " << rxDataset.rxDemodEb << std::endl;
sif::info << "Syrlinks RX Demod N0: " << rxDataset.rxDemodN0 << std::endl;
sif::info << "Syrlinks RX Datarate: " << (unsigned int)rxDataset.rxDataRate.value << std::endl;
}
#endif
}
}
void SyrlinksHkHandler::parseLclConfigReply(const uint8_t* packet) {
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
uint8_t lclConfig = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
if (debug) {
if (debugMode) {
sif::info << "SyrlinksHkHandler::parseRxStatusRegistersReply: Lcl config: "
<< static_cast<unsigned int>(lclConfig) << std::endl;
}
@ -568,24 +568,20 @@ void SyrlinksHkHandler::parseTxStatusReply(const uint8_t* packet) {
PoolReadGuard readHelper(&txDataset);
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
txDataset.txStatus = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_DEBUG_SYRLINKS == 1
if (debug) {
if (debugMode) {
sif::info << "Syrlinks TX Status: 0x" << std::hex << (unsigned int)txDataset.txStatus.value
<< std::endl;
}
#endif
}
void SyrlinksHkHandler::parseTxWaveformReply(const uint8_t* packet) {
PoolReadGuard readHelper(&txDataset);
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
txDataset.txWaveform = convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_DEBUG_SYRLINKS == 1
if (debug) {
if (debugMode) {
sif::info << "Syrlinks TX Waveform: 0x" << std::hex << (unsigned int)txDataset.txWaveform.value
<< std::endl;
}
#endif
}
void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) {
@ -593,11 +589,9 @@ void SyrlinksHkHandler::parseAgcLowByte(const uint8_t* packet) {
uint16_t offset = syrlinks::MESSAGE_HEADER_SIZE;
txDataset.txAgcValue = agcValueHighByte << 8 |
convertHexStringToUint8(reinterpret_cast<const char*>(packet + offset));
#if OBSW_DEBUG_SYRLINKS == 1
if (debug) {
if (debugMode) {
sif::info << "Syrlinks TX AGC Value: " << txDataset.txAgcValue << std::endl;
}
#endif
}
void SyrlinksHkHandler::parseAgcHighByte(const uint8_t* packet) {
@ -654,3 +648,5 @@ void SyrlinksHkHandler::prepareCommand(std::string command, DeviceCommandId_t co
rememberCommandId = commandId;
rawPacket = commandBuffer;
}
void SyrlinksHkHandler::setDebugMode(bool enable) { this->debugMode = enable; }

View File

@ -20,7 +20,7 @@
class SyrlinksHkHandler : public DeviceHandlerBase {
public:
SyrlinksHkHandler(object_id_t objectId, object_id_t comIF, CookieIF* comCookie,
power::Switch_t powerSwitch);
power::Switch_t powerSwitch, FailureIsolationBase* customFdir);
virtual ~SyrlinksHkHandler();
/**
@ -28,6 +28,8 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
*/
void setModeNormal();
void setDebugMode(bool enable);
protected:
void doStartUp() override;
void doShutDown() override;
@ -95,6 +97,7 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
const power::Switch_t powerSwitch = power::NO_SWITCH;
bool debugMode = false;
uint8_t agcValueHighByte = 0;
uint16_t rawTempPowerAmplifier = 0;
uint16_t rawTempBasebandBoard = 0;
@ -107,8 +110,6 @@ class SyrlinksHkHandler : public DeviceHandlerBase {
StartupState startupState = StartupState::OFF;
bool debug = false;
/**
* This object is used to store the id of the next command to execute. This controls the
* read out of multiple registers which can not be fetched with one single command.

View File

@ -1,8 +1,14 @@
#ifndef MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_
#define MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_
#include <commonSubsystemIds.h>
namespace syrlinks {
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::SYRLINKS;
static constexpr Event FDIR_REACTION_IGNORED = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM);
static const DeviceCommandId_t NONE = 0;
static const DeviceCommandId_t RESET_UNIT = 1;
/** Reads out all status registers */

View File

@ -15,6 +15,8 @@ static constexpr Event SWITCH_CMD_SENT = event::makeEvent(SUBSYSTEM_ID, 0, sever
static constexpr Event SWITCH_HAS_CHANGED = event::makeEvent(SUBSYSTEM_ID, 1, severity::INFO);
static constexpr Event SWITCHING_Q7S_DENIED = event::makeEvent(SUBSYSTEM_ID, 2, severity::MEDIUM);
static constexpr Event FDIR_REACTION_IGNORED = event::makeEvent(SUBSYSTEM_ID, 3, severity::MEDIUM);
} // namespace power
#endif /* MISSION_DEVICES_DEVICEDEFINITIONS_POWERDEFINITIONS_H_ */