2 * @file dbus_signal_callback.cpp
4 * @brief D-Bus signal callback.
6 * @author Ossama Othman @<ossama.othman@@intel.com@>
9 * Copyright 2013 Intel Corporation All Rights Reserved.
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public
13 * License as published by the Free Software Foundation;
14 * version 2.1 of the License.
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with this library; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
24 * Boston, MA 02110-1301 USA
27 #include <settingsd/dbus_signal_callback.hpp>
28 #include <settingsd/event_callback.hpp>
30 #include <json-glib/json-glib.h>
34 ivi::settings::on_dbus_signal(GDBusConnection * /* connection */,
35 char const * /* sender_name */,
36 char const * object_path,
37 char const * interface_name,
38 char const * signal_name,
39 GVariant * parameters,
42 event_callback * const e = static_cast<event_callback *>(user_data);
44 // Send event to clients.
49 [parameters](JsonBuilder * builder)
52 * @todo Can @c json_gvariant_serialize() ever return a
55 JsonNode * const services = json_gvariant_serialize(parameters);
57 json_builder_set_member_name(builder, "value");
58 json_builder_add_value(builder, services);
60 // No need to free the JsonNode. The builder will take
69 // indent-tabs-mode: nil