Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HighBlueParsers
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
Releases
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
Paul Best
HighBlueParsers
Commits
0839392a
Commit
0839392a
authored
5 months ago
by
Philémon Prévot
Browse files
Options
Downloads
Patches
Plain Diff
Create timestamp_dev branch
parent
3db22011
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/filewriter.cpp
+7
-2
7 additions, 2 deletions
src/filewriter.cpp
with
7 additions
and
2 deletions
src/filewriter.cpp
+
7
−
2
View file @
0839392a
...
...
@@ -153,22 +153,27 @@ float IMUFileWriter::GetFloatSafe(const unsigned char *p, int index) {
void
IMUFileWriter
::
DecodeMessage
(
unsigned
char
c
)
{
switch
(
rcvState
)
{
case
StateReception
::
Waiting
:
std
::
cout
<<
"Waiting : "
<<
c
;
if
(
c
==
0xFE
)
rcvState
=
StateReception
::
FunctionMSB
;
break
;
case
StateReception
::
FunctionMSB
:
std
::
cout
<<
"CMD_MSB : "
<<
c
;
msgDecodedFunction
=
static_cast
<
int16_t
>
(
c
<<
8
);
rcvState
=
StateReception
::
FunctionLSB
;
break
;
case
StateReception
::
FunctionLSB
:
std
::
cout
<<
"CMD_LSB : "
<<
c
;
msgDecodedFunction
+=
static_cast
<
int16_t
>
(
c
<<
0
);
rcvState
=
StateReception
::
PayloadLengthMSB
;
break
;
case
StateReception
::
PayloadLengthMSB
:
std
::
cout
<<
"PLD_MSB : "
<<
c
;
msgDecodedPayloadLength
=
static_cast
<
uint16_t
>
(
c
<<
8
);
rcvState
=
StateReception
::
PayloadLengthLSB
;
break
;
case
StateReception
::
PayloadLengthLSB
:
std
::
cout
<<
"PLD_LSB : "
<<
c
;
msgDecodedPayloadLength
+=
static_cast
<
uint16_t
>
(
c
<<
0
);
if
(
msgDecodedPayloadLength
>
0
)
{
if
(
msgDecodedPayloadLength
<
1024
)
{
...
...
@@ -185,6 +190,7 @@ void IMUFileWriter::DecodeMessage(unsigned char c) {
rcvState
=
StateReception
::
Decode
;
break
;
case
StateReception
::
Payload
:
std
::
cout
<<
"PLD : "
<<
c
;
if
(
msgDecodedPayloadIndex
>
msgDecodedPayloadLength
)
{
//Erreur
...
...
@@ -200,6 +206,7 @@ void IMUFileWriter::DecodeMessage(unsigned char c) {
break
;
case
StateReception
::
Decode
:
{
std
::
cout
<<
"DCD : "
<<
c
;
//Lance l'event de fin de decodage
ProcessDecodedMessage
(
msgDecodedFunction
,
msgDecodedPayloadLength
,
msgDecodedPayload
);
msgDecoded
++
;
...
...
@@ -448,8 +455,6 @@ void IMUFileWriter::ProcessDecodedMessage(int msgFunction, int msgPayloadLength,
}
void
IMUFileWriter
::
write
(
uint8_t
*
sample
,
size_t
size
,
uint8_t
*
imu_data
)
{
uint8_t
*
imu_data_cur
(
imu_data
);
if
(
this
->
qhb_version
==
3
)
{
for
(
int
i
=
1
;
i
<
size
-
1
;
i
++
)
{
...
...
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