serial_pysim.py: Cleanup: early test code for serial pysim communication

The code changes the config to config number 2 and tries to connect
to the serial CCID reader. This only was useful in the early stage
of the project.
This commit is contained in:
Christina Quast
2015-05-18 17:19:42 +02:00
parent ba486b61ad
commit e0832d6a1f

View File

@@ -1,35 +0,0 @@
#!/usr/bin/env python3
import usb.core
import usb.util
import sys
from pySim.transport.serial import SerialSimLink
from pySim.commands import SimCardCommands
dev = usb.core.find(idVendor=0x03eb, idProduct=0x6004)
if dev is None:
raise ValueError("Device not found")
else:
print("Found device")
print("dev.set_configuration(2)")
dev.set_configuration(2)
cfg = dev.get_active_configuration()
print("Active config: ")
print(cfg)
if len(sys.argv) == 2:
device = sys.argv[1]
else:
device='/dev/ttyUSB2'
baudrate='9600'
sl = SerialSimLink(device, baudrate)
scc = SimCardCommands(transport=sl)
sl.wait_for_card()