diff options
-rw-r--r-- | build-aux/qmi-codegen/VariableString.py | 10 | ||||
-rw-r--r-- | data/qmi-service-dms.json | 11 |
2 files changed, 11 insertions, 10 deletions
diff --git a/build-aux/qmi-codegen/VariableString.py b/build-aux/qmi-codegen/VariableString.py index a127eb7..faa2085 100644 --- a/build-aux/qmi-codegen/VariableString.py +++ b/build-aux/qmi-codegen/VariableString.py @@ -49,17 +49,17 @@ class VariableString(Variable): self.is_fixed_size = False # Variable-length strings in heap self.needs_dispose = True - # Strings which are given as the full value of a TLV will NOT have a - # length prefix - if 'type' in dictionary and dictionary['type'] == 'TLV': - self.length_prefix_size = 0 - elif 'size-prefix-format' in dictionary: + if 'size-prefix-format' in dictionary: if dictionary['size-prefix-format'] == 'guint8': self.length_prefix_size = 8 elif dictionary['size-prefix-format'] == 'guint16': self.length_prefix_size = 16 else: raise ValueError('Invalid size prefix format (%s): not guint8 or guint16' % dictionary['size-prefix-format']) + # Strings which are given as the full value of a TLV and which don't have + # a explicit 'size-prefix-format' will NOT have a length prefix + elif 'type' in dictionary and dictionary['type'] == 'TLV': + self.length_prefix_size = 0 else: # Default to UINT8 self.length_prefix_size = 8 diff --git a/data/qmi-service-dms.json b/data/qmi-service-dms.json index 39cde82..2f8a186 100644 --- a/data/qmi-service-dms.json +++ b/data/qmi-service-dms.json @@ -564,11 +564,12 @@ "service" : "DMS", "id" : "0x0032", "version" : "1.3", - "input" : [ { "name" : "Activation Code", - "id" : "0x01", - "mandatory" : "yes", - "type" : "TLV", - "format" : "string" } ], + "input" : [ { "name" : "Activation Code", + "id" : "0x01", + "mandatory" : "yes", + "type" : "TLV", + "format" : "string", + "size-prefix-format" : "guint8" } ], "output" : [ { "common-ref" : "Operation Result" } ] }, // ********************************************************************************* |