mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-23 13:58:33 +03:00
transport/pcsc: make sure reader is disconnected
Make sure that a reader is disconnected before connecting it. This will efectively prevent resource leakage in the lower PCSC layers when the reader is connected multiple times during bulk provisioning Change-Id: I266e56f2330da25c680a76f4c0ca630a38e1f61b
This commit is contained in:
@@ -56,6 +56,10 @@ class PcscSimLink(LinkBase):
|
|||||||
|
|
||||||
def connect(self):
|
def connect(self):
|
||||||
try:
|
try:
|
||||||
|
# To avoid leakage of resources, make sure the reader
|
||||||
|
# is disconnected
|
||||||
|
self.disconnect()
|
||||||
|
|
||||||
# Explicitly select T=0 communication protocol
|
# Explicitly select T=0 communication protocol
|
||||||
self._con.connect(CardConnection.T0_protocol)
|
self._con.connect(CardConnection.T0_protocol)
|
||||||
except CardConnectionException:
|
except CardConnectionException:
|
||||||
|
|||||||
Reference in New Issue
Block a user