diff options
author | Robin Krahl <me@robin-krahl.de> | 2019-01-13 12:03:43 +0100 |
---|---|---|
committer | Robin Krahl <me@robin-krahl.de> | 2019-01-13 12:03:43 +0100 |
commit | 71d4ecc04c23342f207e7f1133ea8824a1dcdd16 (patch) | |
tree | 2c51eeb8fee8fc928cd1f32040b0140088507b50 /NitrokeyManager.cc | |
parent | 4a7ce051bd4004fb62f1c7022d92efa2ce42b6ab (diff) | |
download | libnitrokey-71d4ecc04c23342f207e7f1133ea8824a1dcdd16.tar.gz libnitrokey-71d4ecc04c23342f207e7f1133ea8824a1dcdd16.tar.bz2 |
Change Nitrokey::list_devices return type to use DeviceInfo
In the previous commit, we changed the return value of Device::enumerate
to std::vector<DeviceInfo>. Now we change Nitrokey::list_devices to
also return DeviceInfo instances.
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r-- | NitrokeyManager.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 8825fce..8ca4698 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -105,16 +105,11 @@ using nitrokey::misc::strcpyT; return true; } - std::vector<std::string> NitrokeyManager::list_devices(){ + std::vector<DeviceInfo> NitrokeyManager::list_devices(){ std::lock_guard<std::mutex> lock(mex_dev_com_manager); auto p = make_shared<Stick20>(); - auto device_infos = p->enumerate(); - std::vector<std::string> strings; - strings.resize(device_infos.size()); - std::transform(device_infos.begin(), device_infos.end(), strings.begin(), - [](auto device_info) { return device_info.m_path; }); - return strings; + return p->enumerate(); } std::vector<std::string> NitrokeyManager::list_devices_by_cpuID(){ |