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