Commit db59e0bb authored by Don Gagne's avatar Don Gagne

Merge pull request #3205 from DonLakeFlyer/RTKSerialPortInfo

Plumb ublox RTK device ids through QGCSerialPortInfo
parents 7a6a9884 5a03aed7
......@@ -416,8 +416,8 @@ QHash<FirmwareUpgradeController::FirmwareIdentifier, QString>* FirmwareUpgradeCo
case QGCSerialPortInfo::BoardTypeSikRadio:
boardId = Bootloader::boardID3DRRadio;
break;
case QGCSerialPortInfo::BoardTypeUnknown:
qWarning() << "Internal error";
default:
qWarning() << "Internal error: invalid board type for flashing" << boardType;
boardId = Bootloader::boardIDPX4FMUV2;
break;
}
......
......@@ -141,7 +141,7 @@ bool PX4FirmwareUpgradeThreadWorker::_findBoardFromPorts(QGCSerialPortInfo& port
qCDebug(FirmwareUpgradeVerboseLog) << "\tproduct ID:" << info.productIdentifier();
boardType = info.boardType();
if (boardType != QGCSerialPortInfo::BoardTypeUnknown) {
if (info.canFlash()) {
portInfo = info;
return true;
}
......
......@@ -39,6 +39,7 @@ static const struct VIDPIDMapInfo_s {
{ 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::ubloxRTKVendorId, QGCSerialPortInfo::ubloxRTKProductId, QGCSerialPortInfo::BoardTypeRTKGPS, "Found RTK GPS" },
};
QGCSerialPortInfo::QGCSerialPortInfo(void) :
......@@ -128,3 +129,10 @@ bool QGCSerialPortInfo::isBootloader(void) const
// FIXME: Check SerialLink bootloade detect code which is different
return boardTypePixhawk() && description().contains("BL");
}
bool QGCSerialPortInfo::canFlash(void)
{
BoardType_t boardType = this->boardType();
return boardType != QGCSerialPortInfo::BoardTypeUnknown && boardType != QGCSerialPortInfo::BoardTypeRTKGPS;
}
......@@ -46,6 +46,7 @@ public:
BoardTypePX4Flow,
BoardTypeSikRadio,
BoardTypeAeroCore,
BoardTypeRTKGPS,
BoardTypeUnknown
} BoardType_t;
......@@ -68,6 +69,9 @@ public:
static const int siLabsRadioVendorId = 0x10c4; ///< Vendor ID for SILabs Radio
static const int siLabsRadioProductId = 0xea60; ///< Product ID for SILabs Radio
static const int ubloxRTKVendorId = 5446; ///< Vendor ID for ublox RTK
static const int ubloxRTKProductId = 424; ///< Product ID for ublox RTK
QGCSerialPortInfo(void);
QGCSerialPortInfo(const QSerialPort & port);
......@@ -76,6 +80,9 @@ public:
BoardType_t boardType(void) const;
/// @return true: we can flash this board type
bool canFlash(void);
/// @return true: board is a Pixhawk board
bool boardTypePixhawk(void) const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment