diff options
Diffstat (limited to 'hcid/manager.c')
-rw-r--r-- | hcid/manager.c | 53 |
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); -} |