*/
#include "connman.hpp"
-#include "signal_callback.hpp"
#include <settingsd/glib_traits.hpp>
#include <settingsd/unique_ptr.hpp>
*/
#include "connman_manager.hpp"
-#include "signal_callback.hpp"
#include <settingsd/response_callback.hpp>
#include <settingsd/dbus_signal_callback.hpp>
+++ /dev/null
-/**
- * @file signal_callback.cpp
- *
- * @brief Connman signal callback.
- *
- * @author Ossama Othman @<ossama.othman@@intel.com@>
- *
- * @copyright @par
- * Copyright 2013 Intel Corporation All Rights Reserved.
- * @par
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- * @par
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- * @par
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA
- */
-
-#include "signal_callback.hpp"
-
-#include <settingsd/event_callback.hpp>
-
-#include <json-glib/json-glib.h>
-
-
-void
-on_connman_signal(GDBusConnection * /* connection */,
- char const * /* sender_name */,
- char const * object_path,
- char const * interface_name,
- char const * signal_name,
- GVariant * parameters,
- gpointer user_data)
-{
- using ivi::settings::event_callback;
- event_callback * const e = static_cast<event_callback *>(user_data);
-
- // Send event to clients.
-
- /**
- * @todo Fix type == nullptr.
- */
- e->send_event(
- object_path,
- interface_name,
- signal_name,
- [parameters](JsonBuilder * builder)
- {
- // Serialize the changed services into a JSON tree.
- // The ServicesChanged signal parameters are:
- //
- // array{object, dict}, array{object})
- //
- // where "object" is the D-Bus object path, and "dict" is a
- // dictionary of object-specific properties. The first
- // parameter is list of changed services. The second is a
- // list of removed services.
-
- /**
- * @todo Can @c json_gvariant_serialize() ever return a
- * @c nullptr?
- */
- JsonNode * const services = json_gvariant_serialize(parameters);
-
- json_builder_set_member_name(builder, "value");
- json_builder_add_value(builder, services);
-
- // No need to free the JsonNode. The builder will take
- // ownership of it.
- });
-}
-
-
-// Local Variables:
-// mode:c++
-// c-basic-offset:2
-// indent-tabs-mode: nil
-// End:
+++ /dev/null
-/**
- * @file signal_callback.hpp
- *
- * @brief Connman signal callback.
- *
- * @author Ossama Othman @<ossama.othman@@intel.com@>
- *
- * @copyright @par
- * Copyright 2013 Intel Corporation All Rights Reserved.
- * @par
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License.
- * @par
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- * @par
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301 USA
- */
-
-#ifndef IVI_SETTINGS_CONNMAN_SIGNAL_CALLBACK_HPP
-#define IVI_SETTINGS_CONNMAN_SIGNAL_CALLBACK_HPP
-
-#include <gio/gio.h>
-
-
-extern "C"
-void on_connman_signal(GDBusConnection * connection,
- char const * sender_name,
- char const * object_path,
- char const * interface_name,
- char const * signal_name,
- GVariant * parameters,
- gpointer user_data);
-
-#endif /* IVI_SETTINGS_CONNMAN_SIGNAL_CALLBACK_HPP */
-
-
-// Local Variables:
-// mode:c++
-// c-basic-offset:2
-// indent-tabs-mode: nil
-// End:
}
}
-void
-ivi::settings::technology::connect(JsonReader * reader,
- response_callback response)
-{
- char const * service_path = nullptr;
- if (json_reader_read_member(reader, "value")) {
- service_path = json_reader_get_string_value(reader);
- }
- json_reader_end_member(reader);
-
- /// @todo Refactor malformed JSON request handling code.
- if (service_path != nullptr) {
- // This call must bump the ref count on the reader!
- // The response_callback should be copied, too!
- if (manager_.register_connect_data(service_path,
- reader,
- response)) {
- service s(service_path,
- connman_.connection(),
- event_callback_);
-
- // This connect() method call should not return until the
- // service is fully connected.
- s.connect(response);
- } else {
- response.send_error(std::string("Connection already pending: ")
- + service_path);
- }
- } else {
- response.send_error(
- "Malformed " + technology_ + " connect request value.");
->>>>>>> Incremental commit.
- }
-}
-
GVariant *
ivi::settings::technology::get_property(char const * name,
GVariantType const * type,