Compare commits
28 Commits
mohr/GCC13
...
docker_d10
Author | SHA1 | Date | |
---|---|---|---|
ac817f296b | |||
622ad9ff18
|
|||
f0e4eacac5
|
|||
acc737feb2 | |||
c9281a3760
|
|||
cc97c7f82d
|
|||
a3b102c0d0
|
|||
5dd4f15b39 | |||
b5a3c0226e | |||
e925b8595c
|
|||
c5bf5389b8 | |||
7285dd6bac
|
|||
b53bf2ea12 | |||
610c196f6d | |||
ece47b4f2f | |||
3f777c54fe | |||
3d54895251
|
|||
d91e1ecc0a | |||
e5910c77e9
|
|||
1569416a8f
|
|||
278c8f1186
|
|||
60f6ef5f1f
|
|||
4ecd9eb62e | |||
fb89d7a3b6 | |||
146c3471d0 | |||
1816c3f623 | |||
13b97abf0d | |||
9fe8579377 |
17
CHANGELOG.md
17
CHANGELOG.md
@ -10,6 +10,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
## Fixes
|
## Fixes
|
||||||
|
|
||||||
|
- The `PusTmCreator` API only accepted 255 bytes of source data. It can now accept source
|
||||||
|
data with a size limited only by the size of `size_t`.
|
||||||
|
- Important bugfix in CFDP PDU header format: The entity length field and the transaction sequence
|
||||||
|
number fields stored the actual length of the field instead of the length minus 1 like specified
|
||||||
|
in the CFDP standard.
|
||||||
- PUS Health Service: Size check for set health command.
|
- PUS Health Service: Size check for set health command.
|
||||||
Perform operation completion for announce health command.
|
Perform operation completion for announce health command.
|
||||||
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/746
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/746
|
||||||
@ -17,13 +22,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/745
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/745
|
||||||
- Small tweak for version getter
|
- Small tweak for version getter
|
||||||
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/744
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/744
|
||||||
|
- Important bugfix for `LocalPool::delete` function, where an overflow could possibly lead to UB.
|
||||||
|
|
||||||
## Added
|
## Added
|
||||||
|
|
||||||
- add CFDP subsystem ID
|
- add CFDP subsystem ID
|
||||||
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/742
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/742
|
||||||
|
- New object ID for persistent TM store PUS 15
|
||||||
|
- `EventManager`: Add function to print all listeners.
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
- Bump ETL version to 20.35.14
|
- Bump ETL version to 20.35.14
|
||||||
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/748
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/748
|
||||||
- Renamed `PCDU_2` subsystem ID to `POWER_SWITCH_IF`.
|
- Renamed `PCDU_2` subsystem ID to `POWER_SWITCH_IF`.
|
||||||
@ -32,14 +41,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/743
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/743
|
||||||
- Assert that `FixedArrayList` is larger than 0 at compile time.
|
- Assert that `FixedArrayList` is larger than 0 at compile time.
|
||||||
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/740
|
https://egit.irs.uni-stuttgart.de/fsfw/fsfw/pulls/740
|
||||||
|
|
||||||
## Added
|
|
||||||
|
|
||||||
- `EventManager`: Add function to print all listeners.
|
|
||||||
|
|
||||||
## Changed
|
|
||||||
|
|
||||||
- `EventManager`: Queue depth is configurable now
|
- `EventManager`: Queue depth is configurable now
|
||||||
|
- `ActionHelper`: Allow execution of actions without additional data
|
||||||
|
|
||||||
# [v6.0.0] 2023-02-10
|
# [v6.0.0] 2023-02-10
|
||||||
|
|
||||||
|
@ -7,7 +7,10 @@ RUN apt-get --yes upgrade
|
|||||||
ARG DEBIAN_FRONTEND=noninteractive
|
ARG DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping python3 pip doxygen graphviz rsync
|
RUN apt-get --yes install gcc g++ cmake make lcov git valgrind nano iputils-ping python3 pip doxygen graphviz rsync
|
||||||
|
|
||||||
RUN python3 -m pip install sphinx breathe
|
# This should also install Sphinx
|
||||||
|
COPY docs/requirements.txt .
|
||||||
|
RUN python3 -m pip install -r docs/requirements.txt
|
||||||
|
RUN python3 -m pip install breathe
|
||||||
|
|
||||||
RUN git clone https://github.com/catchorg/Catch2.git && \
|
RUN git clone https://github.com/catchorg/Catch2.git && \
|
||||||
cd Catch2 && \
|
cd Catch2 && \
|
||||||
|
22
automation/Jenkinsfile
vendored
22
automation/Jenkinsfile
vendored
@ -87,38 +87,44 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Documentation') {
|
stage('Documentation') {
|
||||||
when {
|
when {
|
||||||
branch 'development'
|
anyOf {
|
||||||
|
branch 'development';
|
||||||
|
branch pattern: 'development-doc-deployment*'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
dir(DOCDDIR) {
|
dir(DOCDDIR) {
|
||||||
sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..'
|
sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..'
|
||||||
sh 'make Sphinx'
|
sh 'make Sphinx'
|
||||||
sshagent(credentials: ['documentation-buildfix']) {
|
sshagent(credentials: ['documentation-buildfix']) {
|
||||||
sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/development'
|
sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/projects/fsfw/development'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dir(BUILDDIR) {
|
dir(BUILDDIR_LINUX) {
|
||||||
sshagent(credentials: ['documentation-buildfix']) {
|
sshagent(credentials: ['documentation-buildfix']) {
|
||||||
sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/coverage/development'
|
sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/projects/fsfw/coverage/development'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Master Documentation') {
|
stage('Master Documentation') {
|
||||||
when {
|
when {
|
||||||
branch 'master'
|
anyOf {
|
||||||
|
branch 'master';
|
||||||
|
branch pattern: 'master-doc-deployment*'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
dir(DOCDDIR) {
|
dir(DOCDDIR) {
|
||||||
sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..'
|
sh 'cmake -DFSFW_BUILD_DOCS=ON -DFSFW_OSAL=host ..'
|
||||||
sh 'make Sphinx'
|
sh 'make Sphinx'
|
||||||
sshagent(credentials: ['documentation-buildfix']) {
|
sshagent(credentials: ['documentation-buildfix']) {
|
||||||
sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/master'
|
sh 'rsync -r --delete docs/sphinx/* buildfix@documentation.irs.uni-stuttgart.de:/projects/fsfw/master'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dir(BUILDDIR) {
|
dir(BUILDDIR_LINUX) {
|
||||||
sshagent(credentials: ['documentation-buildfix']) {
|
sshagent(credentials: ['documentation-buildfix']) {
|
||||||
sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/fsfw/coverage/master'
|
sh 'rsync -r --delete fsfw-tests_coverage/* buildfix@documentation.irs.uni-stuttgart.de:/projects/fsfw/coverage/master'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,7 @@ project = "Flight Software Framework"
|
|||||||
copyright = "2021, Institute of Space Systems (IRS)"
|
copyright = "2021, Institute of Space Systems (IRS)"
|
||||||
author = "Institute of Space Systems (IRS)"
|
author = "Institute of Space Systems (IRS)"
|
||||||
|
|
||||||
|
# TODO: Should try to read this from CMakeLists.txt automatically..
|
||||||
# The full version, including alpha/beta/rc tags
|
# The full version, including alpha/beta/rc tags
|
||||||
release = "5.0.0"
|
release = "5.0.0"
|
||||||
|
|
||||||
@ -48,7 +49,7 @@ exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
|||||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
# a list of builtin themes.
|
# a list of builtin themes.
|
||||||
#
|
#
|
||||||
html_theme = "alabaster"
|
html_theme = "sphinx_rtd_theme"
|
||||||
|
|
||||||
html_theme_options = {
|
html_theme_options = {
|
||||||
"extra_nav_links": {"Impressum" : "https://www.uni-stuttgart.de/impressum", "Datenschutz": "https://info.irs.uni-stuttgart.de/datenschutz/datenschutzWebmit.html"}
|
"extra_nav_links": {"Impressum" : "https://www.uni-stuttgart.de/impressum", "Datenschutz": "https://info.irs.uni-stuttgart.de/datenschutz/datenschutzWebmit.html"}
|
||||||
|
1
docs/requirements.txt
Normal file
1
docs/requirements.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
sphinx-rtd-theme==1.3.0
|
@ -59,8 +59,12 @@ void ActionHelper::setQueueToUse(MessageQueueIF* queue) { queueToUse = queue; }
|
|||||||
|
|
||||||
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
|
void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t actionId,
|
||||||
store_address_t dataAddress) {
|
store_address_t dataAddress) {
|
||||||
|
bool hasAdditionalData = false;
|
||||||
const uint8_t* dataPtr = nullptr;
|
const uint8_t* dataPtr = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
|
ReturnValue_t result;
|
||||||
|
if (dataAddress != store_address_t::invalid()) {
|
||||||
|
hasAdditionalData = true;
|
||||||
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
ReturnValue_t result = ipcStore->getData(dataAddress, &dataPtr, &size);
|
||||||
if (result != returnvalue::OK) {
|
if (result != returnvalue::OK) {
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
@ -68,8 +72,11 @@ void ActionHelper::prepareExecution(MessageQueueId_t commandedBy, ActionId_t act
|
|||||||
queueToUse->sendMessage(commandedBy, &reply);
|
queueToUse->sendMessage(commandedBy, &reply);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
result = owner->executeAction(actionId, commandedBy, dataPtr, size);
|
||||||
|
if (hasAdditionalData) {
|
||||||
ipcStore->deleteData(dataAddress);
|
ipcStore->deleteData(dataAddress);
|
||||||
|
}
|
||||||
if (result == HasActionsIF::EXECUTION_FINISHED) {
|
if (result == HasActionsIF::EXECUTION_FINISHED) {
|
||||||
CommandMessage reply;
|
CommandMessage reply;
|
||||||
ActionMessage::setCompletionReply(&reply, actionId, true, result);
|
ActionMessage::setCompletionReply(&reply, actionId, true, result);
|
||||||
|
@ -16,8 +16,8 @@ class CommandActionHelper {
|
|||||||
public:
|
public:
|
||||||
explicit CommandActionHelper(CommandsActionsIF* owner);
|
explicit CommandActionHelper(CommandsActionsIF* owner);
|
||||||
virtual ~CommandActionHelper();
|
virtual ~CommandActionHelper();
|
||||||
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, const uint8_t* data,
|
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId,
|
||||||
uint32_t size);
|
const uint8_t* data = nullptr, uint32_t size = 0);
|
||||||
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, SerializeIF* data);
|
ReturnValue_t commandAction(object_id_t commandTo, ActionId_t actionId, SerializeIF* data);
|
||||||
ReturnValue_t initialize();
|
ReturnValue_t initialize();
|
||||||
ReturnValue_t handleReply(CommandMessage* reply);
|
ReturnValue_t handleReply(CommandMessage* reply);
|
||||||
|
@ -24,8 +24,8 @@ ReturnValue_t HeaderCreator::serialize(uint8_t **buffer, size_t *size, size_t ma
|
|||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
**buffer = pduDataFieldLen & 0x00ff;
|
**buffer = pduDataFieldLen & 0x00ff;
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
**buffer = segmentationCtrl << 7 | pduConf.sourceId.getWidth() << 4 | segmentMetadataFlag << 3 |
|
**buffer = segmentationCtrl << 7 | ((pduConf.sourceId.getWidth() - 1) << 4) |
|
||||||
pduConf.seqNum.getWidth();
|
segmentMetadataFlag << 3 | (pduConf.seqNum.getWidth() - 1);
|
||||||
*buffer += 1;
|
*buffer += 1;
|
||||||
*size += 4;
|
*size += 4;
|
||||||
ReturnValue_t result = pduConf.sourceId.serialize(buffer, size, maxSize, streamEndianness);
|
ReturnValue_t result = pduConf.sourceId.serialize(buffer, size, maxSize, streamEndianness);
|
||||||
|
@ -78,11 +78,11 @@ cfdp::SegmentationControl PduHeaderReader::getSegmentationControl() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cfdp::WidthInBytes PduHeaderReader::getLenEntityIds() const {
|
cfdp::WidthInBytes PduHeaderReader::getLenEntityIds() const {
|
||||||
return static_cast<cfdp::WidthInBytes>((pointers.fixedHeader->fourthByte >> 4) & 0x07);
|
return static_cast<cfdp::WidthInBytes>(((pointers.fixedHeader->fourthByte >> 4) & 0b111) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
cfdp::WidthInBytes PduHeaderReader::getLenSeqNum() const {
|
cfdp::WidthInBytes PduHeaderReader::getLenSeqNum() const {
|
||||||
return static_cast<cfdp::WidthInBytes>(pointers.fixedHeader->fourthByte & 0x07);
|
return static_cast<cfdp::WidthInBytes>((pointers.fixedHeader->fourthByte & 0b111) + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
cfdp::SegmentMetadataFlag PduHeaderReader::getSegmentMetadataFlag() const {
|
cfdp::SegmentMetadataFlag PduHeaderReader::getSegmentMetadataFlag() const {
|
||||||
|
@ -15,6 +15,7 @@ enum framework_objects : object_id_t {
|
|||||||
PUS_SERVICE_8_FUNCTION_MGMT = 0x53000008,
|
PUS_SERVICE_8_FUNCTION_MGMT = 0x53000008,
|
||||||
PUS_SERVICE_9_TIME_MGMT = 0x53000009,
|
PUS_SERVICE_9_TIME_MGMT = 0x53000009,
|
||||||
PUS_SERVICE_11_TC_SCHEDULER = 0x53000011,
|
PUS_SERVICE_11_TC_SCHEDULER = 0x53000011,
|
||||||
|
PUS_SERVICE_15_TM_STORAGE = 0x53000015,
|
||||||
PUS_SERVICE_17_TEST = 0x53000017,
|
PUS_SERVICE_17_TEST = 0x53000017,
|
||||||
PUS_SERVICE_20_PARAMETERS = 0x53000020,
|
PUS_SERVICE_20_PARAMETERS = 0x53000020,
|
||||||
PUS_SERVICE_200_MODE_MGMT = 0x53000200,
|
PUS_SERVICE_200_MODE_MGMT = 0x53000200,
|
||||||
|
@ -89,7 +89,7 @@ ReturnValue_t LocalPool::deleteData(store_address_t storeId) {
|
|||||||
ReturnValue_t status = returnvalue::OK;
|
ReturnValue_t status = returnvalue::OK;
|
||||||
size_type pageSize = getSubpoolElementSize(storeId.poolIndex);
|
size_type pageSize = getSubpoolElementSize(storeId.poolIndex);
|
||||||
if ((pageSize != 0) and (storeId.packetIndex < numberOfElements[storeId.poolIndex])) {
|
if ((pageSize != 0) and (storeId.packetIndex < numberOfElements[storeId.poolIndex])) {
|
||||||
uint16_t packetPosition = getRawPosition(storeId);
|
size_type packetPosition = getRawPosition(storeId);
|
||||||
uint8_t* ptr = &store[storeId.poolIndex][packetPosition];
|
uint8_t* ptr = &store[storeId.poolIndex][packetPosition];
|
||||||
std::memset(ptr, 0, pageSize);
|
std::memset(ptr, 0, pageSize);
|
||||||
// Set free list
|
// Set free list
|
||||||
|
@ -40,7 +40,7 @@ struct PusTmParams {
|
|||||||
size_t dataLen)
|
size_t dataLen)
|
||||||
: secHeader(service, subservice, timeStamper), adapter(data, dataLen), sourceData(&adapter) {}
|
: secHeader(service, subservice, timeStamper), adapter(data, dataLen), sourceData(&adapter) {}
|
||||||
PusTmSecHeader secHeader;
|
PusTmSecHeader secHeader;
|
||||||
SerialBufferAdapter<uint8_t> adapter;
|
SerialBufferAdapter<size_t> adapter;
|
||||||
const SerializeIF* sourceData = nullptr;
|
const SerializeIF* sourceData = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -27,12 +27,7 @@ TEST_CASE("Action Helper", "[action]") {
|
|||||||
CHECK(not testDhMock.executeActionCalled);
|
CHECK(not testDhMock.executeActionCalled);
|
||||||
REQUIRE(actionHelper.handleActionMessage(&actionMessage) == returnvalue::OK);
|
REQUIRE(actionHelper.handleActionMessage(&actionMessage) == returnvalue::OK);
|
||||||
CHECK(testDhMock.executeActionCalled);
|
CHECK(testDhMock.executeActionCalled);
|
||||||
// No message is sent if everything is alright.
|
|
||||||
CHECK(not testMqMock.wasMessageSent());
|
CHECK(not testMqMock.wasMessageSent());
|
||||||
store_address_t invalidAddress;
|
|
||||||
ActionMessage::setCommand(&actionMessage, testActionId, invalidAddress);
|
|
||||||
actionHelper.handleActionMessage(&actionMessage);
|
|
||||||
CHECK(testMqMock.wasMessageSent());
|
|
||||||
const uint8_t* ptr = nullptr;
|
const uint8_t* ptr = nullptr;
|
||||||
size_t size = 0;
|
size_t size = 0;
|
||||||
REQUIRE(ipcStore->getData(paramAddress, &ptr, &size) ==
|
REQUIRE(ipcStore->getData(paramAddress, &ptr, &size) ==
|
||||||
@ -44,6 +39,10 @@ TEST_CASE("Action Helper", "[action]") {
|
|||||||
for (uint8_t i = 0; i < 3; i++) {
|
for (uint8_t i = 0; i < 3; i++) {
|
||||||
REQUIRE(ptr[i] == (i + 1));
|
REQUIRE(ptr[i] == (i + 1));
|
||||||
}
|
}
|
||||||
|
// Action message without application data is also valid
|
||||||
|
store_address_t invalidAddress;
|
||||||
|
ActionMessage::setCommand(&actionMessage, testActionId, invalidAddress);
|
||||||
|
actionHelper.handleActionMessage(&actionMessage);
|
||||||
testDhMock.clearBuffer();
|
testDhMock.clearBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,17 +94,5 @@ TEST_CASE("Action Helper", "[action]") {
|
|||||||
REQUIRE(ActionMessage::getActionId(&testMessage) == testActionId);
|
REQUIRE(ActionMessage::getActionId(&testMessage) == testActionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTION("Missing IPC Data") {
|
|
||||||
ActionMessage::setCommand(&actionMessage, testActionId, store_address_t::invalid());
|
|
||||||
CHECK(not testDhMock.executeActionCalled);
|
|
||||||
REQUIRE(actionHelper.handleActionMessage(&actionMessage) == returnvalue::OK);
|
|
||||||
CommandMessage testMessage;
|
|
||||||
REQUIRE(testMqMock.getNextSentMessage(testMessage) == returnvalue::OK);
|
|
||||||
REQUIRE(testMessage.getCommand() == static_cast<uint32_t>(ActionMessage::STEP_FAILED));
|
|
||||||
REQUIRE(ActionMessage::getReturnCode(&testMessage) ==
|
|
||||||
static_cast<uint32_t>(StorageManagerIF::ILLEGAL_STORAGE_ID));
|
|
||||||
REQUIRE(ActionMessage::getStep(&testMessage) == 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
SECTION("Data Reply") {}
|
SECTION("Data Reply") {}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(creator.serialize(&serTarget, &serSize, serBuf.size(),
|
REQUIRE(creator.serialize(&serTarget, &serSize, serBuf.size(),
|
||||||
SerializeIF::Endianness::BIG) == returnvalue::OK);
|
SerializeIF::Endianness::BIG) == returnvalue::OK);
|
||||||
CHECK(serBuf[0] == 0x3f);
|
CHECK(serBuf[0] == 0x3f);
|
||||||
CHECK(serBuf[3] == 0x99);
|
CHECK(serBuf[3] == 0x88);
|
||||||
REQUIRE(creator.getCrcFlag() == true);
|
REQUIRE(creator.getCrcFlag() == true);
|
||||||
REQUIRE(creator.getDirection() == cfdp::Direction::TOWARDS_SENDER);
|
REQUIRE(creator.getDirection() == cfdp::Direction::TOWARDS_SENDER);
|
||||||
REQUIRE(creator.getLargeFileFlag() == true);
|
REQUIRE(creator.getLargeFileFlag() == true);
|
||||||
@ -127,7 +127,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(creator.getTransmissionMode() == cfdp::TransmissionMode::UNACKNOWLEDGED);
|
REQUIRE(creator.getTransmissionMode() == cfdp::TransmissionMode::UNACKNOWLEDGED);
|
||||||
REQUIRE(creator.getSegmentationControl() == true);
|
REQUIRE(creator.getSegmentationControl() == true);
|
||||||
// Last three bits are 2 now (length of seq number) and bit 1 to bit 3 is 4 (len entity IDs)
|
// Last three bits are 2 now (length of seq number) and bit 1 to bit 3 is 4 (len entity IDs)
|
||||||
REQUIRE(serBuf[3] == 0b11001010);
|
REQUIRE(serBuf[3] == 0b10111001);
|
||||||
uint32_t entityId = 0;
|
uint32_t entityId = 0;
|
||||||
size_t deSerSize = 0;
|
size_t deSerSize = 0;
|
||||||
SerializeAdapter::deSerialize(&entityId, serBuf.data() + 4, &deSerSize,
|
SerializeAdapter::deSerialize(&entityId, serBuf.data() + 4, &deSerSize,
|
||||||
@ -175,7 +175,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(serBuf[1] == 0);
|
REQUIRE(serBuf[1] == 0);
|
||||||
REQUIRE(serBuf[2] == 0);
|
REQUIRE(serBuf[2] == 0);
|
||||||
// Entity and Transaction Sequence number are 1 byte large
|
// Entity and Transaction Sequence number are 1 byte large
|
||||||
REQUIRE(serBuf[3] == 0b00010001);
|
REQUIRE(serBuf[3] == 0b00000000);
|
||||||
// Source ID
|
// Source ID
|
||||||
REQUIRE(serBuf[4] == 0);
|
REQUIRE(serBuf[4] == 0);
|
||||||
// Transaction Seq Number
|
// Transaction Seq Number
|
||||||
@ -220,7 +220,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(serBuf[1] == 0);
|
REQUIRE(serBuf[1] == 0);
|
||||||
REQUIRE(serBuf[2] == 0);
|
REQUIRE(serBuf[2] == 0);
|
||||||
// Entity and Transaction Sequence number are 1 byte large
|
// Entity and Transaction Sequence number are 1 byte large
|
||||||
REQUIRE(serBuf[3] == 0b00010001);
|
REQUIRE(serBuf[3] == 0b00000000);
|
||||||
REQUIRE(serSize == 7);
|
REQUIRE(serSize == 7);
|
||||||
// Deser call not strictly necessary
|
// Deser call not strictly necessary
|
||||||
auto reader = PduHeaderReader(serBuf.data(), serBuf.size());
|
auto reader = PduHeaderReader(serBuf.data(), serBuf.size());
|
||||||
@ -270,7 +270,7 @@ TEST_CASE("CFDP Header", "[cfdp]") {
|
|||||||
REQUIRE(reader.parseData() == returnvalue::OK);
|
REQUIRE(reader.parseData() == returnvalue::OK);
|
||||||
// Everything except version bit flipped to one now
|
// Everything except version bit flipped to one now
|
||||||
REQUIRE(serBuf[0] == 0x3f);
|
REQUIRE(serBuf[0] == 0x3f);
|
||||||
REQUIRE(serBuf[3] == 0b11001010);
|
REQUIRE(serBuf[3] == 0b10111001);
|
||||||
REQUIRE(reader.getWholePduSize() == 14);
|
REQUIRE(reader.getWholePduSize() == 14);
|
||||||
|
|
||||||
REQUIRE(reader.getCrcFlag() == true);
|
REQUIRE(reader.getCrcFlag() == true);
|
||||||
|
@ -68,7 +68,7 @@ TEST_CASE("File Data PDU", "[cfdp][pdu]") {
|
|||||||
// Bits 1 to 3 length of enitity IDs is 2
|
// Bits 1 to 3 length of enitity IDs is 2
|
||||||
// Bit 4: Segment metadata flag is set
|
// Bit 4: Segment metadata flag is set
|
||||||
// Bit 5 to seven: length of transaction seq num is 2
|
// Bit 5 to seven: length of transaction seq num is 2
|
||||||
REQUIRE(fileDataBuffer[3] == 0b10101010);
|
REQUIRE(fileDataBuffer[3] == 0b10011001);
|
||||||
REQUIRE((fileDataBuffer[10] >> 6) &
|
REQUIRE((fileDataBuffer[10] >> 6) &
|
||||||
0b11 == cfdp::RecordContinuationState::CONTAINS_START_AND_END);
|
0b11 == cfdp::RecordContinuationState::CONTAINS_START_AND_END);
|
||||||
// Segment metadata length
|
// Segment metadata length
|
||||||
|
@ -30,7 +30,7 @@ TEST_CASE("CFDP File Directive", "[cfdp][pdu]") {
|
|||||||
REQUIRE(serBuf[1] == 0);
|
REQUIRE(serBuf[1] == 0);
|
||||||
REQUIRE(serBuf[2] == 5);
|
REQUIRE(serBuf[2] == 5);
|
||||||
// Entity and Transaction Sequence number are 1 byte large
|
// Entity and Transaction Sequence number are 1 byte large
|
||||||
REQUIRE(serBuf[3] == 0b00010001);
|
REQUIRE(serBuf[3] == 0b00000000);
|
||||||
// Source ID
|
// Source ID
|
||||||
REQUIRE(serBuf[4] == 0);
|
REQUIRE(serBuf[4] == 0);
|
||||||
// Transaction Seq Number
|
// Transaction Seq Number
|
||||||
|
@ -33,8 +33,8 @@ TEST_CASE("CFDP Base", "[cfdp]") {
|
|||||||
// PDU data field length is 5 (4 + Directive code octet)
|
// PDU data field length is 5 (4 + Directive code octet)
|
||||||
REQUIRE(serBuf[1] == 0);
|
REQUIRE(serBuf[1] == 0);
|
||||||
REQUIRE(serBuf[2] == 5);
|
REQUIRE(serBuf[2] == 5);
|
||||||
// Entity and Transaction Sequence number are 1 byte large
|
// Entity and Transaction Sequence number are 1 byte large, value minus one is stored
|
||||||
REQUIRE(serBuf[3] == 0b00010001);
|
REQUIRE(serBuf[3] == 0b00000000);
|
||||||
// Source ID
|
// Source ID
|
||||||
REQUIRE(serBuf[4] == 0);
|
REQUIRE(serBuf[4] == 0);
|
||||||
// Transaction Seq Number
|
// Transaction Seq Number
|
||||||
|
Reference in New Issue
Block a user