transport: add Bluetooth (SIM Access Profile) based transport

Change-Id: I2e8b202ac5cddf7c8533115d53dd0d64da6ca9b9
This commit is contained in:
Gabriel K. Gegenhuber
2022-02-13 21:51:27 +06:00
committed by Vadim Yanitskiy
parent e8d177d88f
commit ccb8499ea9
2 changed files with 562 additions and 0 deletions

View File

@@ -215,6 +215,10 @@ def argparse_add_reader_args(arg_parser):
osmobb_group.add_argument('--osmocon', dest='osmocon_sock', metavar='PATH', default=None,
help='Socket path for Calypso (e.g. Motorola C1XX) based reader (via OsmocomBB)')
btsap_group = arg_parser.add_argument_group('Bluetooth Device (SIM Access Profile)')
btsap_group.add_argument('--bt-addr', dest='bt_addr', metavar='ADDR', default=None,
help='Bluetooth device address')
return arg_parser
@@ -237,6 +241,10 @@ def init_reader(opts, **kwargs) -> Optional[LinkBase]:
from pySim.transport.modem_atcmd import ModemATCommandLink
sl = ModemATCommandLink(
device=opts.modem_dev, baudrate=opts.modem_baud, **kwargs)
elif opts.bt_addr is not None:
print("Using Bluetooth device (SIM Access Profile)")
from pySim.transport.bt_rsap import BluetoothSapSimLink
sl = BluetoothSapSimLink(opts.bt_addr, **kwargs)
else: # Serial reader is default
print("Using serial reader interface")
from pySim.transport.serial import SerialSimLink