Compare commits
9 Commits
a1567de9e8
...
tmtcbridge
Author | SHA1 | Date | |
---|---|---|---|
6f05d6b7b0 | |||
84bbef0167 | |||
88b2b0e005 | |||
6445debfa1 | |||
8014e4adf9 | |||
84dc7ac0ce | |||
ec12ab5daa | |||
69c94645df | |||
37e850c5a7 |
35
CHANGELOG.md
35
CHANGELOG.md
@ -12,6 +12,12 @@ 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
|
||||||
@ -19,9 +25,6 @@ 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.
|
||||||
@ -35,11 +38,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
|
||||||
@ -122,6 +125,16 @@ 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
|
||||||
@ -255,6 +268,7 @@ 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
|
||||||
@ -269,17 +283,6 @@ 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,6 +35,8 @@ void ModeMessage::setModeAnnounceMessage(CommandMessage& message, bool recursive
|
|||||||
message.setCommand(cmd);
|
message.setCommand(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ModeMessage::setCmdModeModeMessage(CommandMessage& message, Mode_t mode, Submode_t submode) {
|
void ModeMessage::setCmdModeMessage(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,14 +38,15 @@ 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 setCmdModeModeMessage(CommandMessage& message, Mode_t mode, Submode_t submode);
|
static void setModeMessage(CommandMessage* message, Command_t command, Mode_t mode,
|
||||||
|
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,15 +54,8 @@ 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) {
|
||||||
ReturnValue_t result = returnvalue::OK;
|
switch (subservice) {
|
||||||
if (subservice == Subservice::COMMAND_MODE_ANNCOUNCE or
|
case (Subservice::COMMAND_MODE_COMMAND): {
|
||||||
subservice == Subservice::COMMAND_MODE_ANNOUNCE_RECURSIVELY) {
|
|
||||||
bool recursive = true;
|
|
||||||
if (subservice == Subservice::COMMAND_MODE_ANNCOUNCE) {
|
|
||||||
recursive = false;
|
|
||||||
}
|
|
||||||
ModeMessage::setModeAnnounceMessage(*message, recursive);
|
|
||||||
} else {
|
|
||||||
ModePacket modeCommandPacket;
|
ModePacket modeCommandPacket;
|
||||||
ReturnValue_t result =
|
ReturnValue_t result =
|
||||||
modeCommandPacket.deSerialize(&tcData, &tcDataLen, SerializeIF::Endianness::BIG);
|
modeCommandPacket.deSerialize(&tcData, &tcDataLen, SerializeIF::Endianness::BIG);
|
||||||
@ -70,11 +63,27 @@ ReturnValue_t CService200ModeCommanding::prepareCommand(CommandMessage *message,
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ModeMessage::setModeMessage(message, ModeMessage::CMD_MODE_COMMAND, modeCommandPacket.getMode(),
|
ModeMessage::setModeMessage(message, ModeMessage::CMD_MODE_COMMAND,
|
||||||
modeCommandPacket.getSubmode());
|
modeCommandPacket.getMode(), 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,
|
||||||
@ -85,8 +94,10 @@ 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): {
|
||||||
result = prepareModeReply(reply, objectId);
|
if (previousCommand != ModeMessage::CMD_MODE_COMMAND) {
|
||||||
break;
|
return prepareModeReply(reply, objectId);
|
||||||
|
}
|
||||||
|
return returnvalue::OK;
|
||||||
}
|
}
|
||||||
case (ModeMessage::REPLY_WRONG_MODE_REPLY): {
|
case (ModeMessage::REPLY_WRONG_MODE_REPLY): {
|
||||||
result = prepareWrongModeReply(reply, objectId);
|
result = prepareWrongModeReply(reply, objectId);
|
||||||
|
@ -246,20 +246,6 @@ 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,8 +207,7 @@ 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,8 +4,6 @@
|
|||||||
|
|
||||||
#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,7 +18,6 @@
|
|||||||
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,12 +6,47 @@
|
|||||||
#include "fsfw/returnvalues/returnvalue.h"
|
#include "fsfw/returnvalues/returnvalue.h"
|
||||||
#include "tmStorageConf.h"
|
#include "tmStorageConf.h"
|
||||||
|
|
||||||
class PusTmReader;
|
class TmPacketMinimal;
|
||||||
class SpacePacketReader;
|
class SpacePacketBase;
|
||||||
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);
|
||||||
@ -22,38 +57,7 @@ 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_ */
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
#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,10 +1,6 @@
|
|||||||
#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"
|
||||||
@ -28,7 +24,7 @@ class ServiceSubservice : public SerialLinkedListAdapter<SerializeIF> {
|
|||||||
|
|
||||||
class ApidSsc : public SerializeIF {
|
class ApidSsc : public SerializeIF {
|
||||||
public:
|
public:
|
||||||
ApidSsc() : apid(ccsds::LIMIT_APID), ssc(0) {}
|
ApidSsc() : apid(SpacePacketBase::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;
|
||||||
@ -66,59 +62,51 @@ class ChangeSelectionDefinition : public SerialLinkedListAdapter<SerializeIF> {
|
|||||||
|
|
||||||
class TmPacketInformation : public SerializeIF {
|
class TmPacketInformation : public SerializeIF {
|
||||||
public:
|
public:
|
||||||
TmPacketInformation(PusTmReader* packet, size_t timestampLen) : rawTimestamp(timestampLen) {
|
TmPacketInformation(TmPacketMinimal* packet) { setContent(packet); }
|
||||||
setContent(packet);
|
TmPacketInformation()
|
||||||
}
|
: 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 = ccsds::LIMIT_APID;
|
apid = SpacePacketBase::LIMIT_APID;
|
||||||
sourceSequenceCount = 0;
|
sourceSequenceCount = 0;
|
||||||
serviceType = 0;
|
serviceType = 0;
|
||||||
serviceSubtype = 0;
|
serviceSubtype = 0;
|
||||||
subCounter = 0;
|
subCounter = 0;
|
||||||
memset(rawTimestamp.data(), 0, rawTimestamp.size());
|
memset(rawTimestamp, 0, sizeof(rawTimestamp));
|
||||||
}
|
}
|
||||||
void setContent(PusTmReader* packet) {
|
void setContent(TmPacketMinimal* packet) {
|
||||||
apid = packet->getApid();
|
apid = packet->getAPID();
|
||||||
sourceSequenceCount = packet->getSequenceCount();
|
sourceSequenceCount = packet->getPacketSequenceCount();
|
||||||
serviceType = packet->getService();
|
serviceType = packet->getService();
|
||||||
serviceSubtype = packet->getSubService();
|
serviceSubtype = packet->getSubService();
|
||||||
subCounter = packet->getMessageTypeCounter();
|
subCounter = packet->getPacketSubcounter();
|
||||||
memset(rawTimestamp.data(), 0, rawTimestamp.size());
|
memset(rawTimestamp, 0, sizeof(rawTimestamp));
|
||||||
// TODO: Fix all of this
|
const uint8_t* pField = NULL;
|
||||||
// const uint8_t* pField = NULL;
|
uint32_t size = 0;
|
||||||
// uint32_t size = 0;
|
ReturnValue_t result = packet->getPacketTimeRaw(&pField, &size);
|
||||||
// auto* timeReader = packet->getTimeReader();
|
if (result != returnvalue::OK) {
|
||||||
// ReturnValue_t result = packet->getPacketTimeRaw(&pField, &size);
|
return;
|
||||||
// if (result != returnvalue::OK) {
|
}
|
||||||
// return;
|
if (*pField == CCSDSTime::P_FIELD_CDS_SHORT && size <= TimeStamperIF::MISSION_TIMESTAMP_SIZE) {
|
||||||
//}
|
|
||||||
// if (*pField == CCSDSTime::P_FIELD_CDS_SHORT && size <= TimeStamperIF::MISSION_TIMESTAMP_SIZE)
|
|
||||||
// {
|
|
||||||
// Shortcut to avoid converting CDS back and forth.
|
// Shortcut to avoid converting CDS back and forth.
|
||||||
// TODO: Fix
|
memcpy(rawTimestamp, pField, size);
|
||||||
// memcpy(rawTimestamp, pField, size);
|
return;
|
||||||
// return;
|
}
|
||||||
// }
|
timeval time = {0, 0};
|
||||||
// timeval time = {0, 0};
|
result = packet->getPacketTime(&time);
|
||||||
// result = packet->getPacketTime(&time);
|
if (result != returnvalue::OK) {
|
||||||
// if (result != returnvalue::OK) {
|
return;
|
||||||
// return;
|
}
|
||||||
// }
|
|
||||||
//
|
CCSDSTime::CDS_short cdsFormat;
|
||||||
// CCSDSTime::CDS_short cdsFormat;
|
result = CCSDSTime::convertToCcsds(&cdsFormat, &time);
|
||||||
// result = CCSDSTime::convertToCcsds(&cdsFormat, &time);
|
if (result != returnvalue::OK) {
|
||||||
// if (result != returnvalue::OK) {
|
return;
|
||||||
// return;
|
}
|
||||||
// }
|
memcpy(rawTimestamp, &cdsFormat, sizeof(cdsFormat));
|
||||||
// TODO: Fix
|
|
||||||
// memcpy(rawTimestamp, &cdsFormat, sizeof(cdsFormat));
|
|
||||||
}
|
}
|
||||||
void setContent(TmPacketInformation* content) {
|
void setContent(TmPacketInformation* content) {
|
||||||
apid = content->apid;
|
apid = content->apid;
|
||||||
@ -126,10 +114,9 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
serviceType = content->serviceType;
|
serviceType = content->serviceType;
|
||||||
serviceSubtype = content->serviceSubtype;
|
serviceSubtype = content->serviceSubtype;
|
||||||
subCounter = content->subCounter;
|
subCounter = content->subCounter;
|
||||||
// TODO: Fix
|
memcpy(rawTimestamp, content->rawTimestamp, sizeof(rawTimestamp));
|
||||||
// memcpy(rawTimestamp, content->rawTimestamp, sizeof(rawTimestamp));
|
|
||||||
}
|
}
|
||||||
bool isValid() const { return (apid < ccsds::LIMIT_APID) ? true : false; }
|
bool isValid() const { return (apid < SpacePacketBase::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) {
|
||||||
@ -229,7 +216,7 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
SerialBufferAdapter<uint8_t> adapter(rawTimestamp.data(), rawTimestamp.size());
|
SerialBufferAdapter<uint8_t> adapter(rawTimestamp, sizeof(rawTimestamp));
|
||||||
return adapter.serialize(buffer, size, maxSize, streamEndianness);
|
return adapter.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +227,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.data(), rawTimestamp.size());
|
SerialBufferAdapter<uint8_t> adapter(rawTimestamp, sizeof(rawTimestamp));
|
||||||
size += adapter.getSerializedSize();
|
size += adapter.getSerializedSize();
|
||||||
return size;
|
return size;
|
||||||
};
|
};
|
||||||
@ -266,7 +253,7 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
SerialBufferAdapter<uint8_t> adapter(rawTimestamp.data(), rawTimestamp.size());
|
SerialBufferAdapter<uint8_t> adapter(rawTimestamp, sizeof(rawTimestamp));
|
||||||
return adapter.deSerialize(buffer, size, streamEndianness);
|
return adapter.deSerialize(buffer, size, streamEndianness);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -276,6 +263,6 @@ class TmPacketInformation : public SerializeIF {
|
|||||||
uint8_t serviceType;
|
uint8_t serviceType;
|
||||||
uint8_t serviceSubtype;
|
uint8_t serviceSubtype;
|
||||||
uint8_t subCounter;
|
uint8_t subCounter;
|
||||||
std::vector<uint8_t> rawTimestamp;
|
uint8_t rawTimestamp[TimeStamperIF::MISSION_TIMESTAMP_SIZE];
|
||||||
};
|
};
|
||||||
#endif /* FSFW_TMSTORAGE_TMSTOREPACKETS_H_ */
|
#endif /* FSFW_TMSTORAGE_TMSTOREPACKETS_H_ */
|
||||||
|
@ -145,13 +145,17 @@ 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) {
|
||||||
storeDownlinkData(&message);
|
ReturnValue_t result = 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,9 +163,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,6 +2,7 @@
|
|||||||
|
|
||||||
#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