Attention is currently required from: pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-cbc/+/34812?usp=email )
Change subject: cbc-apitool: Make character set configurable
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-cbc/+/34812?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: Ia7291238f3b0af8ff9f476fce9a7805e12821d8c
Gerrit-Change-Number: 34812
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 19 Oct 2023 07:20:42 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34813?usp=email )
Change subject: ts_31_102: Fix initialization of file size
......................................................................
ts_31_102: Fix initialization of file size
We were using positional arguments when instantiating instances
of classes like EF_5GS3GPPLOCI with non-default names/fids/...
However, we got the argument order wrong and were passing the
description string in the position of the file size, which causes
exceptions like the following from pySim-trace:
Traceback (most recent call last):
File "/home/laforge/projects/git/pysim/./pySim-trace.py", line 198, in <module>
tracer.main()
File "/home/laforge/projects/git/pysim/./pySim-trace.py", line 125, in main
inst.process(self.rs)
File "/home/laforge/projects/git/pysim/pySim/apdu/__init__.py", line 259, in process
self.processed = method(self.lchan)
File "/home/laforge/projects/git/pysim/pySim/apdu/ts_102_221.py", line 152, in process_on_lchan
if self.cmd_dict['offset'] != 0 or self.lr < self.file.size[0]:
TypeError: '<' not supported between instances of 'int' and 'str'
Let's use named initializers for any arguments after the usual "fid, sfid, name"
initial arguments.
Change-Id: I7f32c9fd01094620b68b0e54536ecc6cdbe67903
---
M pySim/ts_31_102.py
1 file changed, 33 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/13/34813/1
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index c7a58f1..5afa2ef 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -1331,10 +1331,10 @@
# I'm looking at 31.102 R16.6
EF_5GS3GPPLOCI(service=122),
EF_5GS3GPPLOCI('4f02', 0x02, 'EF.5GSN3GPPLOCI',
- '5GS non-3GPP location information', service=122),
+ desc='5GS non-3GPP location information', service=122),
EF_5GS3GPPNSC(service=122),
EF_5GS3GPPNSC('4f04', 0x04, 'EF.5GSN3GPPNSC',
- '5GS non-3GPP Access NAS Security Context', service=122),
+ desc='5GS non-3GPP Access NAS Security Context', service=122),
EF_5GAUTHKEYS(service=123),
EF_UAC_AIC(service=126),
EF_SUCI_Calc_Info(service=124),
@@ -1342,7 +1342,7 @@
EF_SUPI_NAI(service=130),
EF_Routing_Indicator(service=124),
TransparentEF('4F0B', 0x0b, 'EF.URSP',
- 'UE Route Selector Policies per PLMN', service=132),
+ desc='UE Route Selector Policies per PLMN', service=132),
EF_TN3GPPSNN(service=133),
# Rel-17 additions below
EF_CAG(service=137),
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34813?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I7f32c9fd01094620b68b0e54536ecc6cdbe67903
Gerrit-Change-Number: 34813
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: laforge.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-cbc/+/34812?usp=email )
Change subject: cbc-apitool: Make character set configurable
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/osmo-cbc/+/34812/comment/4f82e81f_18737bcf
PS1, Line 9: osmo-cbc alrady supported the transmission of UCS2 characters for quite
already
--
To view, visit https://gerrit.osmocom.org/c/osmo-cbc/+/34812?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: Ia7291238f3b0af8ff9f476fce9a7805e12821d8c
Gerrit-Change-Number: 34812
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Wed, 18 Oct 2023 18:09:29 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-cbc/+/34812?usp=email )
Change subject: cbc-apitool: Make character set configurable
......................................................................
cbc-apitool: Make character set configurable
osmo-cbc alrady supported the transmission of UCS2 characters for quite
some time. However, the cbc-apitool didn't expose this capability so
far.
Change-Id: Ia7291238f3b0af8ff9f476fce9a7805e12821d8c
Related: OS#6028
---
M contrib/cbc-apitool.py
M doc/manuals/chapters/cbc-apitool.adoc
2 files changed, 18 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-cbc refs/changes/12/34812/1
diff --git a/contrib/cbc-apitool.py b/contrib/cbc-apitool.py
index 299846a..918119f 100755
--- a/contrib/cbc-apitool.py
+++ b/contrib/cbc-apitool.py
@@ -63,7 +63,7 @@
},
'payload': {
'payload_decoded': {
- 'character_set': "gsm",
+ 'character_set': args.character_set,
#'language': 'en',
'data_utf8': args.payload_data_utf8,
#'data_utf8': "Mahlzeit1 Mahlzeit2 Mahlzeit3 Mahlzeit4 Mahlzeit5 Mahlzeit6 Mahlzeit7 Mahlzeit8"
@@ -126,6 +126,7 @@
parser_c_cbs.add_argument("--repetition-period", type=int, help='Repetition Period', default=5)
parser_c_cbs.add_argument("--num-of-bcast", type=int, help='Number of Broadcasts', default=999)
parser_c_cbs.add_argument("--payload-data-utf8", type=str, help='Payload Data in UTF8', required=True)
+ parser_c_cbs.add_argument("--character-set", type=str, help='Character Set', default="gsm", choices=["gsm","ucs2","8bit"])
parser_c_cbs.set_defaults(func=do_create_cbs)
parser_c_etws = subparsers.add_parser('create-etws', help='Create a new ETWS message')
diff --git a/doc/manuals/chapters/cbc-apitool.adoc b/doc/manuals/chapters/cbc-apitool.adoc
index 145d845..fc435a6 100644
--- a/doc/manuals/chapters/cbc-apitool.adoc
+++ b/doc/manuals/chapters/cbc-apitool.adoc
@@ -50,6 +50,8 @@
*--payload-data-utf8 PAYLOAD_DATA_UTF8*::
Payload data (typically text message) in UTF8 encoding. Will be
transcoded to 7bit GSM alphabet internally.
+*--character-set {gsm,8bit,ucs2}*::
+ Character set to be used for the message. Default: gsm
==== `create-etws` Options
--
To view, visit https://gerrit.osmocom.org/c/osmo-cbc/+/34812?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: Ia7291238f3b0af8ff9f476fce9a7805e12821d8c
Gerrit-Change-Number: 34812
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: dexter.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/34686?usp=email )
Change subject: transport: print reader device/number on init
......................................................................
Patch Set 10:
(1 comment)
Patchset:
PS10:
the problem here is that this makes sense for the normal user, but doens't make sense in our test setup. Please find a solution for that (like having some command line argument or environment variable that is set in the tests which suppresses certain non-deterministic details in the output).
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34686?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5c08995fcd55bd9bb173adc2acd9722e438a164b
Gerrit-Change-Number: 34686
Gerrit-PatchSet: 10
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 18 Oct 2023 15:09:09 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/34697?usp=email )
Change subject: transport: do not catch exceptions in init_reader
......................................................................
transport: do not catch exceptions in init_reader
We currently catch any exceptions that may occur when the card reader is
initialized. Then we print the exception string or the exception type
when no string is available. However, a failure during the reader
initialization is usually a severe problem, so a traceback would provde
a lot of helpful information to debug the issue. So lets not catch any
exceptions at this level so that we get the full backtrace.
Related: OS#6210
Change-Id: I4c4807576fe63cf71a7d33b243a3f8fea0b7ff23
---
M pySim-prog.py
M pySim-read.py
M pySim-shell.py
M pySim/transport/__init__.py
4 files changed, 37 insertions(+), 35 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim-prog.py b/pySim-prog.py
index a16928c..2911b46 100755
--- a/pySim-prog.py
+++ b/pySim-prog.py
@@ -794,8 +794,6 @@
# Init card reader driver
sl = init_reader(opts)
- if sl is None:
- exit(1)
# Create command layer
scc = SimCardCommands(transport=sl)
diff --git a/pySim-read.py b/pySim-read.py
index bafaf26..d34ddc3 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -74,8 +74,6 @@
# Init card reader driver
sl = init_reader(opts)
- if sl is None:
- exit(1)
# Create command layer
scc = SimCardCommands(transport=sl)
diff --git a/pySim-shell.py b/pySim-shell.py
index 56655ba..afc7653 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -1015,8 +1015,6 @@
# Init card reader driver
sl = init_reader(opts, proactive_handler = Proact())
- if sl is None:
- exit(1)
# Create a card handler (for bulk provisioning)
if opts.card_handler_config:
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index 0b50a4f..581f8e5 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -292,35 +292,26 @@
return arg_parser
-def init_reader(opts, **kwargs) -> Optional[LinkBase]:
+def init_reader(opts, **kwargs) -> LinkBase:
"""
Init card reader driver
"""
- sl = None # type : :Optional[LinkBase]
- try:
- if opts.pcsc_dev is not None:
- print("Using PC/SC reader interface")
- from pySim.transport.pcsc import PcscSimLink
- sl = PcscSimLink(opts.pcsc_dev, **kwargs)
- elif opts.osmocon_sock is not None:
- print("Using Calypso-based (OsmocomBB) reader interface")
- from pySim.transport.calypso import CalypsoSimLink
- sl = CalypsoSimLink(sock_path=opts.osmocon_sock, **kwargs)
- elif opts.modem_dev is not None:
- print("Using modem for Generic SIM Access (3GPP TS 27.007)")
- from pySim.transport.modem_atcmd import ModemATCommandLink
- sl = ModemATCommandLink(
- device=opts.modem_dev, baudrate=opts.modem_baud, **kwargs)
- else: # Serial reader is default
- print("Using serial reader interface")
- from pySim.transport.serial import SerialSimLink
- sl = SerialSimLink(device=opts.device,
- baudrate=opts.baudrate, **kwargs)
- return sl
- except Exception as e:
- if str(e):
- print("Card reader initialization failed with exception:\n" + str(e))
- else:
- print(
- "Card reader initialization failed with an exception of type:\n" + str(type(e)))
- return None
+ if opts.pcsc_dev is not None:
+ print("Using PC/SC reader interface")
+ from pySim.transport.pcsc import PcscSimLink
+ sl = PcscSimLink(opts.pcsc_dev, **kwargs)
+ elif opts.osmocon_sock is not None:
+ print("Using Calypso-based (OsmocomBB) reader interface")
+ from pySim.transport.calypso import CalypsoSimLink
+ sl = CalypsoSimLink(sock_path=opts.osmocon_sock, **kwargs)
+ elif opts.modem_dev is not None:
+ print("Using modem for Generic SIM Access (3GPP TS 27.007)")
+ from pySim.transport.modem_atcmd import ModemATCommandLink
+ sl = ModemATCommandLink(
+ device=opts.modem_dev, baudrate=opts.modem_baud, **kwargs)
+ else: # Serial reader is default
+ print("Using serial reader interface")
+ from pySim.transport.serial import SerialSimLink
+ sl = SerialSimLink(device=opts.device,
+ baudrate=opts.baudrate, **kwargs)
+ return sl
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34697?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I4c4807576fe63cf71a7d33b243a3f8fea0b7ff23
Gerrit-Change-Number: 34697
Gerrit-PatchSet: 2
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged