[HID Device] Fix connection refused with PTS 90/141790/1
authorAnurag Biradar <biradar.a@samsung.com>
Thu, 6 Jul 2017 06:26:46 +0000 (11:56 +0530)
committerAnurag Biradar <biradar.a@samsung.com>
Tue, 1 Aug 2017 11:16:56 +0000 (16:46 +0530)
[Model] COMMON
[BinType] AP
[Customer] OPEN

[Issue#] N/A
[Request] Internal
[Occurrence Version] N/A

[Problem] Bluez is refusing hid device role connection from PTS
[Cause & Measure] HID Host supporting device need not register itself in SDP.
While testing with PTS, it will not register any service in SDP record and
bluez will be able to probe for hid device service for that device because
of which connection is refused by bluez.
Measure: When hid device service is not found than forcefully probe hid device
role this will make sure of hid device service for remote device. And it can
procede with further connection
[Checking Method] Activate HID Device role -> execute test case
"HID/DEV/HCE/BV-01-I" in PTS.

[Team] Bluetooth
[Developer] Anurag B
[Solution company] Samsung
[Change Type] Code Change

Change-Id: I1d51816d74b57fb06b8c876a4139bbb06196bce3

profiles/input/device.c

index b10d82d..e58efcc 100644 (file)
@@ -1529,8 +1529,12 @@ static struct input_device *find_device_role(const bdaddr_t *src,
                return NULL;
 
        service = btd_device_get_service(device, HID_DEVICE_UUID);
-       if (service == NULL)
-               return NULL;
+       if (service == NULL) {
+               DBG("Service not found, Probe Hid device profile for device");
+               /* This will make sure we have hid device service for device */
+               device_probe_profiles(device, NULL);
+               service = btd_device_get_service(device, HID_DEVICE_UUID);
+       }
 
        return btd_service_get_user_data(service);
 }