|
|
|
@ -486,13 +486,20 @@ namespace pcsc { |
|
|
|
|
@returns list of readers that contain @c atr in their ATR */ |
|
|
|
|
static Strings getReadersWithAtr(const std::string& atr, |
|
|
|
|
Scope s=USER, bool exceptions=true) { |
|
|
|
|
CRYPTOLOG("getting all readers with atr: "<<atr); |
|
|
|
|
Connection c(s, exceptions); |
|
|
|
|
Strings res; |
|
|
|
|
pcsc::Connection::Strings readers(c.scan()); |
|
|
|
|
for (pcsc::Connection::Strings::const_iterator it(readers.begin()); |
|
|
|
|
it!=readers.end(); ++it) |
|
|
|
|
if (crypto::hex(c.reader(*it)->status().atr).find(atr)!=string::npos) |
|
|
|
|
res.push_back(*it); |
|
|
|
|
try { |
|
|
|
|
if (crypto::hex(c.reader(*it)->status().atr).find(atr) |
|
|
|
|
!=string::npos) |
|
|
|
|
CRYPTOLOG("found reader: "<<*it); |
|
|
|
|
res.push_back(*it); |
|
|
|
|
} catch (std::exception& x) { // ignore unusable readers
|
|
|
|
|
CRYPTOLOG("ignored unusable reader: "<<x.what()); |
|
|
|
|
} |
|
|
|
|
return res; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|