Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
b8dd8c44
Unverified
Commit
b8dd8c44
authored
Dec 23, 2017
by
Don Gagne
Committed by
GitHub
Dec 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5910 from mavlink/rtcm_sequence_number
RTCMMavlink: fix sequence numbers
parents
a88e1c45
d7f5411e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
6 deletions
+4
-6
RTCMMavlink.cc
src/GPS/RTCM/RTCMMavlink.cc
+3
-6
RTCMMavlink.h
src/GPS/RTCM/RTCMMavlink.h
+1
-0
No files found.
src/GPS/RTCM/RTCMMavlink.cc
View file @
b8dd8c44
...
...
@@ -38,29 +38,26 @@ void RTCMMavlink::RTCMDataUpdate(QByteArray message)
if
(
message
.
size
()
<
maxMessageLength
)
{
mavlinkRtcmData
.
len
=
message
.
size
();
mavlinkRtcmData
.
flags
=
(
_sequenceId
&
0x1F
)
<<
3
;
memcpy
(
&
mavlinkRtcmData
.
data
,
message
.
data
(),
message
.
size
());
sendMessageToVehicle
(
mavlinkRtcmData
);
}
else
{
// We need to fragment
static
uint8_t
sequenceId
=
0
;
// Sequence id is used to indicate that the individual fragements belong to the same set
uint8_t
fragmentId
=
0
;
// Fragment id indicates the fragment within a set
int
start
=
0
;
while
(
start
<
message
.
size
())
{
int
length
=
std
::
min
(
message
.
size
()
-
start
,
maxMessageLength
);
mavlinkRtcmData
.
flags
=
1
;
// LSB set indicates message is fragmented
mavlinkRtcmData
.
flags
|=
fragmentId
++
<<
1
;
// Next 2 bits are fragment id
mavlinkRtcmData
.
flags
|=
sequenceId
++
<<
3
;
// Next 5 bits are sequence id
mavlinkRtcmData
.
flags
|=
(
_sequenceId
&
0x1F
)
<<
3
;
// Next 5 bits are sequence id
mavlinkRtcmData
.
len
=
length
;
memcpy
(
&
mavlinkRtcmData
.
data
,
message
.
data
()
+
start
,
length
);
sendMessageToVehicle
(
mavlinkRtcmData
);
start
+=
length
;
}
if
(
sequenceId
==
0x1F
)
{
sequenceId
=
0
;
}
}
++
_sequenceId
;
}
void
RTCMMavlink
::
sendMessageToVehicle
(
const
mavlink_gps_rtcm_data_t
&
msg
)
...
...
src/GPS/RTCM/RTCMMavlink.h
View file @
b8dd8c44
...
...
@@ -36,4 +36,5 @@ private:
QGCToolbox
&
_toolbox
;
QElapsedTimer
_bandwidthTimer
;
int
_bandwidthByteCounter
=
0
;
uint8_t
_sequenceId
=
0
;
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment