path: root/pySim-read.py
diff options
authorVadim Yanitskiy <axilirator@gmail.com>2020-05-09 21:23:37 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2020-06-02 21:51:07 +0700
commit29ca8049d6ea5fa27f1f4ea805b2e0d4888e6e24 (patch)
treec2b3da777f89512340c2796d9ae2d1ee0565ed22 /pySim-read.py
parenteb06b45d0edd7843551e78da468a4d907f906993 (diff)
Implement Generic SIM Access interface as per 3GPP TS 27.007
According to 3GPP TS 27.007, sections 8.17 and 8.18, the modem may *optionally* provide Generic and/or Restricted SIM Access to the TE (Terminal Equipment) by means of the AT commands. This basically means that a modem can act as a card reader. Generic SIM Access allows the TE to send raw PDUs in the format as described in 3GPP TS 51.011 directly to the SIM card, while Restricted SIM Access is more limited, and thus is not really interesting to us. This change implements a new transport called ModemATCommandLink, so using it a SIM card can be read and/or programmed without the need to remove it from the modem's socket. A downside of this approach is relatively slow I/O speed compared to PC/SC readers. Tested with Quectel EC20: $ ./pySim-read.py --modem-dev /dev/ttyUSB2 Change-Id: I20bc00315e2c7c298f46283852865c1416047bc6 Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
Diffstat (limited to 'pySim-read.py')
1 files changed, 8 insertions, 0 deletions
diff --git a/pySim-read.py b/pySim-read.py
index df21531..e49a907 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -53,6 +53,14 @@ def parse_options():
help="Which PC/SC reader number for SIM access",
+ parser.add_option("--modem-device", dest="modem_dev", metavar="DEV",
+ help="Serial port of modem for Generic SIM Access (3GPP TS 27.007)",
+ default=None,
+ )
+ parser.add_option("--modem-baud", dest="modem_baud", type="int", metavar="BAUD",
+ help="Baudrate used for modem's port [default: %default]",
+ default=115200,
+ )
parser.add_option("--osmocon", dest="osmocon_sock", metavar="PATH",
help="Socket path for Calypso (e.g. Motorola C1XX) based reader (via OsmocomBB)",