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 ...@@ -416,8 +416,8 @@ QHash<FirmwareUpgradeController::FirmwareIdentifier, QString>* FirmwareUpgradeCo
case QGCSerialPortInfo::BoardTypeSikRadio: case QGCSerialPortInfo::BoardTypeSikRadio:
boardId = Bootloader::boardID3DRRadio; boardId = Bootloader::boardID3DRRadio;
break; break;
case QGCSerialPortInfo::BoardTypeUnknown: default:
qWarning() << "Internal error"; qWarning() << "Internal error: invalid board type for flashing" << boardType;
boardId = Bootloader::boardIDPX4FMUV2; boardId = Bootloader::boardIDPX4FMUV2;
break; break;
} }
......
...@@ -141,7 +141,7 @@ bool PX4FirmwareUpgradeThreadWorker::_findBoardFromPorts(QGCSerialPortInfo& port ...@@ -141,7 +141,7 @@ bool PX4FirmwareUpgradeThreadWorker::_findBoardFromPorts(QGCSerialPortInfo& port
qCDebug(FirmwareUpgradeVerboseLog) << "\tproduct ID:" << info.productIdentifier(); qCDebug(FirmwareUpgradeVerboseLog) << "\tproduct ID:" << info.productIdentifier();
boardType = info.boardType(); boardType = info.boardType();
if (boardType != QGCSerialPortInfo::BoardTypeUnknown) { if (info.canFlash()) {
portInfo = info; portInfo = info;
return true; return true;
} }
......
...@@ -39,6 +39,7 @@ static const struct VIDPIDMapInfo_s { ...@@ -39,6 +39,7 @@ static const struct VIDPIDMapInfo_s {
{ QGCSerialPortInfo::px4VendorId, QGCSerialPortInfo::AeroCoreProductId, QGCSerialPortInfo::BoardTypeAeroCore, "Found AeroCore" }, { QGCSerialPortInfo::px4VendorId, QGCSerialPortInfo::AeroCoreProductId, QGCSerialPortInfo::BoardTypeAeroCore, "Found AeroCore" },
{ QGCSerialPortInfo::threeDRRadioVendorId, QGCSerialPortInfo::threeDRRadioProductId, QGCSerialPortInfo::BoardTypeSikRadio, "Found SiK Radio" }, { QGCSerialPortInfo::threeDRRadioVendorId, QGCSerialPortInfo::threeDRRadioProductId, QGCSerialPortInfo::BoardTypeSikRadio, "Found SiK Radio" },
{ QGCSerialPortInfo::siLabsRadioVendorId, QGCSerialPortInfo::siLabsRadioProductId, 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) : QGCSerialPortInfo::QGCSerialPortInfo(void) :
...@@ -128,3 +129,10 @@ bool QGCSerialPortInfo::isBootloader(void) const ...@@ -128,3 +129,10 @@ bool QGCSerialPortInfo::isBootloader(void) const
// FIXME: Check SerialLink bootloade detect code which is different // FIXME: Check SerialLink bootloade detect code which is different
return boardTypePixhawk() && description().contains("BL"); 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: ...@@ -46,6 +46,7 @@ public:
BoardTypePX4Flow, BoardTypePX4Flow,
BoardTypeSikRadio, BoardTypeSikRadio,
BoardTypeAeroCore, BoardTypeAeroCore,
BoardTypeRTKGPS,
BoardTypeUnknown BoardTypeUnknown
} BoardType_t; } BoardType_t;
...@@ -68,6 +69,9 @@ public: ...@@ -68,6 +69,9 @@ public:
static const int siLabsRadioVendorId = 0x10c4; ///< Vendor ID for SILabs Radio static const int siLabsRadioVendorId = 0x10c4; ///< Vendor ID for SILabs Radio
static const int siLabsRadioProductId = 0xea60; ///< Product 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(void);
QGCSerialPortInfo(const QSerialPort & port); QGCSerialPortInfo(const QSerialPort & port);
...@@ -76,6 +80,9 @@ public: ...@@ -76,6 +80,9 @@ public:
BoardType_t boardType(void) const; BoardType_t boardType(void) const;
/// @return true: we can flash this board type
bool canFlash(void);
/// @return true: board is a Pixhawk board /// @return true: board is a Pixhawk board
bool boardTypePixhawk(void) const; 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