esim.saip.File: Suppress encoding attributes that are like template
The point of the SAIP template mechanism is to reduce the size of the encoded profile. Therefore, our encoder in the to_fileDescriptor() method should suppress generating attributes if their value is identical to that of the template (if any). Change-Id: I337ee6c7e882ec711bece17b7a0def9da36b0ad7
This commit is contained in:
@@ -216,13 +216,13 @@ class File:
|
||||
fdb_dec = {}
|
||||
pefi = {}
|
||||
spfi = 0
|
||||
if self.fid:
|
||||
if self.fid and self.fid != self.template.fid:
|
||||
fileDescriptor['fileID'] = self.fid.to_bytes(2, 'big')
|
||||
if self.sfi:
|
||||
if self.sfi and self.sfi != self.template.sfi:
|
||||
fileDescriptor['shortEFID'] = bytes([self.sfi])
|
||||
if self.df_name:
|
||||
fileDescriptor['dfName'] = self.df_name
|
||||
if self.arr:
|
||||
if self.arr and self.arr != self.template.arr.to_bytes(1):
|
||||
fileDescriptor['securityAttributesReferenced'] = self.arr
|
||||
if self.file_type in ['LF', 'CY']:
|
||||
fdb_dec['file_type'] = 'working_ef'
|
||||
|
||||
Reference in New Issue
Block a user