summaryrefslogtreecommitdiffstats
path: root/binding
diff options
context:
space:
mode:
Diffstat (limited to 'binding')
-rw-r--r--binding/network-api.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/binding/network-api.c b/binding/network-api.c
index f6b08d0..f2c3c7a 100644
--- a/binding/network-api.c
+++ b/binding/network-api.c
@@ -266,7 +266,7 @@ static void network_manager_signal_callback(
const gchar *path = NULL;
const gchar *key = NULL;
const gchar *basename;
- json_object *jresp = NULL, *jobj, *jprop;
+ json_object *jarray = NULL, *jresp = NULL, *jobj, *jprop;
struct afb_event *event = NULL;
GVariantIter *array;
gboolean is_config, ret;
@@ -326,7 +326,9 @@ static void network_manager_signal_callback(
} else if (!g_strcmp0(signal_name, "ServicesChanged")) {
- jresp = json_object_new_array();
+ jresp = json_object_new_object();
+ jarray = json_object_new_array();
+ json_object_object_add(jresp, "values", jarray);
g_variant_get(parameters, "(a(oa{sv})ao)", &array1, &array2);
@@ -363,7 +365,7 @@ static void network_manager_signal_callback(
json_object_object_add(jobj, "properties",
jprop);
- json_object_array_add(jresp, jobj);
+ json_object_array_add(jarray, jobj);
}
while (g_variant_iter_loop(array2, "o", &path)) {
@@ -379,7 +381,7 @@ static void network_manager_signal_callback(
json_object_object_add(jobj, "action",
json_object_new_string("removed"));
- json_object_array_add(jresp, jobj);
+ json_object_array_add(jarray, jobj);
}
g_variant_iter_free(array2);