Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmo-abis/+/38988?usp=email )
Change subject: Drop internal use of osmocom/abis/ipaccess.h
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/38988?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ifc9759b17a9b966cb713f7533a13f6223161a4cd
Gerrit-Change-Number: 38988
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 02 Dec 2024 06:37:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-hlr/+/38989?usp=email )
Change subject: Drop use of libosmo-abis osmocom/abis/ipaccess.h
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-hlr/+/38989?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I393cd23a09af6d1eefa68dc955415f4fe334d71b
Gerrit-Change-Number: 38989
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 02 Dec 2024 06:36:19 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-bts/+/38990?usp=email )
Change subject: Drop use of libosmo-abis osmocom/abis/ipaccess.h
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/osmo-bts/+/38990?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: Ie4540eb6f535375a1e4ddf3849602aecb6260914
Gerrit-Change-Number: 38990
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 02 Dec 2024 06:35:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Attention is currently required from: pespin.
fixeria has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-bsc/+/38991?usp=email )
Change subject: Drop use of libosmo-abis osmocom/abis/ipaccess.h
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-bsc/+/38991/comment/06d83d80_23e069bc?usp… :
PS1, Line 16: Take the chance to organize a bit better
This patch would have been easier to read if this was done separately.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/38991?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5f9daaf7789a56a08d2ec24b5e25e2e3b65b8b5b
Gerrit-Change-Number: 38991
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Mon, 02 Dec 2024 06:35:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
JPM has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/38992?usp=email )
Change subject: Handling Long APDU response
......................................................................
Handling Long APDU response
Change-Id: I3c09d4dd1ed68bb982e23c90a6762fd9c2dfdd7f
---
M pySim/transport/modem_atcmd.py
1 file changed, 22 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/92/38992/1
diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py
index e7614c0..340ed92 100644
--- a/pySim/transport/modem_atcmd.py
+++ b/pySim/transport/modem_atcmd.py
@@ -86,6 +86,8 @@
if res == b'ERROR' or res.startswith(b'+CME ERROR:'):
log.error('Command failed with result: %s', res)
break
+ if lines[-1].startswith(b'+CSIM:'): # Sequans Monarch GM02S Long APDU response is OK and then all multiple +CSIM
+ t_start = time.time() # Reset the timer on each additional +CSIM received
if time.time() - t_start >= timeout:
log.info('Command finished with timeout >= %ss', timeout)
@@ -155,22 +157,29 @@
# Send AT+CSIM command to the modem
rsp = self.send_at_cmd(cmd)
- if rsp[-1].startswith(b'+CME ERROR:'):
- raise ProtocolError('AT+CSIM failed with: %s' % str(rsp))
- if len(rsp) != 2 or rsp[-1] != b'OK':
- raise ReaderError('APDU transfer failed: %s' % str(rsp))
- rsp = rsp[0] # Get rid of b'OK'
- # Make sure that the response has format: b'+CSIM: %d,\"%s\"'
- try:
- result = re.match(b'\+CSIM: (\d+),\"([0-9A-F]+)\"', rsp)
- (_rsp_tpdu_len, rsp_tpdu) = result.groups()
- except Exception as exc:
- raise ReaderError('Failed to parse response from modem: %s' % rsp) from exc
+ # AT+CSIM works with APDU, but returns the TPDU in multiple +CSIM answers (at least Sequans does it)
+ # In that case, the answer starts with OK, and then multiple +CSIM answers
+ rsp_apdu = b''
+ for r in rsp:
+ if r.startswith(b'+CSIM:'):
+ try:
+ result = re.match(b'\+CSIM: (\d+),\"([0-9A-F]+)\"', r)
+ (_rsp_tpdu_len, _rsp_tpdu) = result.groups()
+ rsp_apdu = rsp_apdu + _rsp_tpdu
+ except Exception as exc:
+ raise ReaderError('Failed to parse response from modem: %s' % rsp) from exc
+ elif r.startswith(b'CME ERROR:'):
+ raise ProtocolError('AT+CSIM failed with: %s' % str(rsp))
+ elif r == b'OK':
+ continue
+ else:
+ raise ReaderError('APDU transfer failed: %s' % str(rsp))
+
# TODO: make sure we have at least SW
- data = rsp_tpdu[:-4].decode().lower()
- sw = rsp_tpdu[-4:].decode().lower()
+ data = rsp_apdu[:-4].decode().lower()
+ sw = rsp_apdu[-4:].decode().lower()
log.debug('Command response: %s, %s', data, sw)
return data, sw
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/38992?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I3c09d4dd1ed68bb982e23c90a6762fd9c2dfdd7f
Gerrit-Change-Number: 38992
Gerrit-PatchSet: 1
Gerrit-Owner: JPM <jean-pierre.marcotte.1(a)ens.etsmtl.ca>