From 7cb7c78ca84f9cf5872f0f907f06f04af55d9aa2 Mon Sep 17 00:00:00 2001 From: Robert Falkenberg Date: Thu, 6 May 2021 09:52:31 +0200 Subject: [PATCH] ModemATCommandLink: add/adjust some logging Change-Id: I303506a751b4a34d83c18bc097e0cfb0517ee82c --- pySim/transport/modem_atcmd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py index bb23ce92..3d39a209 100644 --- a/pySim/transport/modem_atcmd.py +++ b/pySim/transport/modem_atcmd.py @@ -71,10 +71,10 @@ class ModemATCommandLink(LinkBase): log.debug('Command finished with result: OK') break if rsp.endswith(b'ERROR\r\n'): - log.debug('Command finished with result: ERROR') + log.error('Command finished with result: ERROR') break if time.time() - t_start >= timeout: - log.debug('Command finished with timeout >= %ss', timeout) + log.info('Command finished with timeout >= %ss', timeout) break time.sleep(patience) its += 1 @@ -137,6 +137,7 @@ class ModemATCommandLink(LinkBase): # Prepare the command as described in 8.17 cmd = 'AT+CSIM=%d,\"%s\"' % (len(pdu), pdu) + log.debug('Sending command: %s', cmd) # Send AT+CSIM command to the modem # TODO: also handle +CME ERROR: @@ -155,4 +156,5 @@ class ModemATCommandLink(LinkBase): # TODO: make sure we have at least SW data = rsp_pdu[:-4].decode().lower() sw = rsp_pdu[-4:].decode().lower() + log.debug('Command response: %s, %s', data, sw) return data, sw