return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}
+static void append_technology_structs(DBusMessageIter *iter, void *user_data)
+{
+ __connman_technology_list_struct(iter);
+}
+
static DBusMessage *get_technologies(DBusConnection *conn,
DBusMessage *msg, void *data)
{
DBusMessage *reply;
- DBusMessageIter iter, array;
DBG("");
if (reply == NULL)
return NULL;
- dbus_message_iter_init_append(reply, &iter);
-
- dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
- DBUS_STRUCT_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_OBJECT_PATH_AS_STRING
- DBUS_TYPE_ARRAY_AS_STRING
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING
- DBUS_TYPE_VARIANT_AS_STRING
- DBUS_DICT_ENTRY_END_CHAR_AS_STRING
- DBUS_STRUCT_END_CHAR_AS_STRING, &array);
-
- __connman_technology_list_struct(&array);
-
- dbus_message_iter_close_container(&iter, &array);
+ __connman_dbus_append_objpath_dict_array(reply,
+ append_technology_structs, NULL);
return reply;
}
.idle_state = idle_state,
};
+static void append_service_structs(DBusMessageIter *iter, void *user_data)
+{
+ __connman_service_list_struct(iter);
+}
+
static DBusMessage *get_services(DBusConnection *conn,
DBusMessage *msg, void *data)
{
DBusMessage *reply;
- DBusMessageIter iter, array;
reply = dbus_message_new_method_return(msg);
if (reply == NULL)
return NULL;
- dbus_message_iter_init_append(reply, &iter);
-
- dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
- DBUS_STRUCT_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_OBJECT_PATH_AS_STRING
- DBUS_TYPE_ARRAY_AS_STRING
- DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING
- DBUS_TYPE_STRING_AS_STRING
- DBUS_TYPE_VARIANT_AS_STRING
- DBUS_DICT_ENTRY_END_CHAR_AS_STRING
- DBUS_STRUCT_END_CHAR_AS_STRING, &array);
-
- __connman_service_list_struct(&array);
-
- dbus_message_iter_close_container(&iter, &array);
+ __connman_dbus_append_objpath_dict_array(reply,
+ append_service_structs, NULL);
return reply;
}