laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/38193?usp=email )
Change subject: runtime: add new API functions to get the record len and file size ......................................................................
runtime: add new API functions to get the record len and file size
We have an API function to get the number of records, let's now also add API functions to get the record length and the overall size of the currently selected file.
Related: OS#5714 Change-Id: Ica7811c04161d8098b40c7219ed6b939df716cfd --- M pySim/runtime.py 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved
diff --git a/pySim/runtime.py b/pySim/runtime.py index b903ccb..898008e 100644 --- a/pySim/runtime.py +++ b/pySim/runtime.py @@ -211,6 +211,12 @@ def selected_file_num_of_rec(self) -> Optional[int]: return self.selected_file_fcp['file_descriptor'].get('num_of_rec')
+ def selected_file_record_len(self) -> Optional[int]: + return self.selected_file_fcp['file_descriptor'].get('record_len') + + def selected_file_size(self) -> Optional[int]: + return self.selected_file_fcp.get('file_size') + def get_cwd(self) -> CardDF: """Obtain the current working directory.