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
d3b45c52
Commit
d3b45c52
authored
Jun 07, 2010
by
pixhawk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added packet logging
parent
d49b7022
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
1 deletion
+30
-1
MAVLinkProtocol.cc
src/comm/MAVLinkProtocol.cc
+21
-1
MAVLinkProtocol.h
src/comm/MAVLinkProtocol.h
+2
-0
MAVLinkSettingsWidget.ui
src/ui/MAVLinkSettingsWidget.ui
+7
-0
No files found.
src/comm/MAVLinkProtocol.cc
View file @
d3b45c52
...
...
@@ -80,6 +80,11 @@ MAVLinkProtocol::MAVLinkProtocol() :
MAVLinkProtocol
::~
MAVLinkProtocol
()
{
if
(
m_logfile
)
{
m_logfile
->
close
();
delete
m_logfile
;
}
}
...
...
@@ -89,6 +94,11 @@ void MAVLinkProtocol::run()
}
QString
MAVLinkProtocol
::
getLogfileName
()
{
return
QCoreApplication
::
applicationDirPath
()
+
"/mavlink.log"
;
}
/**
* The bytes are copied by calling the LinkInterface::readBytes() method.
* This method parses all incoming bytes and constructs a MAVLink packet.
...
...
@@ -115,6 +125,15 @@ void MAVLinkProtocol::receiveBytes(LinkInterface* link)
if
(
decodeState
==
1
)
{
// Log data
if
(
m_loggingEnabled
)
{
uint8_t
buf
[
MAVLINK_MAX_PACKET_LEN
];
mavlink_msg_to_send_buffer
(
buf
,
&
message
);
m_logfile
->
write
((
const
char
*
)
buf
);
qDebug
()
<<
"WROTE LOGFILE"
;
}
// ORDER MATTERS HERE!
// If the matching UAS object does not yet exist, it has to be created
// before emitting the packetReceived signal
...
...
@@ -324,7 +343,8 @@ void MAVLinkProtocol::enableLogging(bool enabled)
{
if
(
enabled
&&
!
m_loggingEnabled
)
{
m_logfile
=
new
QFile
(
QCoreApplication
::
applicationDirPath
()
+
"mavlink.log"
);
m_logfile
=
new
QFile
(
getLogfileName
());
m_logfile
->
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Append
);
}
else
{
...
...
src/comm/MAVLinkProtocol.h
View file @
d3b45c52
...
...
@@ -68,6 +68,8 @@ public:
bool
heartbeatsEnabled
(
void
);
/** @brief Get logging state */
bool
loggingEnabled
(
void
);
/** @brief Get the name of the packet log file */
QString
getLogfileName
();
public
slots
:
/** @brief Receive bytes from a communication interface */
...
...
src/ui/MAVLinkSettingsWidget.ui
View file @
d3b45c52
...
...
@@ -24,6 +24,13 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QCheckBox"
name=
"loggingCheckBox"
>
<property
name=
"text"
>
<string>
Log all MAVLink packets
</string>
</property>
</widget>
</item>
<item>
<spacer
name=
"verticalSpacer"
>
<property
name=
"orientation"
>
...
...
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