-
-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhancement #68 #69
Enhancement #68 #69
Conversation
Following a discussion, on PCSC, new implementation is pushed, just now. This 2nd version implements missing SCARD_ATTR_CHANNEL_ID, for USB devices. |
The code should also compile with |
Tried to compile with --enable-twinserial, with no particular problem. |
Try: |
With #ifdef, I won't have the undef on get_ccid_usb_xxx(), but I'll get the undef on log_yyy(). |
With #if ! defined() :
|
Newly introduced functions get_ccid_usb_XXX() are not available with ./configure --enable-twinserial.
I can squash both commits, if you prefer. |
I also added a test in PCSC |
Thx for all. |
To summarize the whole:
|
I am not sure the patch does what you want. The USB address is NOT stable. It is an incrementing number.
And SCardGetAttrib.py gives me:
Now I unplug and replug the reader and I get:
and
The USB address is NOT related to a physical USB socket. If I connect to another USB port but on the same USB bus then the number will just increase as if I reconnect on the same USB socket. Maybe what you want to use is libusb_get_port_number() |
Fixed in 810b550 |
The port was in my initial request, yes, as physical (when no HUB is used). Anyway, on my side, I get the bus/address & port with an existing connection to libusb. From my point of view, would be great to have all USB info (vendor, product, serial, bus, address, port and maybe some others) with a single call to CCID, as my application considers the reader like a USB device, before a card reader. This is possibly the same for some others implementations. A kind of ListReadersInfo(), returning the DEVICE_NAME and the CHANNEL_ID (possibly some other things) of all the readers, in one shot, would be of a great help. Then, it becomes easier, for me (for us) to implement a kind of OpenDeviceByChannel(), for instance. |
I fully understand your request. Do you prefer to get the address or the port with SCARD_ATTR_CHANNEL_ID? |
Address is better.
Note that the "device" is actually the USB Device Address, above... I don't know why, but "port" is rather difficult to find, with those tools ;-) |
I agree with your point, about the "proprietary extensions". |
I also agree to use address instead of port. For port we would need the full USB topology using libusb_get_port_numbers(). But that is not possible to send the result with just 1 byte. |
This patch uses new constants in PCSC (when available).
These new constants allow an access to USB parameters: