summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-01 14:54:17 -0300
committerLuiz Augusto von Dentz <luiz.dentz@indt.org.br>2008-07-28 10:31:18 -0300
commit34f8a76bd5bd24ae1a1594f4d1460df393675ec1 (patch)
tree0c65e1d8b2d34d978a1b470f661778aa0d110573
parent1ea3f7de314eb0b699cac4b80f5085666c0e6d50 (diff)
Remove BASE_PATH define.
-rw-r--r--hcid/adapter.c13
-rw-r--r--hcid/dbus-common.c17
-rw-r--r--hcid/dbus-common.h3
-rw-r--r--hcid/dbus-hci.c10
-rw-r--r--hcid/dbus-service.c31
-rw-r--r--hcid/device.c10
6 files changed, 11 insertions, 73 deletions
diff --git a/hcid/adapter.c b/hcid/adapter.c
index e79183c9..e08ab300 100644
--- a/hcid/adapter.c
+++ b/hcid/adapter.c
@@ -828,7 +828,7 @@ static DBusMessage *remove_bonding(DBusConnection *conn, DBusMessage *msg,
{
struct adapter *adapter = data;
struct device *device;
- char path[MAX_PATH_LENGTH], filename[PATH_MAX + 1];
+ char filename[PATH_MAX + 1];
char *str;
bdaddr_t src, dst;
GSList *l;
@@ -885,15 +885,6 @@ static DBusMessage *remove_bonding(DBusConnection *conn, DBusMessage *msg,
hci_close_dev(dev);
- if (paired) {
- snprintf(path, MAX_PATH_LENGTH, BASE_PATH "/hci%d",
- adapter->dev_id);
- g_dbus_emit_signal(conn, path,
- ADAPTER_INTERFACE, "BondingRemoved",
- DBUS_TYPE_STRING, &address,
- DBUS_TYPE_INVALID);
- }
-
device = adapter_find_device(adapter, address);
if (!device)
goto proceed;
@@ -1149,7 +1140,7 @@ static void create_bond_req_exit(void *user_data)
struct pending_auth_info *auth;
char path[MAX_PATH_LENGTH];
- snprintf(path, sizeof(path), "%s/hci%d", BASE_PATH, adapter->dev_id);
+ snprintf(path, sizeof(path), "/hci%d", adapter->dev_id);
debug("CreateConnection requestor exited before bonding was completed");
diff --git a/hcid/dbus-common.c b/hcid/dbus-common.c
index 99585d0a..46670e9c 100644
--- a/hcid/dbus-common.c
+++ b/hcid/dbus-common.c
@@ -193,7 +193,7 @@ void hcid_dbus_unregister(void)
return;
/* Unregister all paths in Adapter path hierarchy */
- if (!dbus_connection_list_registered(conn, BASE_PATH, &children))
+ if (!dbus_connection_list_registered(conn, "/", &children))
return;
for (i = 0; children[i]; i++) {
@@ -202,8 +202,7 @@ void hcid_dbus_unregister(void)
if (children[i][0] != 'h')
continue;
- snprintf(dev_path, sizeof(dev_path), "%s/%s", BASE_PATH,
- children[i]);
+ snprintf(dev_path, sizeof(dev_path), "/%s", children[i]);
unregister_adapter_path(dev_path);
}
@@ -222,9 +221,7 @@ void hcid_dbus_exit(void)
release_default_auth_agent();
release_services(conn);
- database_cleanup(conn, BASE_PATH);
-
- manager_cleanup(conn, BASE_PATH);
+ manager_cleanup(conn, "/");
set_dbus_connection(NULL);
@@ -245,13 +242,7 @@ int hcid_dbus_init(void)
return -1;
}
- if (!manager_init(conn, BASE_PATH))
- return -1;
-
- if (!database_init(conn, BASE_PATH))
- return -1;
-
- if (!security_init(conn, BASE_PATH))
+ if (!manager_init(conn, "/"))
return -1;
set_dbus_connection(conn);
diff --git a/hcid/dbus-common.h b/hcid/dbus-common.h
index afdf7569..8e009f70 100644
--- a/hcid/dbus-common.h
+++ b/hcid/dbus-common.h
@@ -22,9 +22,6 @@
*
*/
-#define BASE_PATH "/org/bluez"
-#define ADAPTER_PATH_INDEX 10
-
#define MAX_PATH_LENGTH 64
int str2uuid(uuid_t *uuid, const char *string);
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index c3c46193..be5ce703 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -1506,8 +1506,7 @@ void hcid_dbus_periodic_inquiry_start(bdaddr_t *local, uint8_t status)
if (!adapter->pdiscov_requestor)
adapter->discov_type &= ~RESOLVE_NAME;
- dbus_connection_emit_property_changed(connection,
- adapter->path + ADAPTER_PATH_INDEX,
+ dbus_connection_emit_property_changed(connection, adapter->path,
ADAPTER_INTERFACE, "PeriodicDiscovery",
DBUS_TYPE_BOOLEAN, &adapter->pdiscov_active);
}
@@ -1515,7 +1514,6 @@ void hcid_dbus_periodic_inquiry_start(bdaddr_t *local, uint8_t status)
void hcid_dbus_periodic_inquiry_exit(bdaddr_t *local, uint8_t status)
{
struct adapter *adapter;
- char *ptr;
/* Don't send the signal if the cmd failed */
if (status)
@@ -1527,8 +1525,6 @@ void hcid_dbus_periodic_inquiry_exit(bdaddr_t *local, uint8_t status)
return;
}
- ptr = adapter->path + ADAPTER_PATH_INDEX;
-
/* reset the discover type to be able to handle D-Bus and non D-Bus
* requests */
adapter->pdiscov_active = 0;
@@ -1554,7 +1550,7 @@ void hcid_dbus_periodic_inquiry_exit(bdaddr_t *local, uint8_t status)
/* workaround: inquiry completed is not sent when exiting from
* periodic inquiry */
if (adapter->discov_active) {
- g_dbus_emit_signal(connection, ptr,
+ g_dbus_emit_signal(connection, adapter->path,
ADAPTER_INTERFACE, "DiscoveryCompleted",
DBUS_TYPE_INVALID);
@@ -1562,7 +1558,7 @@ void hcid_dbus_periodic_inquiry_exit(bdaddr_t *local, uint8_t status)
}
/* Send discovery completed signal if there isn't name to resolve */
- dbus_connection_emit_property_changed(connection, ptr,
+ dbus_connection_emit_property_changed(connection, adapter->path,
ADAPTER_INTERFACE, "PeriodicDiscovery",
DBUS_TYPE_BOOLEAN, &adapter->discov_active);
}
diff --git a/hcid/dbus-service.c b/hcid/dbus-service.c
index d07741a3..fda7cf1b 100644
--- a/hcid/dbus-service.c
+++ b/hcid/dbus-service.c
@@ -391,30 +391,8 @@ static int service_cmp_ident(struct service *service, const char *ident)
static int unregister_service_for_connection(DBusConnection *connection,
struct service *service)
{
- DBusConnection *conn = get_dbus_connection();
-
debug("Unregistering service object: %s", service->object_path);
- if (!conn)
- goto cleanup;
-
- g_dbus_emit_signal(conn, service->object_path,
- SERVICE_INTERFACE,
- "Stopped", DBUS_TYPE_INVALID);
-
- g_dbus_emit_signal(conn, BASE_PATH, MANAGER_INTERFACE,
- "ServiceRemoved",
- DBUS_TYPE_STRING, &service->object_path,
- DBUS_TYPE_INVALID);
-
- if (!g_dbus_unregister_interface(conn,
- service->object_path, SERVICE_INTERFACE)) {
- error("D-Bus failed to unregister %s object",
- service->object_path);
- return -1;
- }
-
-cleanup:
services = g_slist_remove(services, service);
service_free(service);
@@ -638,15 +616,6 @@ int register_service(const char *ident, const char **uuids)
if (uuids)
register_uuids(ident, uuids);
- g_dbus_emit_signal(conn, BASE_PATH, MANAGER_INTERFACE,
- "ServiceAdded",
- DBUS_TYPE_STRING, &service->object_path,
- DBUS_TYPE_INVALID);
-
- g_dbus_emit_signal(conn, service->object_path,
- SERVICE_INTERFACE,
- "Started", DBUS_TYPE_INVALID);
-
return 0;
}
diff --git a/hcid/device.c b/hcid/device.c
index 66ab2dd7..7a519716 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -935,7 +935,7 @@ static DBusMessage *set_alias(DBusConnection *conn, DBusMessage *msg,
ERROR_INTERFACE ".Failed",
strerror(-ecode));
- snprintf(path, sizeof(path), "%s/hci%d", BASE_PATH, adapter->dev_id);
+ snprintf(path, sizeof(path), "/hci%d", adapter->dev_id);
g_dbus_emit_signal(conn, path,
ADAPTER_INTERFACE, "RemoteAliasChanged",
@@ -964,13 +964,7 @@ static DBusMessage *set_trust(DBusConnection *conn, DBusMessage *msg,
write_trust(&local, device->address, GLOBAL_TRUST, value);
- snprintf(path, sizeof(path), "%s/hci%d", BASE_PATH, adapter->dev_id);
-
- g_dbus_emit_signal(conn, path,
- ADAPTER_INTERFACE,
- value ? "TrustAdded" : "TrustRemoved",
- DBUS_TYPE_STRING, &device->address,
- DBUS_TYPE_INVALID);
+ snprintf(path, sizeof(path), "/hci%d", adapter->dev_id);
dbus_connection_emit_property_changed(conn, dbus_message_get_path(msg),
DEVICE_INTERFACE, "Trusted",