Compare commits
18 Commits
tmtcbridge
...
a1567de9e8
Author | SHA1 | Date | |
---|---|---|---|
a1567de9e8 | |||
06dca7608a | |||
6af5274b68 | |||
0cc3231ceb | |||
041d1b8795 | |||
2aa4af6974 | |||
75fc7a056d | |||
1b005d706a | |||
e68f54b9bd | |||
296bc56e2a | |||
2b6a33e718 | |||
61fd5d1b62 | |||
046dbe1deb | |||
0303c1a885 | |||
4d2802a470 | |||
819a2bfac4 | |||
096af44e39 | |||
56e8e5a8b3 |
35
CHANGELOG.md
35
CHANGELOG.md
@@ -12,12 +12,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
||||||
- `CService200ModeManagement`: Various bugfixes which lead to now execution complete being generated
|
|
||||||
on mode announcements, duplicate mode reply generated on announce commands, and the mode read
|
|
||||||
subservice not working properly.
|
|
||||||
- `Service9TimeManagement`: Fix the time dump at the `SET_TIME` subservice: Include clock timeval
|
|
||||||
seconds instead of uptime.
|
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/726
|
|
||||||
- HAL MGM3100 Handler: Use axis specific gain/scaling factors. Previously,
|
- HAL MGM3100 Handler: Use axis specific gain/scaling factors. Previously,
|
||||||
only the X scaling factor was used.
|
only the X scaling factor was used.
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/724
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/724
|
||||||
@@ -25,6 +19,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
to false correctly because the `read` and `write` calls were missing.
|
to false correctly because the `read` and `write` calls were missing.
|
||||||
- PUS TMTC creator module: Sequence flags were set to continuation segment (0b00) instead
|
- PUS TMTC creator module: Sequence flags were set to continuation segment (0b00) instead
|
||||||
of the correct unsegmented flags (0b11) as specified in the standard.
|
of the correct unsegmented flags (0b11) as specified in the standard.
|
||||||
|
- `Service9TimeManagement`: Fix the time dump at the `SET_TIME` subservice: Include clock timeval
|
||||||
|
seconds instead of uptime.
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/726
|
||||||
- TC Scheduler Service 11: Add size and CRC check for contained TC.
|
- TC Scheduler Service 11: Add size and CRC check for contained TC.
|
||||||
- Only delete health table entry in `HealthHelper` destructor if
|
- Only delete health table entry in `HealthHelper` destructor if
|
||||||
health table was set.
|
health table was set.
|
||||||
@@ -38,11 +35,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- `TcpTmTcServer.cpp`: The server was actually not able to handle
|
- `TcpTmTcServer.cpp`: The server was actually not able to handle
|
||||||
CCSDS packets which were clumped together. This has been fixed now.
|
CCSDS packets which were clumped together. This has been fixed now.
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/673
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/673
|
||||||
|
- `CServiceHealthCommanding`: Add announce all health info implementation
|
||||||
|
PR: https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/122
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- `CServiceHealthCommanding`: Add announce all health info implementation
|
|
||||||
PR: https://egit.irs.uni-stuttgart.de/eive/fsfw/pulls/122
|
|
||||||
- `Service9TimeManagement`: Add `DUMP_TIME` (129) subservice.
|
- `Service9TimeManagement`: Add `DUMP_TIME` (129) subservice.
|
||||||
- `TcpTmTcServer`: Allow setting the `SO_REUSEADDR` and `SO_REUSEPORT`
|
- `TcpTmTcServer`: Allow setting the `SO_REUSEADDR` and `SO_REUSEPORT`
|
||||||
option on the TCP server. CTOR prototype has changed and expects an explicit
|
option on the TCP server. CTOR prototype has changed and expects an explicit
|
||||||
@@ -125,16 +122,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
implementation without an extra component
|
implementation without an extra component
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/682
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/682
|
||||||
|
|
||||||
## HAL
|
|
||||||
|
|
||||||
- SPI: Cache the SPI device in the communication interface. Architecturally, this makes a
|
|
||||||
lot more sense because each ComIF should be responsible for one SPI bus.
|
|
||||||
- SPI: Move the empty transfer to update the line polarity to separate function. This means
|
|
||||||
it is not automatically called when calling the setter function for SPI speed and mode.
|
|
||||||
The user should call this function after locking the CS mutex if multiple SPI devices with
|
|
||||||
differing speeds and modes are attached to one bus.
|
|
||||||
- SPI: Getter functions for SPI speed and mode.
|
|
||||||
|
|
||||||
# [v5.0.0] 25.07.2022
|
# [v5.0.0] 25.07.2022
|
||||||
|
|
||||||
## Changes
|
## Changes
|
||||||
@@ -268,7 +255,6 @@ https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/593
|
|||||||
- https://gitlab.kitware.com/cmake/cmake/-/issues/21696
|
- https://gitlab.kitware.com/cmake/cmake/-/issues/21696
|
||||||
Easiest solution for now: Keep this option OFF by default.
|
Easiest solution for now: Keep this option OFF by default.
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/616
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/616
|
||||||
- Linux HAL: Add wiretapping option for I2C. Enabled with `FSFW_HAL_I2C_WIRETAPPING` defined to 1
|
|
||||||
- Dedicated Version class and constant `fsfw::FSFW_VERSION` containing version information
|
- Dedicated Version class and constant `fsfw::FSFW_VERSION` containing version information
|
||||||
inside `fsfw/version.h`
|
inside `fsfw/version.h`
|
||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/559
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/559
|
||||||
@@ -283,6 +269,17 @@ https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/593
|
|||||||
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/590
|
PR: https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/590
|
||||||
- `Subsystem`: New API to add table and sequence entries
|
- `Subsystem`: New API to add table and sequence entries
|
||||||
|
|
||||||
|
## HAL
|
||||||
|
|
||||||
|
- SPI: Cache the SPI device in the communication interface. Architecturally, this makes a
|
||||||
|
lot more sense because each ComIF should be responsible for one SPI bus.
|
||||||
|
- SPI: Move the empty transfer to update the line polarity to separate function. This means
|
||||||
|
it is not automatically called when calling the setter function for SPI speed and mode.
|
||||||
|
The user should call this function after locking the CS mutex if multiple SPI devices with
|
||||||
|
differing speeds and modes are attached to one bus.
|
||||||
|
- SPI: Getter functions for SPI speed and mode.
|
||||||
|
- I2C: Add wiretapping option for I2C. Enabled with `FSFW_HAL_I2C_WIRETAPPING` defined to 1.
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- TCP TMTC Server: `MutexGuard` was not created properly in
|
- TCP TMTC Server: `MutexGuard` was not created properly in
|
||||||
|
@@ -35,8 +35,6 @@ void ModeMessage::setModeAnnounceMessage(CommandMessage& message, bool recursive
|
|||||||
message.setCommand(cmd);
|
message.setCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModeMessage::setCmdModeMessage(CommandMessage& message, Mode_t mode, Submode_t submode) {
|
void ModeMessage::setCmdModeModeMessage(CommandMessage& message, Mode_t mode, Submode_t submode) {
|
||||||
setModeMessage(&message, CMD_MODE_COMMAND, mode, submode);
|
setModeMessage(&message, CMD_MODE_COMMAND, mode, submode);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModeMessage::setModeReadMessage(CommandMessage& message) { message.setCommand(CMD_MODE_READ); }
|
|
||||||
|
@@ -38,15 +38,14 @@ class ModeMessage {
|
|||||||
|
|
||||||
ModeMessage() = delete;
|
ModeMessage() = delete;
|
||||||
|
|
||||||
|
static void setModeMessage(CommandMessage* message, Command_t command, Mode_t mode,
|
||||||
|
Submode_t submode);
|
||||||
static Mode_t getMode(const CommandMessage* message);
|
static Mode_t getMode(const CommandMessage* message);
|
||||||
static Submode_t getSubmode(const CommandMessage* message);
|
static Submode_t getSubmode(const CommandMessage* message);
|
||||||
static ReturnValue_t getCantReachModeReason(const CommandMessage* message);
|
static ReturnValue_t getCantReachModeReason(const CommandMessage* message);
|
||||||
|
|
||||||
static void setModeMessage(CommandMessage* message, Command_t command, Mode_t mode,
|
static void setCmdModeModeMessage(CommandMessage& message, Mode_t mode, Submode_t submode);
|
||||||
Submode_t submode);
|
|
||||||
static void setCmdModeMessage(CommandMessage& message, Mode_t mode, Submode_t submode);
|
|
||||||
static void setModeAnnounceMessage(CommandMessage& message, bool recursive);
|
static void setModeAnnounceMessage(CommandMessage& message, bool recursive);
|
||||||
static void setModeReadMessage(CommandMessage& message);
|
|
||||||
static void setCantReachMode(CommandMessage* message, ReturnValue_t reason);
|
static void setCantReachMode(CommandMessage* message, ReturnValue_t reason);
|
||||||
static void clear(CommandMessage* message);
|
static void clear(CommandMessage* message);
|
||||||
};
|
};
|
||||||
|
@@ -54,36 +54,27 @@ ReturnValue_t CService200ModeCommanding::checkInterfaceAndAcquireMessageQueue(
|
|||||||
ReturnValue_t CService200ModeCommanding::prepareCommand(CommandMessage *message, uint8_t subservice,
|
ReturnValue_t CService200ModeCommanding::prepareCommand(CommandMessage *message, uint8_t subservice,
|
||||||
const uint8_t *tcData, size_t tcDataLen,
|
const uint8_t *tcData, size_t tcDataLen,
|
||||||
uint32_t *state, object_id_t objectId) {
|
uint32_t *state, object_id_t objectId) {
|
||||||
switch (subservice) {
|
ReturnValue_t result = returnvalue::OK;
|
||||||
case (Subservice::COMMAND_MODE_COMMAND): {
|
if (subservice == Subservice::COMMAND_MODE_ANNCOUNCE or
|
||||||
ModePacket modeCommandPacket;
|
subservice == Subservice::COMMAND_MODE_ANNOUNCE_RECURSIVELY) {
|
||||||
ReturnValue_t result =
|
bool recursive = true;
|
||||||
modeCommandPacket.deSerialize(&tcData, &tcDataLen, SerializeIF::Endianness::BIG);
|
if (subservice == Subservice::COMMAND_MODE_ANNCOUNCE) {
|
||||||
if (result != returnvalue::OK) {
|
recursive = false;
|
||||||
return result;
|
}
|
||||||
}
|
ModeMessage::setModeAnnounceMessage(*message, recursive);
|
||||||
|
} else {
|
||||||
|
ModePacket modeCommandPacket;
|
||||||
|
ReturnValue_t result =
|
||||||
|
modeCommandPacket.deSerialize(&tcData, &tcDataLen, SerializeIF::Endianness::BIG);
|
||||||
|
if (result != returnvalue::OK) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
ModeMessage::setModeMessage(message, ModeMessage::CMD_MODE_COMMAND,
|
ModeMessage::setModeMessage(message, ModeMessage::CMD_MODE_COMMAND, modeCommandPacket.getMode(),
|
||||||
modeCommandPacket.getMode(), modeCommandPacket.getSubmode());
|
modeCommandPacket.getSubmode());
|
||||||
return returnvalue::OK;
|
|
||||||
}
|
|
||||||
case (Subservice::COMMAND_MODE_ANNCOUNCE):
|
|
||||||
case (Subservice::COMMAND_MODE_ANNOUNCE_RECURSIVELY): {
|
|
||||||
bool recursive = true;
|
|
||||||
if (subservice == Subservice::COMMAND_MODE_ANNCOUNCE) {
|
|
||||||
recursive = false;
|
|
||||||
}
|
|
||||||
ModeMessage::setModeAnnounceMessage(*message, recursive);
|
|
||||||
return EXECUTION_COMPLETE;
|
|
||||||
}
|
|
||||||
case (Subservice::COMMAND_MODE_READ): {
|
|
||||||
ModeMessage::setModeReadMessage(*message);
|
|
||||||
return returnvalue::OK;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
return CommandingServiceBase::INVALID_SUBSERVICE;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ReturnValue_t CService200ModeCommanding::handleReply(const CommandMessage *reply,
|
ReturnValue_t CService200ModeCommanding::handleReply(const CommandMessage *reply,
|
||||||
@@ -94,10 +85,8 @@ ReturnValue_t CService200ModeCommanding::handleReply(const CommandMessage *reply
|
|||||||
ReturnValue_t result = returnvalue::FAILED;
|
ReturnValue_t result = returnvalue::FAILED;
|
||||||
switch (replyId) {
|
switch (replyId) {
|
||||||
case (ModeMessage::REPLY_MODE_REPLY): {
|
case (ModeMessage::REPLY_MODE_REPLY): {
|
||||||
if (previousCommand != ModeMessage::CMD_MODE_COMMAND) {
|
result = prepareModeReply(reply, objectId);
|
||||||
return prepareModeReply(reply, objectId);
|
break;
|
||||||
}
|
|
||||||
return returnvalue::OK;
|
|
||||||
}
|
}
|
||||||
case (ModeMessage::REPLY_WRONG_MODE_REPLY): {
|
case (ModeMessage::REPLY_WRONG_MODE_REPLY): {
|
||||||
result = prepareWrongModeReply(reply, objectId);
|
result = prepareWrongModeReply(reply, objectId);
|
||||||
|
@@ -246,6 +246,20 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to, const uint8_t*
|
|||||||
return UNSUPPORTED_TIME_FORMAT;
|
return UNSUPPORTED_TIME_FORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ReturnValue_t CCSDSTime::convertToAsciiWithSecs(int8_t* to, const Clock::TimeOfDay_t* from,
|
||||||
|
uint8_t length) {
|
||||||
|
if (from == nullptr or to == nullptr) {
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
|
int count = snprintf(reinterpret_cast<char*>(to), length,
|
||||||
|
"%4" SCNu32 "-%2" SCNu32 "-%2" SCNu32 "T%2" SCNu32 ":%2" SCNu32 ":%2" SCNu32,
|
||||||
|
from->year, from->month, from->day, from->hour, from->minute, from->second);
|
||||||
|
if (count >= length) {
|
||||||
|
return returnvalue::FAILED;
|
||||||
|
}
|
||||||
|
return returnvalue::OK;
|
||||||
|
}
|
||||||
|
|
||||||
ReturnValue_t CCSDSTime::checkCcs(const uint8_t* time, uint8_t length) {
|
ReturnValue_t CCSDSTime::checkCcs(const uint8_t* time, uint8_t length) {
|
||||||
const Ccs_mseconds* time_struct = reinterpret_cast<const Ccs_mseconds*>(time);
|
const Ccs_mseconds* time_struct = reinterpret_cast<const Ccs_mseconds*>(time);
|
||||||
|
|
||||||
|
@@ -207,7 +207,8 @@ class CCSDSTime {
|
|||||||
|
|
||||||
static ReturnValue_t convertFromASCII(Clock::TimeOfDay_t *to, uint8_t const *from,
|
static ReturnValue_t convertFromASCII(Clock::TimeOfDay_t *to, uint8_t const *from,
|
||||||
uint8_t length);
|
uint8_t length);
|
||||||
|
static ReturnValue_t convertToAsciiWithSecs(int8_t *to, const Clock::TimeOfDay_t *from,
|
||||||
|
uint8_t length);
|
||||||
static uint32_t subsecondsToMicroseconds(uint16_t subseconds);
|
static uint32_t subsecondsToMicroseconds(uint16_t subseconds);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
#include "fsfw/timemanager/Clock.h"
|
#include "fsfw/timemanager/Clock.h"
|
||||||
|
|
||||||
|
CdsShortTimeStamper::CdsShortTimeStamper() : SystemObject(0, false) {}
|
||||||
|
|
||||||
CdsShortTimeStamper::CdsShortTimeStamper(object_id_t objectId) : SystemObject(objectId) {}
|
CdsShortTimeStamper::CdsShortTimeStamper(object_id_t objectId) : SystemObject(objectId) {}
|
||||||
|
|
||||||
ReturnValue_t CdsShortTimeStamper::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
ReturnValue_t CdsShortTimeStamper::serialize(uint8_t **buffer, size_t *size, size_t maxSize,
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
class CdsShortTimeStamper : public TimeWriterIF, public TimeReaderIF, public SystemObject {
|
class CdsShortTimeStamper : public TimeWriterIF, public TimeReaderIF, public SystemObject {
|
||||||
public:
|
public:
|
||||||
static constexpr size_t TIMESTAMP_LEN = 7;
|
static constexpr size_t TIMESTAMP_LEN = 7;
|
||||||
|
CdsShortTimeStamper();
|
||||||
/**
|
/**
|
||||||
* @brief Default constructor which also registers the time stamper as a
|
* @brief Default constructor which also registers the time stamper as a
|
||||||
* system object so it can be found with the #objectManager.
|
* system object so it can be found with the #objectManager.
|
||||||
|
@@ -6,47 +6,12 @@
|
|||||||
#include "fsfw/returnvalues/returnvalue.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
#include "tmStorageConf.h"
|
#include "tmStorageConf.h"
|
||||||
|
|
||||||
class TmPacketMinimal;
|
class PusTmReader;
|
||||||
class SpacePacketBase;
|
class SpacePacketReader;
|
||||||
class TmStoreBackendIF;
|
class TmStoreBackendIF;
|
||||||
|
|
||||||
class TmStoreFrontendIF {
|
class TmStoreFrontendIF {
|
||||||
public:
|
public:
|
||||||
virtual TmStoreBackendIF* getBackend() const = 0;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* What do I need to implement here?
|
|
||||||
* This is propably used by PUS Service 15 so we should propably check for messages..
|
|
||||||
* Provide base implementation?
|
|
||||||
* @param opCode
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
virtual ReturnValue_t performOperation(uint8_t opCode) = 0;
|
|
||||||
/**
|
|
||||||
* Callback from the back-end to indicate a certain packet was received.
|
|
||||||
* front-end takes care of discarding/downloading the packet.
|
|
||||||
* @param packet Pointer to the newly received Space Packet.
|
|
||||||
* @param address Start address of the packet found
|
|
||||||
* @param isLastPacket Indicates if no more packets can be fetched.
|
|
||||||
* @return If more packets shall be fetched, returnvalue::OK must be returned.
|
|
||||||
* Any other code stops fetching packets.
|
|
||||||
*/
|
|
||||||
virtual ReturnValue_t packetRetrieved(TmPacketMinimal* packet, uint32_t address) = 0;
|
|
||||||
virtual void noMorePacketsInStore() = 0;
|
|
||||||
virtual void handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1 = 0,
|
|
||||||
uint32_t parameter2 = 0) = 0;
|
|
||||||
/**
|
|
||||||
* To get the queue where commands shall be sent.
|
|
||||||
* @return Id of command queue.
|
|
||||||
*/
|
|
||||||
virtual MessageQueueId_t getCommandQueue() const = 0;
|
|
||||||
virtual ReturnValue_t fetchPackets(ApidSsc start, ApidSsc end) = 0;
|
|
||||||
virtual ReturnValue_t deletePackets(ApidSsc upTo) = 0;
|
|
||||||
virtual ReturnValue_t checkPacket(SpacePacketBase* tmPacket) = 0;
|
|
||||||
virtual bool isEnabled() const = 0;
|
|
||||||
virtual void setEnabled(bool enabled) = 0;
|
|
||||||
virtual void resetDownlinkedPacketCount() = 0;
|
|
||||||
virtual ReturnValue_t setDumpTarget(object_id_t dumpTarget) = 0;
|
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::TM_STORE_FRONTEND_IF;
|
static const uint8_t INTERFACE_ID = CLASS_ID::TM_STORE_FRONTEND_IF;
|
||||||
static const ReturnValue_t BUSY = MAKE_RETURN_CODE(1);
|
static const ReturnValue_t BUSY = MAKE_RETURN_CODE(1);
|
||||||
static const ReturnValue_t LAST_PACKET_FOUND = MAKE_RETURN_CODE(2);
|
static const ReturnValue_t LAST_PACKET_FOUND = MAKE_RETURN_CODE(2);
|
||||||
@@ -57,7 +22,38 @@ class TmStoreFrontendIF {
|
|||||||
static const ReturnValue_t ALL_DELETED = MAKE_RETURN_CODE(7);
|
static const ReturnValue_t ALL_DELETED = MAKE_RETURN_CODE(7);
|
||||||
static const ReturnValue_t INVALID_DATA = MAKE_RETURN_CODE(8);
|
static const ReturnValue_t INVALID_DATA = MAKE_RETURN_CODE(8);
|
||||||
static const ReturnValue_t NOT_READY = MAKE_RETURN_CODE(9);
|
static const ReturnValue_t NOT_READY = MAKE_RETURN_CODE(9);
|
||||||
virtual ~TmStoreFrontendIF() {}
|
|
||||||
|
virtual ~TmStoreFrontendIF() = default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* To get the queue where commands shall be sent.
|
||||||
|
* @return Id of command queue.
|
||||||
|
*/
|
||||||
|
virtual MessageQueueId_t getCommandQueue() const = 0;
|
||||||
|
|
||||||
|
virtual TmStoreBackendIF* getBackend() const = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback from the back-end to indicate a certain packet was received.
|
||||||
|
* front-end takes care of discarding/downloading the packet.
|
||||||
|
* @param packet Pointer to the newly received Space Packet.
|
||||||
|
* @param address Start address of the packet found
|
||||||
|
* @param isLastPacket Indicates if no more packets can be fetched.
|
||||||
|
* @return If more packets shall be fetched, returnvalue::OK must be returned.
|
||||||
|
* Any other code stops fetching packets.
|
||||||
|
*/
|
||||||
|
virtual ReturnValue_t packetRetrieved(PusTmReader* packet, uint32_t address) = 0;
|
||||||
|
virtual void noMorePacketsInStore() = 0;
|
||||||
|
virtual void handleRetrievalFailed(ReturnValue_t errorCode, uint32_t parameter1 = 0,
|
||||||
|
uint32_t parameter2 = 0) = 0;
|
||||||
|
|
||||||
|
virtual ReturnValue_t fetchPackets(ApidSsc start, ApidSsc end) = 0;
|
||||||
|
virtual ReturnValue_t deletePackets(ApidSsc upTo) = 0;
|
||||||
|
virtual ReturnValue_t checkPacket(SpacePacketReader* tmPacket) = 0;
|
||||||
|
virtual bool isEnabled() const = 0;
|
||||||
|
virtual void setEnabled(bool enabled) = 0;
|
||||||
|
virtual void resetDownlinkedPacketCount() = 0;
|
||||||
|
virtual ReturnValue_t setDumpTarget(object_id_t dumpTarget) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_ */
|
#endif /* FSFW_TMTCSERVICES_TMSTOREFRONTENDIF_H_ */
|
||||||
|
15
src/fsfw/tmstorage/TmStoreFrontendSimpleIF.h
Normal file
15
src/fsfw/tmstorage/TmStoreFrontendSimpleIF.h
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
#ifndef FSFW_SRC_FSFW_TMSTORAGE_TMSTOREBACKENDSIMPLEIF_H_
|
||||||
|
#define FSFW_SRC_FSFW_TMSTORAGE_TMSTOREBACKENDSIMPLEIF_H_
|
||||||
|
|
||||||
|
#include <fsfw/ipc/messageQueueDefinitions.h>
|
||||||
|
|
||||||
|
class TmStoreFrontendSimpleIF {
|
||||||
|
public:
|
||||||
|
virtual ~TmStoreFrontendSimpleIF() = default;
|
||||||
|
|
||||||
|
virtual MessageQueueId_t getCommandQueue() const = 0;
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* FSFW_SRC_FSFW_TMSTORAGE_TMSTOREBACKENDSIMPLEIF_H_ */
|
@@ -1,6 +1,10 @@
|
|||||||
#ifndef FSFW_TMSTORAGE_TMSTOREPACKETS_H_
|
#ifndef FSFW_TMSTORAGE_TMSTOREPACKETS_H_
|
||||||
#define FSFW_TMSTORAGE_TMSTOREPACKETS_H_
|
#define FSFW_TMSTORAGE_TMSTOREPACKETS_H_
|
||||||
|
|
||||||
|
#include <fsfw/tmtcpacket/pus/tm/PusTmReader.h>
|
||||||
|
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "fsfw/globalfunctions/timevalOperations.h"
|
#include "fsfw/globalfunctions/timevalOperations.h"
|
||||||
#include "fsfw/serialize/SerialBufferAdapter.h"
|
#include "fsfw/serialize/SerialBufferAdapter.h"
|
||||||
#include "fsfw/serialize/SerialFixedArrayListAdapter.h"
|
#include "fsfw/serialize/SerialFixedArrayListAdapter.h"
|
||||||
@@ -24,7 +28,7 @@ class ServiceSubservice : public SerialLinkedListAdapter<SerializeIF> {
|
|||||||
|
|
||||||
class ApidSsc : public SerializeIF {
|
class ApidSsc : public SerializeIF {
|
||||||
public:
|
public:
|
||||||
ApidSsc() : apid(SpacePacketBase::LIMIT_APID), ssc(0) {}
|
ApidSsc() : apid(ccsds::LIMIT_APID), ssc(0) {}
|
||||||
ApidSsc(uint16_t apid, uint16_t ssc) : apid(apid), ssc(ssc) {}
|
ApidSsc(uint16_t apid, uint16_t ssc) : apid(apid), ssc(ssc) {}
|
||||||
uint16_t apid;
|
uint16_t apid;
|
||||||
uint16_t ssc;
|
uint16_t ssc;
|
||||||
@@ -62,51 +66,59 @@ class ChangeSelectionDefinition : public SerialLinkedListAdapter<SerializeIF> {
|
|||||||
|
|
||||||
class TmPacketInformation : public SerializeIF {
|
class TmPacketInformation : public SerializeIF {
|
||||||
public:
|
public:
|
||||||
TmPacketInformation(TmPacketMinimal* packet) { setContent(packet); }
|
TmPacketInformation(PusTmReader* packet, size_t timestampLen) : rawTimestamp(timestampLen) {
|
||||||
TmPacketInformation()
|
setContent(packet);
|
||||||
: apid(SpacePacketBase::LIMIT_APID),
|
}
|
||||||
|
TmPacketInformation(size_t timestampLen)
|
||||||
|
: apid(ccsds::LIMIT_APID),
|
||||||
sourceSequenceCount(0),
|
sourceSequenceCount(0),
|
||||||
serviceType(0),
|
serviceType(0),
|
||||||
serviceSubtype(0),
|
serviceSubtype(0),
|
||||||
subCounter(0) {}
|
subCounter(0),
|
||||||
|
rawTimestamp(timestampLen) {}
|
||||||
void reset() {
|
void reset() {
|
||||||
apid = SpacePacketBase::LIMIT_APID;
|
apid = ccsds::LIMIT_APID;
|
||||||
sourceSequenceCount = 0;
|
sourceSequenceCount = 0;
|
||||||
serviceType = 0;
|
serviceType = 0;
|
||||||
serviceSubtype = 0;
|
serviceSubtype = 0;
|
||||||
subCounter = 0;
|
subCounter = 0;
|
||||||
memset(rawTimestamp, 0, sizeof(rawTimestamp));
|
memset(rawTimestamp.data(), 0, rawTimestamp.size());
|
||||||
}
|
}
|
||||||
void setContent(TmPacketMinimal* packet) {
|
void setContent(PusTmReader* packet) {
|
||||||
apid = packet->getAPID();
|
apid = packet->getApid();
|
||||||
sourceSequenceCount = packet->getPacketSequenceCount();
|
sourceSequenceCount = packet->getSequenceCount();
|
||||||
serviceType = packet->getService();
|
serviceType = packet->getService();
|
||||||
serviceSubtype = packet->getSubService();
|
serviceSubtype = packet->getSubService();
|
||||||
subCounter = packet->getPacketSubcounter();
|
subCounter = packet->getMessageTypeCounter();
|
||||||
memset(rawTimestamp, 0, sizeof(rawTimestamp));
|
memset(rawTimestamp.data(), 0, rawTimestamp.size());
|
||||||
const uint8_t* pField = NULL;
|
// TODO: Fix all of this
|
||||||
uint32_t size = 0;
|
// const uint8_t* pField = NULL;
|
||||||
ReturnValue_t result = packet->getPacketTimeRaw(&pField, &size);
|
// uint32_t size = 0;
|
||||||
if (result != returnvalue::OK) {
|
// auto* timeReader = packet->getTimeReader();
|
||||||
return;
|
// ReturnValue_t result = packet->getPacketTimeRaw(&pField, &size);
|
||||||
}
|
// if (result != returnvalue::OK) {
|
||||||
if (*pField == CCSDSTime::P_FIELD_CDS_SHORT && size <= TimeStamperIF::MISSION_TIMESTAMP_SIZE) {
|
// return;
|
||||||
// Shortcut to avoid converting CDS back and forth.
|
//}
|
||||||
memcpy(rawTimestamp, pField, size);
|
// if (*pField == CCSDSTime::P_FIELD_CDS_SHORT && size <= TimeStamperIF::MISSION_TIMESTAMP_SIZE)
|
||||||
return;
|
// {
|
||||||
}
|
// Shortcut to avoid converting CDS back and forth.
|
||||||
timeval time = {0, 0};
|
// TODO: Fix
|
||||||
result = packet->getPacketTime(&time);
|
// memcpy(rawTimestamp, pField, size);
|
||||||
if (result != returnvalue::OK) {
|
// return;
|
||||||
return;
|
// }
|
||||||
}
|
// timeval time = {0, 0};
|
||||||
|
// result = packet->getPacketTime(&time);
|
||||||
CCSDSTime::CDS_short cdsFormat;
|
// if (result != returnvalue::OK) {
|
||||||
result = CCSDSTime::convertToCcsds(&cdsFormat, &time);
|
// return;
|
||||||
if (result != returnvalue::OK) {
|
// }
|
||||||
return;
|
//
|
||||||
}
|
// CCSDSTime::CDS_short cdsFormat;
|
||||||
memcpy(rawTimestamp, &cdsFormat, sizeof(cdsFormat));
|
// result = CCSDSTime::convertToCcsds(&cdsFormat, &time);
|
||||||
|
// if (result != returnvalue::OK) {
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
// TODO: Fix
|
||||||
|
// memcpy(rawTimestamp, &cdsFormat, sizeof(cdsFormat));
|
||||||
}
|
}
|
||||||
void setContent(TmPacketInformation* content) {
|
void setContent(TmPacketInformation* content) {
|
||||||
apid = content->apid;
|
apid = content->apid;
|
||||||
@@ -114,9 +126,10 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
serviceType = content->serviceType;
|
serviceType = content->serviceType;
|
||||||
serviceSubtype = content->serviceSubtype;
|
serviceSubtype = content->serviceSubtype;
|
||||||
subCounter = content->subCounter;
|
subCounter = content->subCounter;
|
||||||
memcpy(rawTimestamp, content->rawTimestamp, sizeof(rawTimestamp));
|
// TODO: Fix
|
||||||
|
// memcpy(rawTimestamp, content->rawTimestamp, sizeof(rawTimestamp));
|
||||||
}
|
}
|
||||||
bool isValid() const { return (apid < SpacePacketBase::LIMIT_APID) ? true : false; }
|
bool isValid() const { return (apid < ccsds::LIMIT_APID) ? true : false; }
|
||||||
static void reset(TmPacketInformation* packet) { packet->reset(); }
|
static void reset(TmPacketInformation* packet) { packet->reset(); }
|
||||||
|
|
||||||
static bool isOlderThan(const TmPacketInformation* packet, const timeval* cmpTime) {
|
static bool isOlderThan(const TmPacketInformation* packet, const timeval* cmpTime) {
|
||||||
@@ -216,7 +229,7 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
SerialBufferAdapter<uint8_t> adapter(rawTimestamp, sizeof(rawTimestamp));
|
SerialBufferAdapter<uint8_t> adapter(rawTimestamp.data(), rawTimestamp.size());
|
||||||
return adapter.serialize(buffer, size, maxSize, streamEndianness);
|
return adapter.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,7 +240,7 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
size += SerializeAdapter::getSerializedSize(&serviceType);
|
size += SerializeAdapter::getSerializedSize(&serviceType);
|
||||||
size += SerializeAdapter::getSerializedSize(&serviceSubtype);
|
size += SerializeAdapter::getSerializedSize(&serviceSubtype);
|
||||||
size += SerializeAdapter::getSerializedSize(&subCounter);
|
size += SerializeAdapter::getSerializedSize(&subCounter);
|
||||||
SerialBufferAdapter<uint8_t> adapter(rawTimestamp, sizeof(rawTimestamp));
|
SerialBufferAdapter<uint8_t> adapter(rawTimestamp.data(), rawTimestamp.size());
|
||||||
size += adapter.getSerializedSize();
|
size += adapter.getSerializedSize();
|
||||||
return size;
|
return size;
|
||||||
};
|
};
|
||||||
@@ -253,7 +266,7 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
SerialBufferAdapter<uint8_t> adapter(rawTimestamp, sizeof(rawTimestamp));
|
SerialBufferAdapter<uint8_t> adapter(rawTimestamp.data(), rawTimestamp.size());
|
||||||
return adapter.deSerialize(buffer, size, streamEndianness);
|
return adapter.deSerialize(buffer, size, streamEndianness);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -263,6 +276,6 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
uint8_t serviceType;
|
uint8_t serviceType;
|
||||||
uint8_t serviceSubtype;
|
uint8_t serviceSubtype;
|
||||||
uint8_t subCounter;
|
uint8_t subCounter;
|
||||||
uint8_t rawTimestamp[TimeStamperIF::MISSION_TIMESTAMP_SIZE];
|
std::vector<uint8_t> rawTimestamp;
|
||||||
};
|
};
|
||||||
#endif /* FSFW_TMSTORAGE_TMSTOREPACKETS_H_ */
|
#endif /* FSFW_TMSTORAGE_TMSTOREPACKETS_H_ */
|
||||||
|
@@ -145,17 +145,13 @@ ReturnValue_t TmTcBridge::handleTmQueue() {
|
|||||||
#endif /* FSFW_VERBOSE_LEVEL >= 3 */
|
#endif /* FSFW_VERBOSE_LEVEL >= 3 */
|
||||||
|
|
||||||
if (communicationLinkUp == false or packetSentCounter >= sentPacketsPerCycle) {
|
if (communicationLinkUp == false or packetSentCounter >= sentPacketsPerCycle) {
|
||||||
ReturnValue_t result = storeDownlinkData(&message);
|
storeDownlinkData(&message);
|
||||||
if (result != returnvalue::OK) {
|
|
||||||
tmStore->deleteData(message.getStorageId());
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = tmStore->getData(message.getStorageId(), &data, &size);
|
result = tmStore->getData(message.getStorageId(), &data, &size);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
status = result;
|
status = result;
|
||||||
tmStore->deleteData(message.getStorageId());
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,9 +159,9 @@ ReturnValue_t TmTcBridge::handleTmQueue() {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
status = result;
|
status = result;
|
||||||
} else {
|
} else {
|
||||||
|
tmStore->deleteData(message.getStorageId());
|
||||||
packetSentCounter++;
|
packetSentCounter++;
|
||||||
}
|
}
|
||||||
tmStore->deleteData(message.getStorageId());
|
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <fsfw_hal/linux/serial/SerialComIF.h>
|
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user