Extract debug tool firmware version at startup
This commit is contained in:
@@ -45,6 +45,8 @@ public:
|
||||
|
||||
virtual std::string getSerialNumber() = 0;
|
||||
|
||||
virtual std::string getFirmwareVersionString() = 0;
|
||||
|
||||
/**
|
||||
* All debug tools that support target power management functions must provide an implementation of the
|
||||
* TargetPowerManagementInterface class, via this function.
|
||||
|
||||
@@ -121,6 +121,11 @@ namespace DebugToolDrivers
|
||||
return std::string(data.begin(), data.end());
|
||||
}
|
||||
|
||||
std::string EdbgDevice::getFirmwareVersionString() {
|
||||
// TODO: Implement this
|
||||
return "UNKNOWN";
|
||||
}
|
||||
|
||||
void EdbgDevice::startSession() {
|
||||
using namespace CommandFrames::HouseKeeping;
|
||||
using ResponseFrames::HouseKeeping::ResponseId;
|
||||
|
||||
@@ -74,6 +74,13 @@ namespace DebugToolDrivers
|
||||
*/
|
||||
std::string getSerialNumber() override;
|
||||
|
||||
/**
|
||||
* Retrieves the EDBG firmware version.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
std::string getFirmwareVersionString() override;
|
||||
|
||||
/**
|
||||
* Starts a session with the EDBG device using the "Housekeeping" EDBG sub-protocol.
|
||||
*/
|
||||
|
||||
@@ -59,6 +59,10 @@ namespace DebugToolDrivers::Wch
|
||||
return UsbDevice::getSerialNumber();
|
||||
}
|
||||
|
||||
std::string WchLinkBase::getFirmwareVersionString() {
|
||||
return "v" + this->getDeviceInfo().firmwareVersion.toString();
|
||||
}
|
||||
|
||||
const DeviceInfo& WchLinkBase::getDeviceInfo() const {
|
||||
if (!this->cachedDeviceInfo.has_value()) {
|
||||
this->cachedDeviceInfo = this->wchLinkInterface->getDeviceInfo();
|
||||
|
||||
@@ -30,6 +30,8 @@ namespace DebugToolDrivers::Wch
|
||||
|
||||
std::string getSerialNumber() override;
|
||||
|
||||
std::string getFirmwareVersionString() override;
|
||||
|
||||
protected:
|
||||
WchLinkVariant variant;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user