Compare commits
1 Commits
update_pow
...
v6.0.0
Author | SHA1 | Date | |
---|---|---|---|
e73b9ff72c |
12
CHANGELOG.md
12
CHANGELOG.md
@ -8,18 +8,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
## Fixes
|
|
||||||
|
|
||||||
- Linux OSAL `getUptime` fix: Check validity of `/proc/uptime` file before reading uptime.
|
|
||||||
- PUS Health Service: Size check for set health command.
|
|
||||||
- PUS Health Service: Perform operation completion for announce health command.
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
|
|
||||||
- Renamed `PCDU_2` subsystem ID to `POWER_SWITCH_IF`.
|
|
||||||
- Add new `PowerSwitchIF::SWITCH_UNKNOWN` returnvalue.
|
|
||||||
- Assert that `FixedArrayList` is larger than 0 at compile time.
|
|
||||||
|
|
||||||
# [v6.0.0] 2023-02-10
|
# [v6.0.0] 2023-02-10
|
||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
@ -12,7 +12,6 @@ template <typename T, size_t MAX_SIZE, typename count_t = uint8_t>
|
|||||||
class FixedArrayList : public ArrayList<T, count_t> {
|
class FixedArrayList : public ArrayList<T, count_t> {
|
||||||
static_assert(MAX_SIZE <= std::numeric_limits<count_t>::max(),
|
static_assert(MAX_SIZE <= std::numeric_limits<count_t>::max(),
|
||||||
"count_t is not large enough to hold MAX_SIZE");
|
"count_t is not large enough to hold MAX_SIZE");
|
||||||
static_assert(MAX_SIZE > 0, "MAX_SIZE is 0");
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
T data[MAX_SIZE];
|
T data[MAX_SIZE];
|
||||||
|
@ -10,7 +10,7 @@ enum : uint8_t {
|
|||||||
CDH = 28,
|
CDH = 28,
|
||||||
TCS_1 = 59,
|
TCS_1 = 59,
|
||||||
PCDU_1 = 42,
|
PCDU_1 = 42,
|
||||||
POWER_SWITCH_IF = 43,
|
PCDU_2 = 43,
|
||||||
HEATER = 50,
|
HEATER = 50,
|
||||||
T_SENSORS = 52,
|
T_SENSORS = 52,
|
||||||
FDIR = 70,
|
FDIR = 70,
|
||||||
@ -33,7 +33,6 @@ enum : uint8_t {
|
|||||||
PUS_SERVICE_23 = 103,
|
PUS_SERVICE_23 = 103,
|
||||||
MGM_LIS3MDL = 106,
|
MGM_LIS3MDL = 106,
|
||||||
MGM_RM3100 = 107,
|
MGM_RM3100 = 107,
|
||||||
CFDP = 108,
|
|
||||||
|
|
||||||
FW_SUBSYSTEM_ID_RANGE
|
FW_SUBSYSTEM_ID_RANGE
|
||||||
};
|
};
|
||||||
|
@ -76,17 +76,14 @@ timeval Clock::getUptime() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t Clock::getUptime(timeval* uptime) {
|
ReturnValue_t Clock::getUptime(timeval* uptime) {
|
||||||
|
// TODO This is not posix compatible and delivers only seconds precision
|
||||||
|
// Linux specific file read but more precise.
|
||||||
double uptimeSeconds;
|
double uptimeSeconds;
|
||||||
std::ifstream ifile("/proc/uptime");
|
if (std::ifstream("/proc/uptime", std::ios::in) >> uptimeSeconds) {
|
||||||
if (ifile.bad()) {
|
|
||||||
return returnvalue::FAILED;
|
|
||||||
}
|
|
||||||
if (ifile >> uptimeSeconds) {
|
|
||||||
uptime->tv_sec = uptimeSeconds;
|
uptime->tv_sec = uptimeSeconds;
|
||||||
uptime->tv_usec = uptimeSeconds * (double)1e6 - (uptime->tv_sec * 1e6);
|
uptime->tv_usec = uptimeSeconds * (double)1e6 - (uptime->tv_sec * 1e6);
|
||||||
return returnvalue::OK;
|
|
||||||
}
|
}
|
||||||
return returnvalue::FAILED;
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for new FSFW Clock function delivering seconds uptime.
|
// Wait for new FSFW Clock function delivering seconds uptime.
|
||||||
|
@ -32,7 +32,7 @@ class Fuse : public SystemObject,
|
|||||||
gp_id_t poolIdPower;
|
gp_id_t poolIdPower;
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::POWER_SWITCH_IF;
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PCDU_1;
|
||||||
//! PSS detected that current on a fuse is totally out of bounds.
|
//! PSS detected that current on a fuse is totally out of bounds.
|
||||||
static const Event FUSE_CURRENT_HIGH = MAKE_EVENT(1, severity::LOW);
|
static const Event FUSE_CURRENT_HIGH = MAKE_EVENT(1, severity::LOW);
|
||||||
//! PSS detected a fuse that went off.
|
//! PSS detected a fuse that went off.
|
||||||
|
@ -28,12 +28,10 @@ class PowerSwitchIF {
|
|||||||
static const ReturnValue_t SWITCH_TIMEOUT = MAKE_RETURN_CODE(2);
|
static const ReturnValue_t SWITCH_TIMEOUT = MAKE_RETURN_CODE(2);
|
||||||
static const ReturnValue_t FUSE_ON = MAKE_RETURN_CODE(3);
|
static const ReturnValue_t FUSE_ON = MAKE_RETURN_CODE(3);
|
||||||
static const ReturnValue_t FUSE_OFF = MAKE_RETURN_CODE(4);
|
static const ReturnValue_t FUSE_OFF = MAKE_RETURN_CODE(4);
|
||||||
static const ReturnValue_t SWITCH_UNKNOWN = MAKE_RETURN_CODE(5);
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PCDU_2;
|
||||||
|
static const Event SWITCH_WENT_OFF = MAKE_EVENT(
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::POWER_SWITCH_IF;
|
0, severity::LOW); //!< Someone detected that a switch went off which shouldn't. Severity:
|
||||||
//!< Someone detected that a switch went off which shouldn't. Severity:
|
//!< Low, Parameter1: switchId1, Parameter2: switchId2
|
||||||
//!< Low, Parameter1: switchId1, Parameter2: switchId2
|
|
||||||
static const Event SWITCH_WENT_OFF = MAKE_EVENT(0, severity::LOW);
|
|
||||||
/**
|
/**
|
||||||
* send a direct command to the Power Unit to enable/disable the specified switch.
|
* send a direct command to the Power Unit to enable/disable the specified switch.
|
||||||
*
|
*
|
||||||
@ -52,7 +50,6 @@ class PowerSwitchIF {
|
|||||||
* @return
|
* @return
|
||||||
* - @c SWITCH_ON if the specified switch is on.
|
* - @c SWITCH_ON if the specified switch is on.
|
||||||
* - @c SWITCH_OFF if the specified switch is off.
|
* - @c SWITCH_OFF if the specified switch is off.
|
||||||
* - @c SWITCH_UNKNOWN if the state of the specified switch is unknown.
|
|
||||||
* - @c returnvalue::FAILED if an error occured
|
* - @c returnvalue::FAILED if an error occured
|
||||||
*/
|
*/
|
||||||
virtual ReturnValue_t getSwitchState(power::Switch_t switchNr) const = 0;
|
virtual ReturnValue_t getSwitchState(power::Switch_t switchNr) const = 0;
|
||||||
|
@ -82,9 +82,6 @@ ReturnValue_t CServiceHealthCommanding::prepareCommand(CommandMessage *message,
|
|||||||
ReturnValue_t result = returnvalue::OK;
|
ReturnValue_t result = returnvalue::OK;
|
||||||
switch (subservice) {
|
switch (subservice) {
|
||||||
case (Subservice::COMMAND_SET_HEALTH): {
|
case (Subservice::COMMAND_SET_HEALTH): {
|
||||||
if (tcDataLen != sizeof(object_id_t) + sizeof(HasHealthIF::HealthState)) {
|
|
||||||
return CommandingServiceBase::INVALID_TC;
|
|
||||||
}
|
|
||||||
HealthSetCommand healthCommand;
|
HealthSetCommand healthCommand;
|
||||||
result = healthCommand.deSerialize(&tcData, &tcDataLen, SerializeIF::Endianness::BIG);
|
result = healthCommand.deSerialize(&tcData, &tcDataLen, SerializeIF::Endianness::BIG);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
@ -96,7 +93,7 @@ ReturnValue_t CServiceHealthCommanding::prepareCommand(CommandMessage *message,
|
|||||||
}
|
}
|
||||||
case (Subservice::COMMAND_ANNOUNCE_HEALTH): {
|
case (Subservice::COMMAND_ANNOUNCE_HEALTH): {
|
||||||
HealthMessage::setHealthMessage(message, HealthMessage::HEALTH_ANNOUNCE);
|
HealthMessage::setHealthMessage(message, HealthMessage::HEALTH_ANNOUNCE);
|
||||||
return CommandingServiceBase::EXECUTION_COMPLETE;
|
break;
|
||||||
}
|
}
|
||||||
case (Subservice::COMMAND_ANNOUNCE_HEALTH_ALL): {
|
case (Subservice::COMMAND_ANNOUNCE_HEALTH_ALL): {
|
||||||
ReturnValue_t result = iterateHealthTable(true);
|
ReturnValue_t result = iterateHealthTable(true);
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
|
||||||
|
|
||||||
#include "fsfw/FSFWVersion.h"
|
#include "fsfw/FSFWVersion.h"
|
||||||
|
|
||||||
@ -21,7 +20,7 @@ fsfw::Version::Version(int major, int minor, int revision, const char* addInfo)
|
|||||||
|
|
||||||
void fsfw::Version::getVersion(char* str, size_t maxLen) const {
|
void fsfw::Version::getVersion(char* str, size_t maxLen) const {
|
||||||
size_t len = snprintf(str, maxLen, "%d.%d.%d", major, minor, revision);
|
size_t len = snprintf(str, maxLen, "%d.%d.%d", major, minor, revision);
|
||||||
if (addInfo != nullptr and std::strcmp(addInfo, "") != 0) {
|
if (addInfo != nullptr) {
|
||||||
snprintf(str + len, maxLen - len, "-%s", addInfo);
|
snprintf(str + len, maxLen - len, "-%s", addInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -31,7 +30,7 @@ namespace fsfw {
|
|||||||
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
#if FSFW_CPP_OSTREAM_ENABLED == 1
|
||||||
std::ostream& operator<<(std::ostream& os, const Version& v) {
|
std::ostream& operator<<(std::ostream& os, const Version& v) {
|
||||||
os << v.major << "." << v.minor << "." << v.revision;
|
os << v.major << "." << v.minor << "." << v.revision;
|
||||||
if (v.addInfo != nullptr and std::strcmp(v.addInfo, "") != 0) {
|
if (v.addInfo != nullptr) {
|
||||||
os << "-" << v.addInfo;
|
os << "-" << v.addInfo;
|
||||||
}
|
}
|
||||||
return os;
|
return os;
|
||||||
|
Reference in New Issue
Block a user