summaryrefslogtreecommitdiffstats
path: root/hcid/manager.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-08-23 10:12:37 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-08-23 10:12:37 +0000
commit8af5664021b471e769b93a345f451f9a20b08ca8 (patch)
tree0ae7610eb71af7a62d5ba89c1392776a83d89e40 /hcid/manager.c
parentf205cd06dc4e9da2c1d5109e570008d7d80b8380 (diff)
Trigger the service classes update through a callback
Diffstat (limited to 'hcid/manager.c')
-rw-r--r--hcid/manager.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/hcid/manager.c b/hcid/manager.c
index a5588c4b..8e0652cc 100644
--- a/hcid/manager.c
+++ b/hcid/manager.c
@@ -329,56 +329,3 @@ void set_default_adapter(int new_default)
{
default_adapter_id = new_default;
}
-
-void update_class_of_device(void)
-{
- struct hci_dev_list_req *dl;
- struct hci_dev_req *dr;
- int i, sk;
-
- sk = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI);
- if (sk < 0)
- return;
-
- dl = g_malloc0(HCI_MAX_DEV * sizeof(*dr) + sizeof(*dl));
-
- dl->dev_num = HCI_MAX_DEV;
- dr = dl->dev_req;
-
- if (ioctl(sk, HCIGETDEVLIST, dl) < 0) {
- close(sk);
- g_free(dl);
- return;
- }
-
- dr = dl->dev_req;
-
- for (i = 0; i < dl->dev_num; i++, dr++) {
- struct hci_dev_info di;
- uint8_t value, cls[3];
- int dd;
-
- if (hci_devinfo(dr->dev_id, &di) < 0)
- continue;
-
- if (hci_test_bit(HCI_RAW, &di.flags))
- continue;
-
- if (get_device_class(di.dev_id, cls) < 0)
- continue;
-
- dd = hci_open_dev(di.dev_id);
- if (dd < 0)
- continue;
-
- value = get_service_classes(&di.bdaddr);
-
- set_service_classes(dd, cls, value);
-
- hci_close_dev(dd);
- }
-
- g_free(dl);
-
- close(sk);
-}