Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Astri Packet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BIAS
Packets
Astri Packet
Commits
ba0a45ea
Commit
ba0a45ea
authored
1 year ago
by
Valerio Pastore
Browse files
Options
Downloads
Patches
Plain Diff
tail management fix
parent
07191051
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/AstriHornGeneric.cpp
+4
-4
4 additions, 4 deletions
src/AstriHornGeneric.cpp
with
4 additions
and
4 deletions
src/AstriHornGeneric.cpp
+
4
−
4
View file @
ba0a45ea
...
...
@@ -17,7 +17,7 @@ uint AstriHornGeneric::getHeaderSize() const {
uint
AstriHornGeneric
::
getPayloadSize
()
const
{
auto
val
=
this
->
operator
[](
5
);
if
(
val
.
has_value
())
return
val
.
value
()
-
1
;
return
val
.
value
()
+
1
;
else
{
std
::
cerr
<<
"Error: cannot access index 5 to get payload size."
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
...
...
@@ -25,7 +25,7 @@ uint AstriHornGeneric::getPayloadSize() const {
}
uint
AstriHornGeneric
::
getTailSize
()
const
{
return
2
;
return
0
;
}
bool
AstriHornGeneric
::
isRecognizedHeader
()
const
{
...
...
@@ -49,8 +49,8 @@ bool AstriHornGeneric::isRecognizedHeader(std::vector<uint8_t> buff) const {
size_t
type
=
buff
[
1
]
>>
4
;
size_t
subtype
=
buff
[
1
]
&
0x0F
;
ssize_t
length
=
(
buff
[
4
]
<<
8
)
+
buff
[
5
]
-
1
;
ssize_t
totLength
=
this
->
getHeaderSize
()
+
length
+
this
->
getTailSize
();
ssize_t
length
=
(
buff
[
4
]
<<
8
)
+
buff
[
5
];
ssize_t
totLength
=
this
->
getHeaderSize
()
+
length
+
1
+
this
->
getTailSize
();
std
::
tuple
<
size_t
,
size_t
,
size_t
>
target
=
std
::
make_tuple
(
type
,
subtype
,
totLength
);
auto
it
=
std
::
find
(
AstriHorn
::
recognizedPackets
.
begin
(),
AstriHorn
::
recognizedPackets
.
end
(),
target
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment