imported pcsc.hxx
This commit is contained in:
25
doc/examples/pcsc-demo.cpp
Normal file
25
doc/examples/pcsc-demo.cpp
Normal file
@@ -0,0 +1,25 @@
|
||||
//g++ -I ../svn -I /usr/include/PCSC test.cpp -lpcsclite -ggdb3
|
||||
#include "pcscpp/pcsc.hxx"
|
||||
#include "pcscpp/cardos.hxx"
|
||||
#include <iostream>
|
||||
|
||||
int main(int, char const*const*const argv) try {
|
||||
pcsc::Connection c;
|
||||
pcsc::Connection::Strings reader(c.scan());
|
||||
std::cout<<"Suche PCSC-Reader ..."<<std::endl;
|
||||
if (!reader.size()) std::cout<<"Keine gefunden."<<std::endl;
|
||||
for (pcsc::Connection::Strings::const_iterator it(reader.begin());
|
||||
it!=reader.end(); ++it) {
|
||||
std::cout<<"Reader: "<<*it<<std::endl;
|
||||
pcsc::Connection::Reader::Status s(c.reader(*it).status());
|
||||
std::cout<<"Status = "<<s.state<<std::endl;
|
||||
std::cout<<"Attribute = ";
|
||||
for (std::vector<unsigned char>::const_iterator it(s.attr.begin());
|
||||
it!=s.attr.end(); ++it)
|
||||
std::cout<<std::hex<<(int)*it<<" ";
|
||||
std::cout<<std::endl;
|
||||
}
|
||||
return 0;
|
||||
} catch (std::exception& x) {
|
||||
std::cerr<<"**** FEHLER in "<<*argv<<": "<<x.what()<<std::endl;
|
||||
}
|
Reference in New Issue
Block a user