| 
									
										
										
										
											2009-06-17 12:30:45 +00:00
										 |  |  | //g++ -I ../svn -I /usr/include/PCSC test.cpp -lpcsclite -ggdb3
 | 
					
						
							| 
									
										
										
										
											2009-08-28 06:56:23 +00:00
										 |  |  | #include <pcsc.hxx>
 | 
					
						
							| 
									
										
										
										
											2009-06-17 12:30:45 +00:00
										 |  |  | #include <iostream>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | int main(int, char const*const*const argv) try { | 
					
						
							|  |  |  |   pcsc::Connection c; | 
					
						
							|  |  |  |   pcsc::Connection::Strings reader(c.scan()); | 
					
						
							| 
									
										
										
										
											2010-08-03 13:48:47 +00:00
										 |  |  |   std::cout<<"Library-Version: "<<pcsc::version()<<std::endl; | 
					
						
							| 
									
										
										
										
											2009-06-17 12:30:45 +00:00
										 |  |  |   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; | 
					
						
							| 
									
										
										
										
											2009-10-07 07:22:20 +00:00
										 |  |  |     std::cout<<"ATR = "<<crypto::hex(s.atr)<<std::endl; | 
					
						
							| 
									
										
										
										
											2009-06-17 12:30:45 +00:00
										 |  |  |   } | 
					
						
							|  |  |  |   return 0; | 
					
						
							|  |  |  |  } catch (std::exception& x) { | 
					
						
							|  |  |  |   std::cerr<<"**** FEHLER in "<<*argv<<": "<<x.what()<<std::endl; | 
					
						
							|  |  |  |  } |