Allow version and supported devices to be printed at runtime

This commit is contained in:
Paul Hollinsky
2018-11-20 10:41:42 -05:00
parent 2ade9116eb
commit 8a4e33c8df
7 changed files with 36 additions and 2 deletions
+5
View File
@@ -3,6 +3,7 @@
using namespace icsneo;
static bool supportedDevicesCached = false;
static std::vector<DeviceType> supportedDevices = {
#ifdef __NEOOBD2PRO_H_
@@ -156,5 +157,9 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
}
const std::vector<DeviceType>& DeviceFinder::GetSupportedDevices() {
if(!supportedDevicesCached) {
supportedDevices.erase(std::unique(supportedDevices.begin(), supportedDevices.end()), supportedDevices.end());
supportedDevicesCached = true;
}
return supportedDevices;
}