FreeSRP: Add support for multiple devices in get_devices

This commit is contained in:
Lukas Lao Beyer 2017-04-22 13:42:34 -04:00 committed by Dimitri Stolnikov
parent 3c7d3f1664
commit 1693e4e9d8
1 changed files with 9 additions and 9 deletions

View File

@ -116,18 +116,18 @@ vector<string> freesrp_common::get_devices()
{ {
vector<string> devices; vector<string> devices;
try vector<string> serial_numbers = ::FreeSRP::FreeSRP::list_connected();
{
::FreeSRP::FreeSRP srp;
string str; int index = 0;
str = "freesrp=0,label='FreeSRP'";
devices.push_back(str); for(string &serial : serial_numbers)
}
catch(const ConnectionError &err)
{ {
// No FreeSRP found. index++;
string str;
str = "freesrp=" + serial + ",label='FreeSRP " + to_string(index) + "'";
devices.push_back(str);
} }
return devices; return devices;