mirror of https://gerrit.osmocom.org/pysim
ts_31_103: finish decoder and fix encoder for EF.PCSCF
The encoder/decoder functions in class EF_PCSCF look rather unfinshed because of problems with dec_addr_tlv(), since those problems are fixed by a previous patch we can now finish the decoder function and fix the decoder as well. Change-Id: I7613b8b71624dc5802aca93163788a2a2d4ca345 Related: OS#4963
This commit is contained in:
parent
be18f2a419
commit
86b09da61d
|
@ -116,10 +116,12 @@ class EF_PCSCF(LinFixedEF):
|
||||||
def __init__(self, fid='6f09', sfid=None, name='EF.P-CSCF', desc='P-CSCF Address'):
|
def __init__(self, fid='6f09', sfid=None, name='EF.P-CSCF', desc='P-CSCF Address'):
|
||||||
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc)
|
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc)
|
||||||
def _decode_record_hex(self, raw_hex):
|
def _decode_record_hex(self, raw_hex):
|
||||||
# FIXME: this doesn't do JSON output
|
addr, addr_type = dec_addr_tlv(raw_hex)
|
||||||
return dec_addr_tlv(raw_hex)
|
return {"addr": addr, "addr_type": addr_type}
|
||||||
def _encode_record_hex(self, json_in):
|
def _encode_record_hex(self, json_in):
|
||||||
return enc_addr_tlv(json_in)
|
addr = json_in['addr']
|
||||||
|
addr_type = json_in['addr_type']
|
||||||
|
return enc_addr_tlv(addr, addr_type)
|
||||||
|
|
||||||
# TS 31.103 Section 4.2.9
|
# TS 31.103 Section 4.2.9
|
||||||
class EF_GBABP(TransparentEF):
|
class EF_GBABP(TransparentEF):
|
||||||
|
|
Loading…
Reference in New Issue