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
ecf99f66
Commit
ecf99f66
authored
Jan 12, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Keep track of USB direct connection links
parent
438cf368
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
0 deletions
+17
-0
LinkManager.cc
src/comm/LinkManager.cc
+2
-0
SerialLink.cc
src/comm/SerialLink.cc
+10
-0
SerialLink.h
src/comm/SerialLink.h
+5
-0
No files found.
src/comm/LinkManager.cc
View file @
ecf99f66
...
...
@@ -508,11 +508,13 @@ void LinkManager::_updateAutoConnectLinks(void)
case
QGCSerialPortInfo
:
:
BoardTypePX4FMUV4
:
if
(
_autoconnectPixhawk
)
{
pSerialConfig
=
new
SerialConfiguration
(
QString
(
"Pixhawk on %1"
).
arg
(
portInfo
.
portName
().
trimmed
()));
pSerialConfig
->
setUsbDirect
(
true
);
}
break
;
case
QGCSerialPortInfo
:
:
BoardTypeAeroCore
:
if
(
_autoconnectPixhawk
)
{
pSerialConfig
=
new
SerialConfiguration
(
QString
(
"AeroCore on %1"
).
arg
(
portInfo
.
portName
().
trimmed
()));
pSerialConfig
->
setUsbDirect
(
true
);
}
break
;
case
QGCSerialPortInfo
:
:
BoardTypePX4Flow
:
...
...
src/comm/SerialLink.cc
View file @
ecf99f66
...
...
@@ -388,6 +388,7 @@ SerialConfiguration::SerialConfiguration(const QString& name) : LinkConfiguratio
_parity
=
QSerialPort
::
NoParity
;
_dataBits
=
8
;
_stopBits
=
1
;
_usbDirect
=
false
;
}
SerialConfiguration
::
SerialConfiguration
(
SerialConfiguration
*
copy
)
:
LinkConfiguration
(
copy
)
...
...
@@ -399,6 +400,7 @@ SerialConfiguration::SerialConfiguration(SerialConfiguration* copy) : LinkConfig
_stopBits
=
copy
->
stopBits
();
_portName
=
copy
->
portName
();
_portDisplayName
=
copy
->
portDisplayName
();
_usbDirect
=
copy
->
_usbDirect
;
}
void
SerialConfiguration
::
copyFrom
(
LinkConfiguration
*
source
)
...
...
@@ -413,6 +415,7 @@ void SerialConfiguration::copyFrom(LinkConfiguration *source)
_stopBits
=
ssource
->
stopBits
();
_portName
=
ssource
->
portName
();
_portDisplayName
=
ssource
->
portDisplayName
();
_usbDirect
=
ssource
->
_usbDirect
;
}
void
SerialConfiguration
::
updateSettings
()
...
...
@@ -554,3 +557,10 @@ void SerialConfiguration::_initBaudRates()
kSupportedBaudRates
<<
"921600"
;
}
void
SerialConfiguration
::
setUsbDirect
(
bool
usbDirect
)
{
if
(
_usbDirect
!=
usbDirect
)
{
_usbDirect
=
usbDirect
;
emit
usbDirectChanged
(
_usbDirect
);
}
}
src/comm/SerialLink.h
View file @
ecf99f66
...
...
@@ -73,12 +73,14 @@ public:
Q_PROPERTY
(
int
parity
READ
parity
WRITE
setParity
NOTIFY
parityChanged
)
Q_PROPERTY
(
QString
portName
READ
portName
WRITE
setPortName
NOTIFY
portNameChanged
)
Q_PROPERTY
(
QString
portDisplayName
READ
portDisplayName
NOTIFY
portDisplayNameChanged
)
Q_PROPERTY
(
bool
usbDirect
READ
usbDirect
WRITE
setUsbDirect
NOTIFY
usbDirectChanged
)
///< true: direct usb connection to board
int
baud
()
{
return
_baud
;
}
int
dataBits
()
{
return
_dataBits
;
}
int
flowControl
()
{
return
_flowControl
;
}
///< QSerialPort Enums
int
stopBits
()
{
return
_stopBits
;
}
int
parity
()
{
return
_parity
;
}
///< QSerialPort Enums
bool
usbDirect
()
{
return
_usbDirect
;
}
const
QString
portName
()
{
return
_portName
;
}
const
QString
portDisplayName
()
{
return
_portDisplayName
;
}
...
...
@@ -89,6 +91,7 @@ public:
void
setStopBits
(
int
stopBits
);
void
setParity
(
int
parity
);
///< QSerialPort Enums
void
setPortName
(
const
QString
&
portName
);
void
setUsbDirect
(
bool
usbDirect
);
static
QStringList
supportedBaudRates
();
static
QString
cleanPortDisplayname
(
const
QString
name
);
...
...
@@ -109,6 +112,7 @@ signals:
void
parityChanged
();
void
portNameChanged
();
void
portDisplayNameChanged
();
void
usbDirectChanged
(
bool
usbDirect
);
private:
static
void
_initBaudRates
();
...
...
@@ -121,6 +125,7 @@ private:
int
_parity
;
QString
_portName
;
QString
_portDisplayName
;
bool
_usbDirect
;
};
/**
...
...
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