diff --git a/mesh/mesh.c b/mesh/mesh.c
index 0f3c3c9..8db83b7 100644
--- a/mesh/mesh.c
+++ b/mesh/mesh.c
return NULL;
}
+static struct l_dbus_message *leave_call(struct l_dbus *dbus,
+ struct l_dbus_message *msg,
+ void *user_data)
+{
+ uint64_t token;
+
+ l_debug("Leave");
+
+ if (!l_dbus_message_get_arguments(msg, "t", &token))
+ return dbus_error(msg, MESH_ERROR_INVALID_ARGS, NULL);
+
+ node_remove(node_find_by_token(token));
+
+ return l_dbus_message_new_method_return(msg);
+}
+
static void setup_network_interface(struct l_dbus_interface *iface)
{
l_dbus_interface_method(iface, "Join", 0, join_network_call, "",
"oa(ya(qa{sv}))", "ot", "node",
"configuration", "app", "token");
- /* TODO: Implement Leave method */
+ l_dbus_interface_method(iface, "Leave", 0, leave_call, "", "t",
+ "token");
}
bool mesh_dbus_init(struct l_dbus *dbus)