forked from public/pysim
gsm_r: Fix decoding of EF.FN
This fixes the below exception when trying to decode records of EF.FN: EXCEPTION of type 'TypeError' occurred with message: 'unsupported operand type(s) for &: 'str' and 'int'' Change-Id: I3723a0d59f862fa818bea1622fe43a7b56c92847 Related: OS#5784
This commit is contained in:
@@ -47,10 +47,10 @@ import pySim.ts_51_011
|
|||||||
class FuncNTypeAdapter(Adapter):
|
class FuncNTypeAdapter(Adapter):
|
||||||
def _decode(self, obj, context, path):
|
def _decode(self, obj, context, path):
|
||||||
bcd = swap_nibbles(b2h(obj))
|
bcd = swap_nibbles(b2h(obj))
|
||||||
last_digit = bcd[-1]
|
last_digit = int(bcd[-1], 16)
|
||||||
return {'functional_number': bcd[:-1],
|
return {'functional_number': bcd[:-1],
|
||||||
'presentation_of_only_this_fn': last_digit & 4,
|
'presentation_of_only_this_fn': bool(last_digit & 4),
|
||||||
'permanent_fn': last_digit & 8}
|
'permanent_fn': bool(last_digit & 8)}
|
||||||
|
|
||||||
def _encode(self, obj, context, path):
|
def _encode(self, obj, context, path):
|
||||||
return 'FIXME'
|
return 'FIXME'
|
||||||
|
|||||||
Reference in New Issue
Block a user