mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user