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
a1920505
Commit
a1920505
authored
Mar 23, 2016
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SILabs radio vid/pid
parent
177f6583
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
27 deletions
+30
-27
QGCSerialPortInfo.cc
src/comm/QGCSerialPortInfo.cc
+25
-26
QGCSerialPortInfo.h
src/comm/QGCSerialPortInfo.h
+5
-1
No files found.
src/comm/QGCSerialPortInfo.cc
View file @
a1920505
...
...
@@ -25,6 +25,22 @@
QGC_LOGGING_CATEGORY
(
QGCSerialPortInfoLog
,
"QGCSerialPortInfoLog"
)
static
const
struct
VIDPIDMapInfo_s
{
int
vendorId
;
int
productId
;
QGCSerialPortInfo
::
BoardType_t
boardType
;
const
char
*
boardString
;
}
s_rgVIDPIDMappings
[]
=
{
{
QGCSerialPortInfo
::
px4VendorId
,
QGCSerialPortInfo
::
pixhawkFMUV4ProductId
,
QGCSerialPortInfo
::
BoardTypePX4FMUV4
,
"Found PX4 FMU V4"
},
{
QGCSerialPortInfo
::
px4VendorId
,
QGCSerialPortInfo
::
pixhawkFMUV2ProductId
,
QGCSerialPortInfo
::
BoardTypePX4FMUV2
,
"Found PX4 FMU V2"
},
{
QGCSerialPortInfo
::
px4VendorId
,
QGCSerialPortInfo
::
pixhawkFMUV2OldBootloaderProductId
,
QGCSerialPortInfo
::
BoardTypePX4FMUV2
,
"Found PX4 FMU V2"
},
{
QGCSerialPortInfo
::
px4VendorId
,
QGCSerialPortInfo
::
pixhawkFMUV1ProductId
,
QGCSerialPortInfo
::
BoardTypePX4FMUV1
,
"Found PX4 FMU V1"
},
{
QGCSerialPortInfo
::
px4VendorId
,
QGCSerialPortInfo
::
px4FlowProductId
,
QGCSerialPortInfo
::
BoardTypePX4Flow
,
"Found PX4 Flow"
},
{
QGCSerialPortInfo
::
px4VendorId
,
QGCSerialPortInfo
::
AeroCoreProductId
,
QGCSerialPortInfo
::
BoardTypeAeroCore
,
"Found AeroCore"
},
{
QGCSerialPortInfo
::
threeDRRadioVendorId
,
QGCSerialPortInfo
::
threeDRRadioProductId
,
QGCSerialPortInfo
::
BoardTypeSikRadio
,
"Found SiK Radio"
},
{
QGCSerialPortInfo
::
siLabsRadioVendorId
,
QGCSerialPortInfo
::
siLabsRadioProductId
,
QGCSerialPortInfo
::
BoardTypeSikRadio
,
"Found SiK Radio"
},
};
QGCSerialPortInfo
::
QGCSerialPortInfo
(
void
)
:
QSerialPortInfo
()
{
...
...
@@ -45,31 +61,14 @@ QGCSerialPortInfo::BoardType_t QGCSerialPortInfo::boardType(void) const
BoardType_t
boardType
=
BoardTypeUnknown
;
switch
(
vendorIdentifier
())
{
case
px4VendorId
:
if
(
productIdentifier
()
==
pixhawkFMUV4ProductId
)
{
qCDebug
(
QGCSerialPortInfoLog
)
<<
"Found PX4 FMU V4"
;
boardType
=
BoardTypePX4FMUV4
;
}
else
if
(
productIdentifier
()
==
pixhawkFMUV2ProductId
||
productIdentifier
()
==
pixhawkFMUV2OldBootloaderProductId
)
{
qCDebug
(
QGCSerialPortInfoLog
)
<<
"Found PX4 FMU V2"
;
boardType
=
BoardTypePX4FMUV2
;
}
else
if
(
productIdentifier
()
==
pixhawkFMUV1ProductId
)
{
qCDebug
(
QGCSerialPortInfoLog
)
<<
"Found PX4 FMU V1"
;
boardType
=
BoardTypePX4FMUV1
;
}
else
if
(
productIdentifier
()
==
px4FlowProductId
)
{
qCDebug
(
QGCSerialPortInfoLog
)
<<
"Found PX4 Flow"
;
boardType
=
BoardTypePX4Flow
;
}
else
if
(
productIdentifier
()
==
AeroCoreProductId
)
{
qCDebug
(
QGCSerialPortInfoLog
)
<<
"Found AeroCore"
;
boardType
=
BoardTypeAeroCore
;
}
break
;
case
threeDRRadioVendorId
:
if
(
productIdentifier
()
==
threeDRRadioProductId
)
{
qCDebug
(
QGCSerialPortInfoLog
)
<<
"Found SiK Radio"
;
boardType
=
BoardType3drRadio
;
}
for
(
size_t
i
=
0
;
i
<
sizeof
(
s_rgVIDPIDMappings
)
/
sizeof
(
s_rgVIDPIDMappings
[
0
]);
i
++
)
{
const
struct
VIDPIDMapInfo_s
*
pIDMap
=
&
s_rgVIDPIDMappings
[
i
];
if
(
vendorIdentifier
()
==
pIDMap
->
vendorId
&&
productIdentifier
()
==
pIDMap
->
productId
)
{
boardType
=
pIDMap
->
boardType
;
qCDebug
(
QGCSerialPortInfoLog
)
<<
pIDMap
->
boardString
;
break
;
}
}
if
(
boardType
==
BoardTypeUnknown
)
{
...
...
@@ -92,13 +91,13 @@ QGCSerialPortInfo::BoardType_t QGCSerialPortInfo::boardType(void) const
boardType
=
BoardTypePX4Flow
;
}
else
if
(
description
()
==
"FT231X USB UART"
)
{
qCDebug
(
QGCSerialPortInfoLog
)
<<
"Found possible Radio (by name matching fallback)"
;
boardType
=
BoardType
3dr
Radio
;
boardType
=
BoardType
Sik
Radio
;
#ifdef __android__
}
else
if
(
description
().
endsWith
(
"USB UART"
))
{
// This is a fairly broad fallbacks for radios which will also catch most FTDI devices. That would
// cause problems on desktop due to incorrect connections. Since mobile is more anal about connecting
// it will work fine here.
boardType
=
BoardType
3dr
Radio
;
boardType
=
BoardType
Sik
Radio
;
#endif
}
}
...
...
src/comm/QGCSerialPortInfo.h
View file @
a1920505
...
...
@@ -44,7 +44,7 @@ public:
BoardTypePX4FMUV2
,
BoardTypePX4FMUV4
,
BoardTypePX4Flow
,
BoardType
3dr
Radio
,
BoardType
Sik
Radio
,
BoardTypeAeroCore
,
BoardTypeUnknown
}
BoardType_t
;
...
...
@@ -65,6 +65,9 @@ public:
static
const
int
threeDRRadioVendorId
=
1027
;
///< Vendor ID for 3DR Radio
static
const
int
threeDRRadioProductId
=
24597
;
///< Product ID for 3DR Radio
static
const
int
siLabsRadioVendorId
=
0x10c4
;
///< Vendor ID for SILabs Radio
static
const
int
siLabsRadioProductId
=
0xea60
;
///< Product ID for SILabs Radio
QGCSerialPortInfo
(
void
);
QGCSerialPortInfo
(
const
QSerialPort
&
port
);
...
...
@@ -79,6 +82,7 @@ public:
/// @return true: Board is currently in bootloader
bool
isBootloader
(
void
)
const
;
private:
};
#endif
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