summaryrefslogtreecommitdiff
path: root/build-aux/mbim-codegen
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-05-21 16:57:06 +0200
committerAleksander Morgado <aleksander@lanedo.com>2013-05-21 17:34:07 +0200
commite73d0a50b1d78d38d36001ba70d900081630f216 (patch)
treed8bc308c8124c1822e2181253e92ed30c2c209d7 /build-aux/mbim-codegen
parenta7bacab3aaa70dccb8767e543ef6b455ddaf266e (diff)
downloadlibmbim-e73d0a50b1d78d38d36001ba70d900081630f216.tar.gz
mbim-codegen: require a 'Service' entry in the data file
Diffstat (limited to 'build-aux/mbim-codegen')
-rw-r--r--build-aux/mbim-codegen/ObjectList.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/build-aux/mbim-codegen/ObjectList.py b/build-aux/mbim-codegen/ObjectList.py
index 1aa27e4..90324fe 100644
--- a/build-aux/mbim-codegen/ObjectList.py
+++ b/build-aux/mbim-codegen/ObjectList.py
@@ -52,6 +52,7 @@ class ObjectList:
def __init__(self, objects_dictionary):
self.command_list = []
self.struct_list = []
+ self.service = ''
# Loop items in the list, creating Message objects for the messages
for object_dictionary in objects_dictionary:
@@ -59,9 +60,14 @@ class ObjectList:
self.command_list.append(Message(object_dictionary))
elif object_dictionary['type'] == 'Struct':
self.struct_list.append(Struct(object_dictionary))
+ elif object_dictionary['type'] == 'Service':
+ self.service = object_dictionary['name']
else:
raise ValueError('Cannot handle object type \'%s\'' % object_dictionary['type'])
+ if self.service == '':
+ raise ValueError('Service name not specified')
+
# Populate struct usages
for struct in self.struct_list:
for command in self.command_list: