better logging in PCSC and first engine release; refs #11
This commit is contained in:
@@ -314,12 +314,12 @@ namespace pcsc {
|
||||
SCARD_IO_REQUEST rPci;
|
||||
rPci.dwProtocol = pci()->dwProtocol;
|
||||
rPci.cbPciLength = sizeof(rPci);
|
||||
PCSC_LOG("SCardTransmit: "<<crypto::hex(in));
|
||||
//PCSC_LOG("SCardTransmit: "<<crypto::hex(in));
|
||||
check(SCardTransmit(_id, &rPci,
|
||||
(unsigned char*)in.c_str(), in.size(),
|
||||
0, buff, &len),
|
||||
"smartcard transmit message "+crypto::hex(in));
|
||||
PCSC_LOG(" -> "<<crypto::hex(std::string((char*)buff, len)));
|
||||
//PCSC_LOG(" -> "<<crypto::hex(std::string((char*)buff, len)));
|
||||
return std::string((char*)buff, len);
|
||||
}
|
||||
|
||||
@@ -484,11 +484,15 @@ namespace pcsc {
|
||||
&num),
|
||||
"smartcard get size of readers of groups "+grp))
|
||||
return res;
|
||||
PCSC_LOG("size of readers: "<<num);
|
||||
std::auto_ptr<char_t> nm(new char_t[num]);
|
||||
if (!check(SCardListReaders(_id, groups.size()?strconv(grp).data():0,
|
||||
nm.get(), &num),
|
||||
"smartcard list reader names of groups "+grp))
|
||||
return res;
|
||||
PCSC_LOG("got all readers, size is "<<num);
|
||||
PCSC_LOG("list of readers: "
|
||||
<<crypto::readable(std::string(nm.get(), num-1)));
|
||||
return res = split(strconv(string(nm.get(), num-1)));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user