aboutsummaryrefslogtreecommitdiffstats
path: root/pySim/apdu_source/gsmtap.py
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2024-02-04 22:44:59 +0100
committerHarald Welte <laforge@osmocom.org>2024-02-05 09:52:58 +0100
commit528d9225100724a928b71d2974775adc8754fd89 (patch)
tree67cf76a2f19d600302aec12622f06258d925cff5 /pySim/apdu_source/gsmtap.py
parentc5ff0a6ab57156f88d9728fb49a2450408f6c4e9 (diff)
pylint: apdu_source/gsmtap.py
pySim/apdu_source/gsmtap.py:48:8: R1705: Unnecessary "elif" after "return", remove the leading "el" from "elif" (no-else-return) pySim/apdu_source/gsmtap.py:44:20: W0612: Unused variable 'addr' (unused-variable) pySim/apdu_source/gsmtap.py:22:0: C0411: first party import "from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order) pySim/apdu_source/gsmtap.py:23:0: C0411: first party import "from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order) pySim/apdu_source/gsmtap.py:24:0: C0411: first party import "from pySim.apdu.global_platform import ApduCommands as GpApduCommands" should be placed before "from . import ApduSource, PacketType, CardReset" (wrong-import-order) pySim/apdu_source/gsmtap.py:19:0: W0611: Unused GsmtapMessage imported from pySim.gsmtap (unused-import) Change-Id: I672e8838ebe11015863fd4fd6047181a3f184658
Diffstat (limited to 'pySim/apdu_source/gsmtap.py')
-rw-r--r--pySim/apdu_source/gsmtap.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/pySim/apdu_source/gsmtap.py b/pySim/apdu_source/gsmtap.py
index aaf97ad..bcfb66d 100644
--- a/pySim/apdu_source/gsmtap.py
+++ b/pySim/apdu_source/gsmtap.py
@@ -16,12 +16,14 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-from pySim.gsmtap import GsmtapMessage, GsmtapSource
-from . import ApduSource, PacketType, CardReset
+from pySim.gsmtap import GsmtapSource
from pySim.apdu.ts_102_221 import ApduCommands as UiccApduCommands
from pySim.apdu.ts_31_102 import ApduCommands as UsimApduCommands
from pySim.apdu.global_platform import ApduCommands as GpApduCommands
+
+from . import ApduSource, PacketType, CardReset
+
ApduCommands = UiccApduCommands + UsimApduCommands + GpApduCommands
class GsmtapApduSource(ApduSource):
@@ -41,16 +43,16 @@ class GsmtapApduSource(ApduSource):
self.gsmtap = GsmtapSource(bind_ip, bind_port)
def read_packet(self) -> PacketType:
- gsmtap_msg, addr = self.gsmtap.read_packet()
+ gsmtap_msg, _addr = self.gsmtap.read_packet()
if gsmtap_msg['type'] != 'sim':
raise ValueError('Unsupported GSMTAP type %s' % gsmtap_msg['type'])
sub_type = gsmtap_msg['sub_type']
if sub_type == 'apdu':
return ApduCommands.parse_cmd_bytes(gsmtap_msg['body'])
- elif sub_type == 'atr':
+ if sub_type == 'atr':
# card has been reset
return CardReset(gsmtap_msg['body'])
- elif sub_type in ['pps_req', 'pps_rsp']:
+ if sub_type in ['pps_req', 'pps_rsp']:
# simply ignore for now
pass
else: