Add set_interfaces method
authorsaerome.kim <saerome.kim@samsung.com>
Thu, 9 Mar 2017 00:18:21 +0000 (09:18 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 17 Jul 2017 02:35:36 +0000 (11:35 +0900)
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
introspection/mesh.xml
src/mesh-service-interface.c

index 67ada62..0ab372d 100644 (file)
                        <arg type="i" name="security" direction="in"/>\r
                        <arg type="u" name="result" direction="out"/>\r
                </method>\r
+               <method name="set_interfaces">\r
+                       <arg type="s" name="mesh" direction="in"/>\r
+                       <arg type="s" name="gate" direction="in"/>\r
+                       <arg type="s" name="softap" direction="in"/>\r
+                       <arg type="u" name="result" direction="out"/>\r
+               </method>\r
                <method name="get_station_info">\r
                        <arg type="a(a{sv})" name="station" direction="out"/>\r
                        <arg type="u" name="result" direction="out"/>\r
index 4367a2f..24cef81 100644 (file)
@@ -641,6 +641,29 @@ static gboolean _meshd_dbus_handle_forget_saved_mesh_network(NetMesh *object,
        return TRUE;
 }
 
+static gboolean _meshd_dbus_handle_set_interfaces(NetMesh *object,
+               GDBusMethodInvocation *invocation,
+               gchar *mesh, gchar *gate, gchar *softap,
+               gpointer user_data)
+{
+       int ret = MESHD_ERROR_NONE;
+       mesh_service *service = (mesh_service *)user_data;
+       mesh_interface_s *info = service->interface_info;
+
+       g_free(info->mesh_interface);
+       info->mesh_interface = g_strdup(mesh);
+
+       g_free(info->external_interface);
+       info->external_interface = g_strdup(gate);
+
+       g_free(info->softap_interface);
+       info->softap_interface = g_strdup(softap);
+
+       net_mesh_complete_set_interfaces(object, invocation, ret);
+
+       return TRUE;
+}
+
 static gboolean _meshd_dbus_handle_get_station_info(NetMesh *object,
                GDBusMethodInvocation *invocation)
 {
@@ -825,6 +848,8 @@ static void _meshd_dbus_on_bus_acquired(GDBusConnection *conn, const gchar *name
                        G_CALLBACK(_meshd_dbus_handle_select_saved_mesh_network), service);
        g_signal_connect(meshd_dbus_object, "handle-forget-saved-mesh-network",
                        G_CALLBACK(_meshd_dbus_handle_forget_saved_mesh_network), service);
+       g_signal_connect(meshd_dbus_object, "handle-set-interfaces",
+                       G_CALLBACK(_meshd_dbus_handle_set_interfaces), service);
        g_signal_connect(meshd_dbus_object, "handle-get-station-info",
                        G_CALLBACK(_meshd_dbus_handle_get_station_info), service);
        g_signal_connect(meshd_dbus_object, "handle-get-mpath-info",