laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/28770 )
Change subject: apdu/ts_102_221: SELECT: allow select of SELF
......................................................................
apdu/ts_102_221: SELECT: allow select of SELF
While in the pySim-shell, it's useful to filter the currently selected
file from the choice of available files for select, this doesn't apply
for the tracing case: It's perfectly valid for the UE to SELECT the
file that's already selected right now. The operation basically
becomes equivalent to a STATUS.
Change-Id: I1a20fb3ba70426333ac34448c6cb782c51363965
---
M pySim/apdu/ts_102_221.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/70/28770/1
diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py
index 769c38e..fb2f375 100644
--- a/pySim/apdu/ts_102_221.py
+++ b/pySim/apdu/ts_102_221.py
@@ -66,7 +66,7 @@
# iterate to next element in path
continue
else:
- sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT'])
+ sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT','SELF'])
if file_hex in sels:
if self.successful:
#print("\tSELECT %s" % sels[file_hex])
@@ -80,7 +80,7 @@
elif mode == 'df_ef_or_mf_by_file_id':
if len(self.cmd_data) != 2:
raise ValueError('Expecting a 2-byte FID')
- sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT'])
+ sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT','SELF'])
file_hex = b2h(self.cmd_data)
if file_hex in sels:
if self.successful:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28770
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1a20fb3ba70426333ac34448c6cb782c51363965
Gerrit-Change-Number: 28770
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/28767 )
Change subject: apdu/ts_102_221: Fix SELECT of 3f00
......................................................................
apdu/ts_102_221: Fix SELECT of 3f00
In order to be able to explicitly select the MF via 3f00,
we need to pass the 'MF' to get_selectables(), so the record
is included in the list of selectable files from the current
working directory.
Change-Id: I27085896142fe547a6e93e01e63e59bbc65c8b8a
---
M pySim/apdu/ts_102_221.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/67/28767/1
diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py
index 0ca6702..3597db8 100644
--- a/pySim/apdu/ts_102_221.py
+++ b/pySim/apdu/ts_102_221.py
@@ -63,9 +63,10 @@
lchan.selected_adf = sels['ADF.USIM']
lchan.selected_file = lchan.selected_adf
#print("\tSELECT CUR_ADF %s" % lchan.selected_file)
+ # iterate to next element in path
continue
else:
- sels = lchan.selected_file.get_selectables(['FIDS'])
+ sels = lchan.selected_file.get_selectables(['FIDS','MF'])
if file_hex in sels:
if self.successful:
#print("\tSELECT %s" % sels[file_hex])
@@ -73,12 +74,13 @@
else:
#print("\tSELECT %s FAILED" % sels[file_hex])
pass
+ # iterate to next element in path
continue
logger.warning('SELECT UNKNOWN FID %s (%s)' % (file_hex, '/'.join([b2h(x) for x in path])))
elif mode == 'df_ef_or_mf_by_file_id':
if len(self.cmd_data) != 2:
raise ValueError('Expecting a 2-byte FID')
- sels = lchan.selected_file.get_selectables(['FIDS'])
+ sels = lchan.selected_file.get_selectables(['FIDS','MF'])
file_hex = b2h(self.cmd_data)
if file_hex in sels:
if self.successful:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28767
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I27085896142fe547a6e93e01e63e59bbc65c8b8a
Gerrit-Change-Number: 28767
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/28765 )
Change subject: filesystem.py: Make CardDF.get_selectables() respect the flags
......................................................................
filesystem.py: Make CardDF.get_selectables() respect the flags
All other get_selectables() understand a flag like 'FIDS' to request
only the hexadecimal FIDs and not the file names. However, the
CardEF.get_selectables() ignored those flags and unconditionally
returned the names.
Change-Id: Icdc37cae3eecd36d167da76c30224b9d48c844fd
---
M pySim/filesystem.py
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/65/28765/1
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 598121b..886a48d 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -541,8 +541,10 @@
"""
# global selectable names + those of the parent DF
sels = super().get_selectables(flags)
- sels.update(
- {x.name: x for x in self.parent.children.values() if x != self})
+ if flags == [] or 'FIDS' in flags:
+ sels.update({x.fid: x for x in self.parent.children.values() if x.fid and x != self})
+ if flags == [] or 'FNAMES' in flags:
+ sels.update({x.name: x for x in self.parent.children.values() if x.name and x != self})
return sels
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28765
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Icdc37cae3eecd36d167da76c30224b9d48c844fd
Gerrit-Change-Number: 28765
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/28762 )
Change subject: pySim-trace: Support SELECT with empty response body
......................................................................
pySim-trace: Support SELECT with empty response body
If the modem/UE doesn't ask for the FCP to be returned, a SELECT
can exit with 9000 and no response body. Don't crash in that case.
Change-Id: I66788717bec921bc54575e60f3f81adc80584dbc
---
M pySim/apdu/ts_102_221.py
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/28762/1
diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py
index 9ecc2c9..e5455d0 100644
--- a/pySim/apdu/ts_102_221.py
+++ b/pySim/apdu/ts_102_221.py
@@ -95,7 +95,9 @@
# decode the SELECT response
if self.successful:
self.file = lchan.selected_file
- return lchan.selected_file.decode_select_response(self.rsp_dict['body'])
+ if 'body' in self.rsp_dict:
+ # not every SELECT is asking for the FCP in response...
+ return lchan.selected_file.decode_select_response(self.rsp_dict['body'])
return None
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28762
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I66788717bec921bc54575e60f3f81adc80584dbc
Gerrit-Change-Number: 28762
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
fixeria has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmocom-bb/+/28761 )
Change subject: trx_toolkit: do not auto power on/off child MS Transceivers
......................................................................
trx_toolkit: do not auto power on/off child MS Transceivers
By default, powering on/off a parent transceiver (child_idx=0) will
automatically power on/off its child transceivers (if any). This
behavior is desirable for the BTS, but not for the MS Transceivers.
Additional MS Transceivers are going to be used by ttcn3-bts-test
for spawning multiple DCCH components in parallel. We don't want
situations when one component powers off transceivers of the other
DCCH components - they must be independent.
Change-Id: I0cd6bac616273bed0e246ad48edc44fff484c589
---
M src/target/trx_toolkit/fake_trx.py
M src/target/trx_toolkit/transceiver.py
2 files changed, 12 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/61/28761/1
diff --git a/src/target/trx_toolkit/fake_trx.py b/src/target/trx_toolkit/fake_trx.py
index 5bfc956..0daecb4 100755
--- a/src/target/trx_toolkit/fake_trx.py
+++ b/src/target/trx_toolkit/fake_trx.py
@@ -409,7 +409,7 @@
self.append_trx(self.argv.bts_addr, self.argv.bts_base_port, name = "BTS")
# Init TRX instance for BB
- self.append_trx(self.argv.bb_addr, self.argv.bb_base_port, name = "MS")
+ self.append_trx(self.argv.bb_addr, self.argv.bb_base_port, name = "MS", child_mgt = False)
# Additional transceivers (optional)
if self.argv.trx_list is not None:
diff --git a/src/target/trx_toolkit/transceiver.py b/src/target/trx_toolkit/transceiver.py
index 168d3db..385c38d 100644
--- a/src/target/trx_toolkit/transceiver.py
+++ b/src/target/trx_toolkit/transceiver.py
@@ -65,8 +65,9 @@
(trx_2) ctrl=5705, data=5706.
...
- As soon as the first transceiver is powered on / off,
- all child transceivers are also powered on / off.
+ By default, powering on/off a parent transceiver (child_idx=0) will
+ automatically power on/off its child transceivers (if any). This
+ behavior can be disabled by setting "child_mgt" param to False.
== Clock distribution (optional)
@@ -126,6 +127,7 @@
self.bind_addr = bind_addr
self.base_port = base_port
self.child_idx = kwargs.get("child_idx", 0)
+ self.child_mgt = kwargs.get("child_mgt", True)
# Meta info
self.name = kwargs.get("name", None)
@@ -222,8 +224,13 @@
return None
def power_event_handler(self, poweron: bool) -> None:
- # Update self and child transceivers
- for trx in [self, *self.child_trx_list.trx_list]:
+ # If self.child_mgt is True, automatically power on/off children
+ if self.child_mgt and self.child_idx == 0:
+ trx_list = [self, *self.child_trx_list.trx_list]
+ else:
+ trx_list = [self]
+ # Update self and optionally child transceivers
+ for trx in trx_list:
trx.running = poweron
if not poweron:
trx.disable_fh()
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/28761
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I0cd6bac616273bed0e246ad48edc44fff484c589
Gerrit-Change-Number: 28761
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange