aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2021-09-17 13:22:32 +0200
committerPhilipp Maier <pmaier@sysmocom.de>2021-09-29 15:41:42 +0200
commit48e1b90eb883c5a124c8475298ff4344ec9e6623 (patch)
tree670b82d4140e649e638d07fc6afd4cf9487343cb
parent8bf2125a19eacf74a6abb45a2c5fdcbb770e5c4c (diff)
card_handler: make reader (sl) operations optional.
The constructor gets an sl object on initalization. The card handler will then carry out the reader operation wait_for_card(). In cases where an mechanically automated card reader is used it may be useful to go without those operations and let the caller carry out the appropriate reader operations. So Lets make the sl object optional for the CardHandlerAuto class. If it is not present, simply do not carry out the pre programmed reader operation. Change-Id: I0f793aec51751b7c7b87d55b66326cce9970274e Related: SYS#5617
-rw-r--r--pySim/card_handler.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pySim/card_handler.py b/pySim/card_handler.py
index ef1b071..385c55e 100644
--- a/pySim/card_handler.py
+++ b/pySim/card_handler.py
@@ -94,7 +94,8 @@ class CardHandlerAuto:
def get(self, first = False):
print("Ready for Programming: Transporting card into the reader-bay...")
self.__exec_cmd(self.cmds['get'])
- self.sl.connect()
+ if self.sl:
+ self.sl.connect()
def error(self):
print("Programming failed: Transporting card to the error-bin...")