Skip to content
Snippets Groups Projects
Commit 98c18630 authored by Valerio Pastore's avatar Valerio Pastore
Browse files

fix length in recognizing

parent 371a5a3a
No related branches found
No related tags found
No related merge requests found
Subproject commit 7aaf28f461b0bee3cc1f809b5d8ee07aa14fb706 Subproject commit 840f0fa1970e363716386175149aecf60e82c996
...@@ -32,7 +32,7 @@ bool AstriHornGeneric::isRecognizedHeader() const { ...@@ -32,7 +32,7 @@ bool AstriHornGeneric::isRecognizedHeader() const {
size_t type = this->operator []("type").value(); size_t type = this->operator []("type").value();
size_t subtype = this->operator []("subtype").value(); size_t subtype = this->operator []("subtype").value();
ssize_t length = this->operator []("length").value(); ssize_t length = this->operator []("length").value();
ssize_t totLength = this->getHeaderSize() + length + this->getTailSize(); ssize_t totLength = this->getHeaderSize() + length-1 + this->getTailSize();
std::tuple<size_t, size_t, size_t> target = std::make_tuple(type, subtype,totLength); std::tuple<size_t, size_t, size_t> target = std::make_tuple(type, subtype,totLength);
auto it = std::find(AstriHorn::recognizedPackets.begin(), auto it = std::find(AstriHorn::recognizedPackets.begin(),
AstriHorn::recognizedPackets.end(), target); AstriHorn::recognizedPackets.end(), target);
......
...@@ -32,7 +32,8 @@ bool AstriMaGeneric::isRecognizedHeader() const { ...@@ -32,7 +32,8 @@ bool AstriMaGeneric::isRecognizedHeader() const {
size_t type = this->operator []("type").value(); size_t type = this->operator []("type").value();
size_t subtype = this->operator []("subtype").value(); size_t subtype = this->operator []("subtype").value();
ssize_t length = this->operator []("length").value(); ssize_t length = this->operator []("length").value();
ssize_t totLength = this->getHeaderSize() + length + this->getTailSize(); ssize_t totLength = this->getHeaderSize() + length-1 + this->getTailSize();
std::tuple<size_t, size_t, size_t> target = std::make_tuple(type, subtype,totLength); std::tuple<size_t, size_t, size_t> target = std::make_tuple(type, subtype,totLength);
auto it = std::find(AstriMa::recognizedPackets.begin(), auto it = std::find(AstriMa::recognizedPackets.begin(),
AstriMa::recognizedPackets.end(), target); AstriMa::recognizedPackets.end(), target);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment