summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-08-24 01:49:26 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-08-24 01:49:26 +0000
commit0e8c93725dbdc6ce76ca48da92f9d15b2a706111 (patch)
tree795d666e798dfa0926a2680584380fbfc59bd786 /hcid
parenteb4d49890ca8a4d8f567e81fdf82b6903d30f326 (diff)
Update extended inquiry response when service class changes
Diffstat (limited to 'hcid')
-rw-r--r--hcid/device.c26
-rw-r--r--hcid/hcid.h1
-rw-r--r--hcid/main.c2
3 files changed, 29 insertions, 0 deletions
diff --git a/hcid/device.c b/hcid/device.c
index c80f5875..ffdb2711 100644
--- a/hcid/device.c
+++ b/hcid/device.c
@@ -366,6 +366,32 @@ int stop_adapter(uint16_t dev_id)
return 0;
}
+int update_adapter(uint16_t dev_id)
+{
+ struct hci_dev *dev;
+ int dd;
+
+ ASSERT_DEV_ID;
+
+ dev = &devices[dev_id];
+
+ if (dev->ignore)
+ return 0;
+
+ dd = hci_open_dev(dev_id);
+ if (dd < 0) {
+ error("Can't open device hci%d",
+ dev_id, strerror(errno), errno);
+ return -errno;
+ }
+
+ update_ext_inquiry_response(dd, dev);
+
+ hci_close_dev(dd);
+
+ return 0;
+}
+
int get_device_address(uint16_t dev_id, char *address, size_t size)
{
struct hci_dev *dev;
diff --git a/hcid/hcid.h b/hcid/hcid.h
index 4e96afe4..b096d264 100644
--- a/hcid/hcid.h
+++ b/hcid/hcid.h
@@ -160,6 +160,7 @@ int add_adapter(uint16_t dev_id);
int remove_adapter(uint16_t dev_id);
int start_adapter(uint16_t dev_id);
int stop_adapter(uint16_t dev_id);
+int update_adapter(uint16_t dev_id);
int get_device_address(uint16_t dev_id, char *address, size_t size);
int get_device_class(uint16_t dev_id, uint8_t *class);
diff --git a/hcid/main.c b/hcid/main.c
index 413cc75d..44a25160 100644
--- a/hcid/main.c
+++ b/hcid/main.c
@@ -287,6 +287,8 @@ void update_service_classes(const bdaddr_t *bdaddr, uint8_t value)
set_service_classes(dd, cls, value);
hci_close_dev(dd);
+
+ update_adapter(di.dev_id);
}
g_free(dl);