mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-16 18:38:32 +03:00
pySim-*.py: add command line option for Calypso reader
Change-Id: Ia895ced62d29e06ae8af05cd95c9d181fb53b9df
This commit is contained in:
@@ -56,6 +56,10 @@ def parse_options():
|
||||
help="Which PC/SC reader number for SIM access",
|
||||
default=None,
|
||||
)
|
||||
parser.add_option("--osmocon", dest="osmocon_sock", metavar="PATH",
|
||||
help="Socket path for Calypso (e.g. Motorola C1XX) based reader (via OsmocomBB)",
|
||||
default=None,
|
||||
)
|
||||
|
||||
(options, args) = parser.parse_args()
|
||||
|
||||
@@ -74,6 +78,9 @@ if __name__ == '__main__':
|
||||
if opts.pcsc_dev is not None:
|
||||
from pySim.transport.pcsc import PcscSimLink
|
||||
sl = PcscSimLink(opts.pcsc_dev)
|
||||
elif opts.osmocon_sock is not None:
|
||||
from pySim.transport.calypso import CalypsoSimLink
|
||||
sl = CalypsoSimLink(sock_path=opts.osmocon_sock)
|
||||
else: # Serial reader is default
|
||||
from pySim.transport.serial import SerialSimLink
|
||||
sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate)
|
||||
|
||||
Reference in New Issue
Block a user