summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build-aux/mbim-codegen/ObjectList.py6
-rw-r--r--data/mbim-service-basic-connect.json4
2 files changed, 10 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:
diff --git a/data/mbim-service-basic-connect.json b/data/mbim-service-basic-connect.json
index eb5a8b4..eaf50a9 100644
--- a/data/mbim-service-basic-connect.json
+++ b/data/mbim-service-basic-connect.json
@@ -1,6 +1,10 @@
[
// *********************************************************************************
+ { "type" : "Service",
+ "name" : "Basic Connect" },
+
+ // *********************************************************************************
{ "name" : "Device Caps",
"service" : "Basic Connect",
"type" : "Command",