Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Ref/Top/instances.fpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ module Ref {

instance frameAccumulator: Svc.FrameAccumulator base id 0x4800

instance tcDeframer: Svc.CCSDS.TcDeframer base id 0x4900
instance tcDeframer: Svc.Ccsds.TcDeframer base id 0x4900

instance spacePacketDeframer: Svc.CCSDS.SpacePacketDeframer base id 0x4A00
instance spacePacketDeframer: Svc.Ccsds.SpacePacketDeframer base id 0x4A00

instance tmFramer: Svc.CCSDS.TmFramer base id 0x4B00
instance tmFramer: Svc.Ccsds.TmFramer base id 0x4B00

instance spacePacketFramer: Svc.CCSDS.SpacePacketFramer base id 0x4C00
instance spacePacketFramer: Svc.Ccsds.SpacePacketFramer base id 0x4C00

instance fprimeRouter: Svc.FprimeRouter base id 0x4D00

instance apidManager: Svc.CCSDS.ApidManager base id 0x4E00
instance apidManager: Svc.Ccsds.ApidManager base id 0x4E00

instance comStub: Svc.ComStub base id 0x4F00

Expand Down
2 changes: 1 addition & 1 deletion Svc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/PosixTime/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/LinuxTimer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Version/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/FpySequencer/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/CCSDS/")
add_fprime_subdirectory("${CMAKE_CURRENT_LIST_DIR}/Ccsds/")
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
// \brief cpp file for ApidManager component implementation class
// ======================================================================

#include "Svc/CCSDS/ApidManager/ApidManager.hpp"
#include "Svc/CCSDS/Types/FppConstantsAc.hpp"
#include "Svc/Ccsds/ApidManager/ApidManager.hpp"
#include "Svc/Ccsds/Types/FppConstantsAc.hpp"

namespace Svc {

namespace CCSDS {
namespace Ccsds {

// ----------------------------------------------------------------------
// Component construction and destruction
Expand Down Expand Up @@ -78,5 +78,5 @@ void ApidManager::setNextSeqCount(ComCfg::APID::T apid, U16 seqCount) {
FW_ASSERT(false, static_cast<FwAssertArgType>(apid));
}

} // namespace CCSDS
} // namespace Ccsds
} // namespace Svc
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module Svc {
module CCSDS {
module Ccsds {
@ Maps output of ComQueue to CCSDS APIDs
passive component ApidManager {

@ Port to validate a given sequence count for a given APID
guarded input port validateApidSeqCountIn: CCSDS.ApidSequenceCount
guarded input port validateApidSeqCountIn: Ccsds.ApidSequenceCount

@ Port to request a sequence count for a given APID
guarded input port getApidSeqCountIn: CCSDS.ApidSequenceCount
guarded input port getApidSeqCountIn: Ccsds.ApidSequenceCount

@ Deframing received an unexpected sequence count
event UnexpectedSequenceCount(transmitted: U16, expected: U16) \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
// \brief hpp file for ApidManager component implementation class
// ======================================================================

#ifndef Svc_CCSDS_ApidManager_HPP
#define Svc_CCSDS_ApidManager_HPP
#ifndef Svc_Ccsds_ApidManager_HPP
#define Svc_Ccsds_ApidManager_HPP

#include "Svc/CCSDS/ApidManager/ApidManagerComponentAc.hpp"
#include "Svc/Ccsds/ApidManager/ApidManagerComponentAc.hpp"
#include "Fw/Com/ComPacket.hpp"

namespace Svc {

namespace CCSDS {
namespace Ccsds {

static_assert(ComCfg::APID::SPP_IDLE_PACKET == 0x07FF,
"SPP_IDLE_PACKET must exist and equal 0x07FF (as specified by standard)");
Expand Down Expand Up @@ -88,7 +88,7 @@ class ApidManager final : public ApidManagerComponentBase {
ApidSequenceEntry m_apidSequences[MAX_TRACKED_APIDS];
};

} // namespace CCSDS
} // namespace Ccsds
} // namespace Svc

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ register_fprime_ut(
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/ApidManager.fpp"
DEPENDS
Svc_CCSDS_Types
Svc_Ccsds_Types
STest
UT_AUTO_HELPERS
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Svc::CCSDS::ApidManager
# Svc::Ccsds::ApidManager

The `Svc::CCSDS::ApidManager` component manages CCSDS Application Process Identifier (APID) sequence counts for the F Prime communications stack. It provides per-APID sequence count tracking and validation, supporting the construction and checking of CCSDS Space Packet headers by other components (such as `SpacePacketFramer` and `SpacePacketDeframer`).
The `Svc::Ccsds::ApidManager` component manages CCSDS Application Process Identifier (APID) sequence counts for the F Prime communications stack. It provides per-APID sequence count tracking and validation, supporting the construction and checking of CCSDS Space Packet headers by other components (such as `SpacePacketFramer` and `SpacePacketDeframer`).

The `ApidManager` is typically used in conjunction with the [`SpacePacketFramer`](../../SpacePacketFramer/docs/sdd.md) (to provide incrementing sequence counts for each APID) and the [`SpacePacketDeframer`](../../SpacePacketDeframer/docs/sdd.md) (to validate received sequence counts and detect dropped or out-of-order packets).

Expand All @@ -15,8 +15,8 @@ The `ApidManager` is typically used in conjunction with the [`SpacePacketFramer`

| Kind | Name | Port Type | Description |
|-----------------|-----------------------|--------------------------|-----------------------------------------------------------------------------|
| guarded input | validateApidSeqCountIn| CCSDS.ApidSequenceCount | Validates a received sequence count for a given APID. |
| guarded input | getApidSeqCountIn | CCSDS.ApidSequenceCount | Returns and increments the sequence count for a given APID. |
| guarded input | validateApidSeqCountIn| Ccsds.ApidSequenceCount | Validates a received sequence count for a given APID. |
| guarded input | getApidSeqCountIn | Ccsds.ApidSequenceCount | Returns and increments the sequence count for a given APID. |

## Events

Expand All @@ -34,16 +34,16 @@ The `ApidManager` is typically used in conjunction with the [`SpacePacketFramer`

| Name | Description | Validation |
|-----------------------------------|-----------------------------------------------------------------------------|----------------------|
| SVC-CCSDS-APID-MANAGER-001 | The ApidManager shall track a 14-bit sequence count for each APID. | Unit Test |
| SVC-CCSDS-APID-MANAGER-002 | The ApidManager shall provide the current sequence count for a given APID. | Unit Test |
| SVC-CCSDS-APID-MANAGER-003 | The ApidManager shall increment the sequence count for each APID on request.| Unit Test |
| SVC-CCSDS-APID-MANAGER-004 | The ApidManager shall provide validation of a received sequence counts for each APID. | Unit Test |
| SVC-CCSDS-APID-MANAGER-005 | The ApidManager shall emit an event if an unexpected sequence count is received.| Unit Test |
| SVC-CCSDS-APID-MANAGER-006 | The ApidManager shall emit an event if the APID table is full and an APID is not able to be added to the tracking. | Unit Test |
| SVC-CCSDS-APID-MANAGER-007 | The ApidManager shall synchronize the onboard sequence count if a mismatch is detected.| Unit Test |
| SVC-Ccsds-APID-MANAGER-001 | The ApidManager shall track a 14-bit sequence count for each APID. | Unit Test |
| SVC-Ccsds-APID-MANAGER-002 | The ApidManager shall provide the current sequence count for a given APID. | Unit Test |
| SVC-Ccsds-APID-MANAGER-003 | The ApidManager shall increment the sequence count for each APID on request.| Unit Test |
| SVC-Ccsds-APID-MANAGER-004 | The ApidManager shall provide validation of a received sequence counts for each APID. | Unit Test |
| SVC-Ccsds-APID-MANAGER-005 | The ApidManager shall emit an event if an unexpected sequence count is received.| Unit Test |
| SVC-Ccsds-APID-MANAGER-006 | The ApidManager shall emit an event if the APID table is full and an APID is not able to be added to the tracking. | Unit Test |
| SVC-Ccsds-APID-MANAGER-007 | The ApidManager shall synchronize the onboard sequence count if a mismatch is detected.| Unit Test |

## See Also

- [`Svc::CCSDS::SpacePacketFramer`](../../SpacePacketFramer/docs/sdd.md)
- [`Svc::CCSDS::SpacePacketDeframer`](../../SpacePacketDeframer/docs/sdd.md)
- [`Svc::Ccsds::SpacePacketFramer`](../../SpacePacketFramer/docs/sdd.md)
- [`Svc::Ccsds::SpacePacketDeframer`](../../SpacePacketDeframer/docs/sdd.md)
- [CCSDS Space Packet Protocol (CCSDS 133.0-B-2)](https://public.ccsds.org/Pubs/133x0b2e1.pdf)
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,34 @@
#include "STest/Scenario/RandomScenario.hpp"

TEST(ApidManager, GetSequenceCounts) {
Svc::CCSDS::ApidManagerTester tester;
Svc::CCSDS::ApidManagerTester::GetExistingSeqCount getExistingSeqCount;
Svc::CCSDS::ApidManagerTester::GetNewSeqCountOk getNewSeqCountOk;
Svc::Ccsds::ApidManagerTester tester;
Svc::Ccsds::ApidManagerTester::GetExistingSeqCount getExistingSeqCount;
Svc::Ccsds::ApidManagerTester::GetNewSeqCountOk getNewSeqCountOk;
getExistingSeqCount.apply(tester);
getNewSeqCountOk.apply(tester);
}

TEST(ApidManager, ValidateSequenceCounts) {
Svc::CCSDS::ApidManagerTester tester;
Svc::CCSDS::ApidManagerTester::ValidateSeqCountOk validateSeqCountOkRule;
Svc::CCSDS::ApidManagerTester::ValidateSeqCountFailure validateSeqCountFailureRule;
Svc::Ccsds::ApidManagerTester tester;
Svc::Ccsds::ApidManagerTester::ValidateSeqCountOk validateSeqCountOkRule;
Svc::Ccsds::ApidManagerTester::ValidateSeqCountFailure validateSeqCountFailureRule;
validateSeqCountOkRule.apply(tester);
validateSeqCountFailureRule.apply(tester);
}

// Randomized testing
TEST(ApidManager, RandomizedTesting) {

Svc::CCSDS::ApidManagerTester tester;
Svc::Ccsds::ApidManagerTester tester;

Svc::CCSDS::ApidManagerTester::GetExistingSeqCount getExistingSeqCountRule;
Svc::CCSDS::ApidManagerTester::GetNewSeqCountOk getNewSeqCountOkRule;
Svc::CCSDS::ApidManagerTester::GetNewSeqCountTableFull getNewSeqCountTableFullRule;
Svc::CCSDS::ApidManagerTester::ValidateSeqCountOk validateSeqCountOkRule;
Svc::CCSDS::ApidManagerTester::ValidateSeqCountFailure validateSeqCountFailureRule;
Svc::Ccsds::ApidManagerTester::GetExistingSeqCount getExistingSeqCountRule;
Svc::Ccsds::ApidManagerTester::GetNewSeqCountOk getNewSeqCountOkRule;
Svc::Ccsds::ApidManagerTester::GetNewSeqCountTableFull getNewSeqCountTableFullRule;
Svc::Ccsds::ApidManagerTester::ValidateSeqCountOk validateSeqCountOkRule;
Svc::Ccsds::ApidManagerTester::ValidateSeqCountFailure validateSeqCountFailureRule;

// Place these rules into a list of rules
STest::Rule<Svc::CCSDS::ApidManagerTester>* rules[] = {
STest::Rule<Svc::Ccsds::ApidManagerTester>* rules[] = {
&getExistingSeqCountRule,
&getNewSeqCountOkRule,
&getNewSeqCountTableFullRule,
Expand All @@ -45,14 +45,14 @@ TEST(ApidManager, RandomizedTesting) {
};

// Take the rules and place them into a random scenario
STest::RandomScenario<Svc::CCSDS::ApidManagerTester> random(
STest::RandomScenario<Svc::Ccsds::ApidManagerTester> random(
"Random Rules",
rules,
FW_NUM_ARRAY_ELEMENTS(rules)
);

// Create a bounded scenario wrapping the random scenario
STest::BoundedScenario<Svc::CCSDS::ApidManagerTester> bounded(
STest::BoundedScenario<Svc::Ccsds::ApidManagerTester> bounded(
"Bounded Random Rules Scenario",
random,
1000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

#include "ApidManagerTester.hpp"
#include "STest/Random/Random.hpp"
#include "Svc/CCSDS/Types/FppConstantsAc.hpp"
#include "Svc/Ccsds/Types/FppConstantsAc.hpp"

namespace Svc {

namespace CCSDS {
namespace Ccsds {

static constexpr ComCfg::APID::T TEST_REGISTERED_APIDS[] = {
ComCfg::APID::FW_PACKET_COMMAND,
Expand Down Expand Up @@ -175,5 +175,5 @@ ComCfg::APID::T ApidManagerTester::shadow_getRandomUntrackedApid() {
return apid;
}

} // namespace CCSDS
} // namespace Ccsds
} // namespace Svc
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
// \brief hpp file for ApidManager component test harness implementation class
// ======================================================================

#ifndef Svc_CCSDS_ApidManagerTester_HPP
#define Svc_CCSDS_ApidManagerTester_HPP
#ifndef Svc_Ccsds_ApidManagerTester_HPP
#define Svc_Ccsds_ApidManagerTester_HPP

#include "STest/Random/Random.hpp"
#include "STest/Rule/Rule.hpp"
#include "Svc/CCSDS/ApidManager/ApidManager.hpp"
#include "Svc/CCSDS/ApidManager/ApidManagerGTestBase.hpp"
#include "Svc/Ccsds/ApidManager/ApidManager.hpp"
#include "Svc/Ccsds/ApidManager/ApidManagerGTestBase.hpp"

namespace Svc {

namespace CCSDS {
namespace Ccsds {

class ApidManagerTester : public ApidManagerGTestBase {
public:
Expand Down Expand Up @@ -110,7 +110,7 @@ class ApidManagerTester : public ApidManagerGTestBase {
};
};

} // namespace CCSDS
} // namespace Ccsds

} // namespace Svc

Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Svc/CCSDS/Ports/Ports.fpp → Svc/Ccsds/Ports/Ports.fpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Svc {
module CCSDS {
module Ccsds {

@ Port for requesting a sequence count for a given APID
port ApidSequenceCount (apid: ComCfg.APID, sequenceCount: U16) -> U16
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ register_fprime_library(
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/SpacePacketDeframer.fpp"
DEPENDS
Svc_CCSDS_Types
Svc_Ccsds_Types
)


Expand All @@ -28,7 +28,7 @@ register_fprime_ut(
AUTOCODER_INPUTS
"${CMAKE_CURRENT_LIST_DIR}/SpacePacketDeframer.fpp"
DEPENDS
Svc_CCSDS_Types
Svc_Ccsds_Types
STest
UT_AUTO_HELPERS
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
// \brief cpp file for SpacePacketDeframer component implementation class
// ======================================================================

#include "Svc/CCSDS/SpacePacketDeframer/SpacePacketDeframer.hpp"
#include "Svc/CCSDS/Types/FppConstantsAc.hpp"
#include "Svc/CCSDS/Types/SpacePacketHeaderSerializableAc.hpp"
#include "Svc/Ccsds/SpacePacketDeframer/SpacePacketDeframer.hpp"
#include "Svc/Ccsds/Types/FppConstantsAc.hpp"
#include "Svc/Ccsds/Types/SpacePacketHeaderSerializableAc.hpp"

namespace Svc {

namespace CCSDS {
namespace Ccsds {

// ----------------------------------------------------------------------
// Component construction and destruction
Expand Down Expand Up @@ -79,5 +79,5 @@ void SpacePacketDeframer ::dataReturnIn_handler(FwIndexType portNum,
this->dataReturnOut_out(0, data, context);
}

} // namespace CCSDS
} // namespace Ccsds
} // namespace Svc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module Svc {
module CCSDS {
module Ccsds {
@ Deframer for the CCSDS Space Packet protocol
passive component SpacePacketDeframer {

include "../../Interfaces/DeframerInterface.fppi"

@ Port to validate a received sequence count for a given APID
output port validateApidSeqCount: CCSDS.ApidSequenceCount
output port validateApidSeqCount: Ccsds.ApidSequenceCount

@ Deframing received an invalid frame length
event InvalidLength(transmitted: U16, actual: U32) \
Expand Down Expand Up @@ -36,5 +36,5 @@ module CCSDS {

}

} # end CCSDS
} # end Ccsds
} # end Svc
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
// \brief hpp file for SpacePacketDeframer component implementation class
// ======================================================================

#ifndef Svc_CCSDS_SpacePacketDeframer_HPP
#define Svc_CCSDS_SpacePacketDeframer_HPP
#ifndef Svc_Ccsds_SpacePacketDeframer_HPP
#define Svc_Ccsds_SpacePacketDeframer_HPP

#include "Svc/CCSDS/SpacePacketDeframer/SpacePacketDeframerComponentAc.hpp"
#include "Svc/Ccsds/SpacePacketDeframer/SpacePacketDeframerComponentAc.hpp"

namespace Svc {

namespace CCSDS {
namespace Ccsds {

class SpacePacketDeframer final : public SpacePacketDeframerComponentBase {
friend class SpacePacketDeframerTester;
Expand Down Expand Up @@ -49,7 +49,7 @@ class SpacePacketDeframer final : public SpacePacketDeframerComponentBase {

};

} // namespace CCSDS
} // namespace Ccsds

} // namespace Svc

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Svc::CCSDS::SpacePacketDeframer
# Svc::Ccsds::SpacePacketDeframer

The `Svc::CCSDS::SpacePacketDeframer` is an implementation of the [DeframerInterface](../../../Interfaces/docs/sdd.md) for the CCSDS [Space Packet Protocol](https://ccsds.org/Pubs/133x0b2e2.pdf).
The `Svc::Ccsds::SpacePacketDeframer` is an implementation of the [DeframerInterface](../../../Interfaces/docs/sdd.md) for the CCSDS [Space Packet Protocol](https://ccsds.org/Pubs/133x0b2e2.pdf).

It receives data containing a Space Packet on its input port and extracts the Space Packet. Please refer to the CCSDS [Space Packet Protocol specification (CCSDS 133.0-B-2)](https://ccsds.org/Pubs/133x0b2e2.pdf) for details on the packet format.

The `Svc::CCSDS::SpacePacketDeframer` is typically used downstream of a component that removes transfer frame headers, such as the `Svc::CCSDS::TcDeframer`. It validates the Space Packet header and extracts the payload.
The `Svc::Ccsds::SpacePacketDeframer` is typically used downstream of a component that removes transfer frame headers, such as the `Svc::Ccsds::TcDeframer`. It validates the Space Packet header and extracts the payload.

## Port Descriptions

Expand All @@ -14,7 +14,7 @@ The `Svc::CCSDS::SpacePacketDeframer` is typically used downstream of a componen
| Output | dataOut | Svc.ComDataWithContext | Port to output the extracted Space Packet payload |
| Output | dataReturnOut | Svc.ComDataWithContext | Port for returning ownership of received buffers |
| Input (sync) | dataReturnIn | Svc.ComDataWithContext | Port receiving back ownership of sent buffers |
| Output | validateApidSeqCount | CCSDS.ApidSequenceCount | Port to request validation of a sequence count for a given APID |
| Output | validateApidSeqCount | Ccsds.ApidSequenceCount | Port to request validation of a sequence count for a given APID |

## Events

Expand Down
Loading
Loading