struct l_queue *elements;
char *app_path;
char *owner;
- char *path;
+ char *obj_path;
+ struct mesh_agent *agent;
void *jconfig;
char *node_path;
uint32_t disc_watch;
l_free(node->app_path);
node->app_path = NULL;
- if (node->path) {
- l_dbus_object_remove_interface(dbus_get_bus(), node->path,
+ if (node->obj_path) {
+ l_dbus_object_remove_interface(dbus_get_bus(), node->obj_path,
MESH_NODE_INTERFACE);
- l_dbus_object_remove_interface(dbus_get_bus(), node->path,
+ l_dbus_object_remove_interface(dbus_get_bus(), node->obj_path,
MESH_MANAGEMENT_INTERFACE);
- l_free(node->path);
- node->path = NULL;
+ l_free(node->obj_path);
+ node->obj_path = NULL;
}
}
l_dbus_unregister_interface(dbus_get_bus(), MESH_MANAGEMENT_INTERFACE);
}
+bool node_is_provisioner(struct mesh_node *node)
+{
+ return node->provisioner;
+}
+
bool node_is_provisioned(struct mesh_node *node)
{
return (!IS_UNASSIGNED(node->primary));
if (!hex2str(node->uuid, sizeof(node->uuid), uuid, sizeof(uuid)))
return false;
- node->path = l_strdup_printf(BLUEZ_MESH_PATH MESH_NODE_PATH_PREFIX
+ node->obj_path = l_strdup_printf(BLUEZ_MESH_PATH MESH_NODE_PATH_PREFIX
"%s", uuid);
- if (!l_dbus_object_add_interface(dbus_get_bus(), node->path,
+ if (!l_dbus_object_add_interface(dbus_get_bus(), node->obj_path,
MESH_NODE_INTERFACE, node))
return false;
- if (!l_dbus_object_add_interface(dbus_get_bus(), node->path,
+ if (!l_dbus_object_add_interface(dbus_get_bus(), node->obj_path,
MESH_MANAGEMENT_INTERFACE, node))
return false;
&properties);
if (!agent)
goto fail;
+
+ node->agent = agent;
+
} else if (!strcmp(MESH_PROVISIONER_INTERFACE,
interface)) {
node->provisioner = true;
builder = l_dbus_message_builder_new(reply);
/* Node object path */
- l_dbus_message_builder_append_basic(builder, 'o', node->path);
+ l_dbus_message_builder_append_basic(builder, 'o', node->obj_path);
/* Array of element configurations "a*/
l_dbus_message_builder_enter_array(builder, "(ya(qa{sv}))");
return node->node_path;
}
+const char *node_get_app_path(struct mesh_node *node)
+{
+ if (!node)
+ return NULL;
+
+ return node->app_path;
+}
+
struct mesh_net *node_get_net(struct mesh_node *node)
{
return node->net;
}
+
+struct mesh_agent *node_get_agent(struct mesh_node *node)
+{
+ return node->agent;
+}
struct mesh_node *node_find_by_addr(uint16_t addr);
struct mesh_node *node_find_by_uuid(uint8_t uuid[16]);
struct mesh_node *node_find_by_token(uint64_t token);
+bool node_is_provisioner(struct mesh_node *node);
bool node_is_provisioned(struct mesh_node *node);
bool node_app_key_delete(struct mesh_net *net, uint16_t addr,
uint16_t net_idx, uint16_t idx);
uint32_t node_seq_cache(struct mesh_node *node);
const char *node_get_element_path(struct mesh_node *node, uint8_t ele_idx);
const char *node_get_owner(struct mesh_node *node);
+const char *node_get_app_path(struct mesh_node *node);
bool node_add_pending_local(struct mesh_node *node, void *info);
void node_attach_io_all(struct mesh_io *io);
void node_attach_io(struct mesh_node *node, struct mesh_io *io);
void *node_jconfig_get(struct mesh_node *node);
void node_path_set(struct mesh_node *node, char *path);
char *node_path_get(struct mesh_node *node);
+struct mesh_agent *node_get_agent(struct mesh_node *node);