summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-09-29 12:36:08 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-09-29 12:36:08 +0200
commit50ffb97d6e4fba2498f53ae2a93aa49a55e73614 (patch)
treed1c0fcd46fbbac31341cc164ca0fc48c598d0226 /src
parentc791fde2d5cfe6fd93e1a88c47808842e7fe17a4 (diff)
Send alias update when remote name result is available
Diffstat (limited to 'src')
-rw-r--r--src/dbus-hci.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/dbus-hci.c b/src/dbus-hci.c
index 2681a750..58ec1693 100644
--- a/src/dbus-hci.c
+++ b/src/dbus-hci.c
@@ -707,7 +707,7 @@ static int found_device_req_name(struct btd_adapter *adapter)
}
error("Remote name request failed with status 0x%02x",
- rp.status);
+ rp.status);
/* if failed, request the next element */
/* remove the element from the list */
@@ -1033,8 +1033,7 @@ void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, uint8_t status,
char *name)
{
struct btd_adapter *adapter;
- char peer_addr[18];
- const char *paddr = peer_addr;
+ char srcaddr[18], dstaddr[18];
const gchar *dev_path;
int state;
@@ -1044,19 +1043,29 @@ void hcid_dbus_remote_name(bdaddr_t *local, bdaddr_t *peer, uint8_t status,
return;
}
- ba2str(peer, peer_addr);
+ ba2str(local, srcaddr);
+ ba2str(peer, dstaddr);
if (!status) {
struct btd_device *device;
- device = adapter_find_device(adapter, paddr);
+ device = adapter_find_device(adapter, dstaddr);
if (device) {
+ char alias[248];
dev_path = device_get_path(device);
dbus_connection_emit_property_changed(connection,
dev_path, DEVICE_INTERFACE,
"Name", DBUS_TYPE_STRING, &name);
+
+ if (read_device_alias(srcaddr, dstaddr,
+ alias, sizeof(alias)) < 1) {
+
+ dbus_connection_emit_property_changed(connection,
+ dev_path, DEVICE_INTERFACE,
+ "Alias", DBUS_TYPE_STRING, &name);
+ }
}
}