functions to scan specific cards; refs #28

This commit is contained in:
Marc Wäckerlin
2013-10-10 09:13:19 +00:00
parent 7b594f13c6
commit d9d0f2875f
3 changed files with 21 additions and 3 deletions

View File

@@ -547,6 +547,19 @@ namespace pcsc {
void close(const std::string& s) {
}
//! Find all readers with a given ATR.
/*! @param atr full or partial ATR to match to the reader's ATR
@returns list of readers that contain @c atr in their ATR */
Strings getReadersWithAtr(const std::string& atr) {
Strings res;
pcsc::Connection::Strings readers(scan());
for (pcsc::Connection::Strings::const_iterator it(readers.begin());
it!=readers.end(); ++it)
if (_reader[*it].status().atr.find(atr)!=string::npos)
res.push_back(*it);
return res;
}
//! @c false if last operation was not successful
operator bool() const {