Skip to content

Commit c7e4e6d

Browse files
committed
NAS5G: fix NSSAI decoding, SAList and extend few bitmaps
1 parent 1cca58e commit c7e4e6d

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

pycrate_mobile/TS24501_IE.py

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -210,26 +210,35 @@ def set_val(self, val):
210210
if 'MappedHPLMNSST' in val:
211211
self[2].set_trans(False)
212212
if 'MappedHPLMNSD' in val:
213+
self[1].set_trans(False)
213214
self[3].set_trans(False)
214215
Envelope.set_val(self, val)
215216

216217
def _from_char(self, char):
217218
if self.get_trans():
218219
return
219-
l = char.len_bit()
220-
if l == 8:
220+
if self._blauto is not None:
221+
# this is required when this struct is wrapped as L_SNSSAI
222+
bl = self._blauto()
223+
else:
224+
bl = char.len_bit()
225+
if bl == 8:
221226
self[1].set_trans(True)
222227
self[2].set_trans(True)
223228
self[3].set_trans(True)
224-
elif l == 32:
229+
elif bl == 16:
230+
self[1].set_trans(True)
231+
self[2].set_trans(False)
232+
self[3].set_trans(True)
233+
elif bl == 32:
225234
self[1].set_trans(False)
226235
self[2].set_trans(True)
227236
self[3].set_trans(True)
228-
elif l == 40:
237+
elif bl == 40:
229238
self[1].set_trans(False)
230239
self[2].set_trans(False)
231240
self[3].set_trans(True)
232-
elif l >= 64:
241+
elif bl >= 64:
233242
self[1].set_trans(False)
234243
self[2].set_trans(False)
235244
self[3].set_trans(False)
@@ -1297,7 +1306,11 @@ class FGSNetFeat(Envelope):
12971306
Uint('RestrictEC', bl=2),
12981307
Uint('MCSI', bl=1),
12991308
Uint('EMCN3', bl=1), # end of octet 2
1300-
Uint('spare', bl=5),
1309+
Uint('spare', bl=1),
1310+
Uint('PR', bl=1),
1311+
Uint('RPR', bl=1),
1312+
Uint('PIV', bl=1),
1313+
Uint('NCR', bl=1),
13011314
Uint('5G-EHC-CP-CIoT', bl=1),
13021315
Uint('ATS-IND', bl=1),
13031316
Uint('5G-LCS', bl=1), # end of octet 3
@@ -1349,7 +1362,8 @@ def enable_upto(self, ind):
13491362
class FGSRegResult(Envelope):
13501363
_name = '5GSRegResult'
13511364
_GEN = (
1352-
Uint('spare', bl=2),
1365+
Uint('spare', bl=1),
1366+
Uint('DisasterRoaming', bl=1),
13531367
Uint('Emergency', bl=1),
13541368
Uint('NSSAAPerformed', bl=1),
13551369
Uint('SMSAllowed', bl=1),
@@ -2195,12 +2209,12 @@ def get_tai(self):
21952209

21962210

21972211
class SAList(Sequence):
2198-
_GEN = FGSPTAIList()
2212+
_GEN = PSAList()
21992213

22002214
def get_tai(self):
22012215
tai = set()
2202-
for tl in self:
2203-
tai.update(tl.get_tai())
2216+
for sl in self:
2217+
tai.update(sl.get_tai())
22042218
return tai
22052219

22062220

0 commit comments

Comments
 (0)