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
02a5241e
Commit
02a5241e
authored
Jun 30, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better handling of vendor and product ids
parent
ff9ba294
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
70 additions
and
31 deletions
+70
-31
QGCApplication.pro
QGCApplication.pro
+1
-0
SerialPortIds.h
src/SerialPortIds.h
+42
-0
PX4FirmwareUpgradeThread.cc
src/VehicleSetup/PX4FirmwareUpgradeThread.cc
+24
-18
PX4FirmwareUpgradeThread.h
src/VehicleSetup/PX4FirmwareUpgradeThread.h
+0
-11
LinkManager.cc
src/comm/LinkManager.cc
+3
-2
No files found.
QGCApplication.pro
View file @
02a5241e
...
...
@@ -268,6 +268,7 @@ HEADERS += \
src
/
QmlControls
/
MavManager
.
h
\
src
/
QmlControls
/
ParameterEditorController
.
h
\
src
/
QmlControls
/
ScreenToolsController
.
h
\
src
/
SerialPortIds
.
h
\
src
/
uas
/
QGCMAVLinkUASFactory
.
h
\
src
/
uas
/
FileManager
.
h
\
src
/
uas
/
UAS
.
h
\
...
...
src/SerialPortIds.h
0 → 100644
View file @
02a5241e
/*=====================================================================
QGroundControl Open Source Ground Control Station
(c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
This file is part of the QGROUNDCONTROL project
QGROUNDCONTROL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
QGROUNDCONTROL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
======================================================================*/
#ifndef SerialPortIds_H
#define SerialPortIds_H
// SerialPortInfo Vendor and Product Ids for known boards
class
SerialPortIds
{
public:
static
const
int
px4VendorId
=
9900
;
///< Vendor ID for Pixhawk board (V2 and V1) and PX4 Flow
static
const
int
pixhawkFMUV2ProductId
=
17
;
///< Product ID for Pixhawk V2 board
static
const
int
pixhawkFMUV1ProductId
=
16
;
///< Product ID for PX4 FMU V1 board
static
const
int
px4FlowProductId
=
21
;
///< Product ID for PX4 Flow board
static
const
int
threeDRRadioVendorId
=
1027
;
///< Vendor ID for 3DR Radio
static
const
int
threeDRRadioProductId
=
24597
;
///< Product ID for 3DR Radio
};
#endif
\ No newline at end of file
src/VehicleSetup/PX4FirmwareUpgradeThread.cc
View file @
02a5241e
...
...
@@ -29,6 +29,7 @@
#include "Bootloader.h"
#include "QGCLoggingCategory.h"
#include "QGC.h"
#include "SerialPortIds.h"
#include <QTimer>
#include <QSerialPortInfo>
...
...
@@ -145,24 +146,29 @@ bool PX4FirmwareUpgradeThreadWorker::_findBoardFromPorts(QSerialPortInfo& portIn
#endif
if
(
!
info
.
portName
().
isEmpty
())
{
if
(
info
.
vendorIdentifier
()
==
_px4VendorId
)
{
if
(
info
.
productIdentifier
()
==
_pixhawkFMUV2ProductId
)
{
qCDebug
(
FirmwareUpgradeLog
)
<<
"Found PX4 FMU V2"
;
type
=
FoundBoardPX4FMUV2
;
found
=
true
;
}
else
if
(
info
.
productIdentifier
()
==
_pixhawkFMUV1ProductId
)
{
qCDebug
(
FirmwareUpgradeLog
)
<<
"Found PX4 FMU V1"
;
type
=
FoundBoardPX4FMUV2
;
found
=
true
;
}
else
if
(
info
.
productIdentifier
()
==
_flowProductId
)
{
qCDebug
(
FirmwareUpgradeLog
)
<<
"Found PX4 Flow"
;
type
=
FoundBoardPX4Flow
;
found
=
true
;
}
}
else
if
(
info
.
vendorIdentifier
()
==
_3drRadioVendorId
&&
info
.
productIdentifier
()
==
_3drRadioProductId
)
{
qCDebug
(
FirmwareUpgradeLog
)
<<
"Found 3DR Radio"
;
type
=
FoundBoard3drRadio
;
found
=
true
;
switch
(
info
.
vendorIdentifier
())
{
case
SerialPortIds
:
:
px4VendorId
:
if
(
info
.
productIdentifier
()
==
SerialPortIds
::
pixhawkFMUV2ProductId
)
{
qCDebug
(
FirmwareUpgradeLog
)
<<
"Found PX4 FMU V2"
;
type
=
FoundBoardPX4FMUV2
;
found
=
true
;
}
else
if
(
info
.
productIdentifier
()
==
SerialPortIds
::
pixhawkFMUV1ProductId
)
{
qCDebug
(
FirmwareUpgradeLog
)
<<
"Found PX4 FMU V1"
;
type
=
FoundBoardPX4FMUV2
;
found
=
true
;
}
else
if
(
info
.
productIdentifier
()
==
SerialPortIds
::
px4FlowProductId
)
{
qCDebug
(
FirmwareUpgradeLog
)
<<
"Found PX4 Flow"
;
type
=
FoundBoardPX4Flow
;
found
=
true
;
}
break
;
case
SerialPortIds
:
:
threeDRRadioVendorId
:
if
(
info
.
productIdentifier
()
==
SerialPortIds
::
threeDRRadioProductId
)
{
qCDebug
(
FirmwareUpgradeLog
)
<<
"Found 3DR Radio"
;
type
=
FoundBoard3drRadio
;
found
=
true
;
}
break
;
}
}
...
...
src/VehicleSetup/PX4FirmwareUpgradeThread.h
View file @
02a5241e
...
...
@@ -100,17 +100,6 @@ private:
bool
_foundBoard
;
///< true: board is currently connected
bool
_findBoardFirstAttempt
;
///< true: this is our first try looking for a board
QSerialPortInfo
_foundBoardPortInfo
;
///< port info for found board
// Serial port info for supported devices
static
const
int
_px4VendorId
=
9900
;
static
const
int
_pixhawkFMUV2ProductId
=
17
;
static
const
int
_pixhawkFMUV1ProductId
=
16
;
static
const
int
_flowProductId
=
21
;
static
const
int
_3drRadioVendorId
=
1027
;
static
const
int
_3drRadioProductId
=
24597
;
};
/// @brief Provides methods to interact with the bootloader. The commands themselves are signalled
...
...
src/comm/LinkManager.cc
View file @
02a5241e
...
...
@@ -45,6 +45,7 @@ This file is part of the QGROUNDCONTROL project
#include "MainWindow.h"
#include "QGCMessageBox.h"
#include "QGCApplication.h"
#include "SerialPortIds.h"
IMPLEMENT_QGC_SINGLETON
(
LinkManager
,
LinkManager
)
QGC_LOGGING_CATEGORY
(
LinkManagerLog
,
"LinkManagerLog"
)
...
...
@@ -493,7 +494,7 @@ void LinkManager::_updateConfigurationList(void)
// Save port name
currentPorts
<<
portInfo
.
systemLocation
();
// Is this a PX4 and NOT in bootloader mode?
if
(
portInfo
.
vendorIdentifier
()
==
9900
&&
!
portInfo
.
description
().
contains
(
"BL"
))
{
if
(
portInfo
.
vendorIdentifier
()
==
SerialPortIds
::
px4VendorId
&&
!
portInfo
.
description
().
contains
(
"BL"
))
{
SerialConfiguration
*
pSerial
=
_findSerialConfiguration
(
portInfo
.
systemLocation
());
if
(
pSerial
)
{
//-- If this port is configured make sure it has the preferred flag set
...
...
@@ -521,7 +522,7 @@ void LinkManager::_updateConfigurationList(void)
}
}
// Is this an FTDI Chip? It could be a 3DR Modem
if
(
portInfo
.
vendorIdentifier
()
==
1027
)
{
if
(
portInfo
.
vendorIdentifier
()
==
SerialPortIds
::
threeDRRadioVendorId
&&
portInfo
.
productIdentifier
()
==
SerialPortIds
::
threeDRRadioProductId
)
{
SerialConfiguration
*
pSerial
=
_findSerialConfiguration
(
portInfo
.
systemLocation
());
if
(
pSerial
)
{
//-- If this port is configured make sure it has the preferred flag set, unless someone else already has it set.
...
...
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