Our express partner will perform scheduled system maintenance from 19th Jan to 3rd Feb, so during this time, all the orders in our webshop will be handled from 4th Feb.
Sorry for any inconvenience caused.

About pyusb

JavaCard Applet Development Related Questions and Answers.
DaHuFa
Posts: 50
Joined: Mon Jun 04, 2018 5:07 am
Points :356
Contact:

About pyusb

Post by DaHuFa » Wed Mar 11, 2020 2:43 am

I want use pyusb to test my CCID device. But I'm new to pyusb. I installed pyusb and liusb. But when I called get_active_configuration() or set_configuration(), I got the "Operation not supported or unimplemented on this platform" information. Why?

DaHuFa
Posts: 50
Joined: Mon Jun 04, 2018 5:07 am
Points :356
Contact:

Re: About pyusb

Post by DaHuFa » Wed Mar 11, 2020 2:45 am

Did my smartcard reader driver cause this question?

DaHuFa
Posts: 50
Joined: Mon Jun 04, 2018 5:07 am
Points :356
Contact:

Re: About pyusb

Post by DaHuFa » Thu Mar 12, 2020 2:13 am

Now I resolved this problem by installed the newest libusb(libusb-1.0.22). And set_configuration() worked rightly. But a new question appread. Tt is write function.

Code: Select all

dev = usb.core.find(idVendor=0x096e, idProduct=0x0856)

dev.set_configuration()
cfg = dev.get_active_configuration()

for intf in cfg:
    if intf.bInterfaceClass == 0x0B: #smart card
        break
        
out_ep = None
in_ep = None
for ep in intf:
    if usb.util.endpoint_direction(ep.bEndpointAddress) == usb.util.ENDPOINT_IN:
        in_ep = ep
    if usb.util.endpoint_direction(ep.bEndpointAddress) == usb.util.ENDPOINT_OUT:
        out_ep = ep

print out_ep
print in_ep
dev.ctrl_transfer(bmRequestType=0x80, bRequest=0x06, wValue=0x0302, wIndex=0x0409, data_or_wLength=0x0018)
out.write('\x63\x00\x00\x00\x00\x00\x00\x00\x00\x00')
The error appeared when PC processing out.write function:
NotImplementedError: Operation not supported or unimplemented on this platform
:?: :?: :?:

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 10 guests

JavaCard OS : Disclaimer