Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Distributed Autonomous Networked Control Lab
MicroCART
Commits
6e82c1e2
Commit
6e82c1e2
authored
3 years ago
by
Zach Eisele
Browse files
Options
Downloads
Patches
Plain Diff
fix decoding packet
parent
f8aae1c4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!76
lots of gui updates
,
!75
Lost of gui updates
,
!74
lots of gui updates among others
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
groundStation/adapters/crazyflie/src/cf_adapter.c
+2
-2
2 additions, 2 deletions
groundStation/adapters/crazyflie/src/cf_adapter.c
groundStation/src/backend/packet.c
+1
-1
1 addition, 1 deletion
groundStation/src/backend/packet.c
with
3 additions
and
3 deletions
groundStation/adapters/crazyflie/src/cf_adapter.c
+
2
−
2
View file @
6e82c1e2
...
...
@@ -267,11 +267,11 @@ size_t getSinglePacket(int fd, uint8_t * packet, int pSize){
//Get to data size bytes to find out total packet size
while
(
curLoc
<
6
){
curLoc
+=
recv
(
fd
,
packet
,
6
,
MSG_WAITALL
);
curLoc
+=
recv
(
fd
,
packet
,
7
,
MSG_WAITALL
);
}
//get the total packet size
totalPacketSize
=
packetSize
(
*
(
packet
+
4
)
<<
8
|
(
*
(
packet
+
5
)));
totalPacketSize
=
packetSize
(
*
(
packet
+
5
)
<<
8
|
(
*
(
packet
+
6
)));
printf
(
"
\t\t
total packet size %d
\n
"
,
totalPacketSize
);
//check that the total packet size isnt unreasonable TODO is this a valid check?
...
...
This diff is collapsed.
Click to expand it.
groundStation/src/backend/packet.c
+
1
−
1
View file @
6e82c1e2
...
...
@@ -20,7 +20,7 @@ ssize_t EncodePacket(
packet
[
BEGIN
]
=
BEGIN_CHAR
;
packet
[
MTYPE_L
]
=
LSByte16
(
m
->
msg_type
);
packet
[
MTYPE_H
]
=
MSByte16
(
m
->
msg_type
);
memcpy
(
packet
[
ID_L
],
m
->
msg_id
,
2
);
memcpy
(
&
packet
[
ID_L
],
&
m
->
msg_id
,
2
);
packet
[
DLEN_L
]
=
LSByte16
(
m
->
data_len
);
packet
[
DLEN_H
]
=
MSByte16
(
m
->
data_len
);
memcpy
(
&
packet
[
HDR_SIZE
],
data
,
m
->
data_len
);
...
...
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