finished power clean up
All checks were successful
EIVE/eive-obsw/pipeline/head This commit looks good

This commit is contained in:
2023-03-26 16:16:54 +02:00
parent 7c700a9e19
commit e7eaaa9295
12 changed files with 11 additions and 13 deletions

View File

@ -1,6 +1,7 @@
target_sources(
${LIB_EIVE_MISSION}
PRIVATE Pdu1Handler.cpp
PRIVATE CspCookie.cpp
Pdu1Handler.cpp
Pdu2Handler.cpp
AcuHandler.cpp
P60DockHandler.cpp

View File

@ -0,0 +1,29 @@
#include <mission/power/CspCookie.h>
using namespace GOMSPACE;
CspCookie::CspCookie(uint16_t maxReplyLength_, uint8_t cspAddress_, uint32_t timeoutMs)
: maxReplyLength(maxReplyLength_),
cspAddress(cspAddress_),
timeoutMs(timeoutMs),
reqType(SpecialRequestTypes::DEFAULT_COM_IF) {}
CspCookie::~CspCookie() {}
uint16_t CspCookie::getMaxReplyLength() { return maxReplyLength; }
uint8_t CspCookie::getCspAddress() { return cspAddress; }
GOMSPACE::SpecialRequestTypes CspCookie::getRequest() const { return reqType; }
void CspCookie::setRequest(GOMSPACE::SpecialRequestTypes request, size_t replyLen_) {
reqType = request;
replyLen = replyLen_;
}
uint8_t CspCookie::getCspPort() const { return cspPort; }
uint32_t CspCookie::getTimeout() const { return timeoutMs; }
void CspCookie::setCspPort(uint8_t port) { cspPort = port; }
size_t CspCookie::getReplyLen() const { return replyLen; }

38
mission/power/CspCookie.h Normal file
View File

@ -0,0 +1,38 @@
#ifndef LINUX_CSP_CSPCOOKIE_H_
#define LINUX_CSP_CSPCOOKIE_H_
#include <fsfw/devicehandlers/CookieIF.h>
#include <mission/power/gsDefs.h>
#include <cstddef>
#include <cstdint>
/**
* @brief This is the cookie for devices supporting the CSP (CubeSat Space
* Protocol).
* @author J. Meier
*/
class CspCookie : public CookieIF {
public:
CspCookie(uint16_t maxReplyLength_, uint8_t cspAddress_, uint32_t timeoutMs);
virtual ~CspCookie();
void setCspPort(uint8_t port);
uint8_t getCspPort() const;
uint16_t getMaxReplyLength();
GOMSPACE::SpecialRequestTypes getRequest() const;
void setRequest(GOMSPACE::SpecialRequestTypes request, size_t replyLen);
size_t getReplyLen() const;
uint8_t getCspAddress();
uint32_t getTimeout() const;
private:
uint8_t cspPort = 0;
uint16_t maxReplyLength;
uint8_t cspAddress;
size_t replyLen = 0;
uint32_t timeoutMs;
GOMSPACE::SpecialRequestTypes reqType;
};
#endif /* LINUX_CSP_CSPCOOKIE_H_ */

View File

@ -1,8 +1,9 @@
#include <fsfw/datapool/PoolReadGuard.h>
#include <fsfw/globalfunctions/arrayprinter.h>
#include <mission/power/defs.h>
#include <mission/power/GomSpacePackets.h>
#include <mission/power/GomspaceDeviceHandler.h>
#include <mission/power/defs.h>
#include <cassert>
#include "eive/objects.h"

View File

@ -1,7 +1,7 @@
#ifndef MISSION_POWER_GOMSPACEDEVICEHANDLER_H_
#define MISSION_POWER_GOMSPACEDEVICEHANDLER_H_
#include <mission/csp/CspCookie.h>
#include <mission/power/CspCookie.h>
#include <mission/power/GomSpacePackets.h>
#include <mission/power/gsDefs.h>

View File

@ -8,8 +8,8 @@
#include <fsfw/power/PowerSwitchIF.h>
#include <fsfw/tasks/ExecutableObjectIF.h>
#include <fsfw/timemanager/CCSDSTime.h>
#include <mission/power/defs.h>
#include <mission/power/GomspaceDeviceHandler.h>
#include <mission/power/defs.h>
#include <mission/power/gsDefs.h>
/**

View File

@ -19,13 +19,11 @@ static constexpr Event SWITCHING_Q7S_DENIED = event::makeEvent(SUBSYSTEM_ID, 2,
static constexpr Event FDIR_REACTION_IGNORED = event::makeEvent(SUBSYSTEM_ID, 3, severity::MEDIUM);
enum class States { IDLE, SWITCHING_POWER, CHECKING_POWER, MODE_COMMANDING };
enum class OpCodes { NONE, TO_OFF_DONE, TO_NOT_OFF_DONE, TIMEOUT_OCCURED };
} // namespace power
namespace duallane {
enum Submodes : Submode_t { A_SIDE = 0, B_SIDE = 1, DUAL_MODE = 2 };