- Even though App which registered HID device profile is terminated abnoramlly,
HID is still connected. If trying to connect HID again then it fails always.
- A profile of device structure & a profile registered by App are different.
A profile of device structure maintains connceted status.
- If a HID profile registered by App is removed in status of connected,
disconnect the connection of the profile intentionally.
Change-Id: Ic507032ba46e864e23c142177d9a7ba35ebe5d15
Signed-off-by: Deokhyun Kim <dukan.kim@samsung.com>
GSList *l;
l = find_service_with_profile(device->services, profile);
+#ifdef TIZEN_BT_HID_DEVICE_ENABLE
+ if (l == NULL) {
+ if (g_strcmp0(profile->local_uuid , HID_DEVICE_UUID) == 0) {
+ l = find_service_with_uuid(device->services,
+ HID_DEVICE_UUID);
+ service = l->data;
+
+ if (btd_service_get_state(service) ==
+ BTD_SERVICE_STATE_CONNECTED) {
+ int err;
+ err = btd_service_disconnect(service);
+ if (err)
+ error("error: %s", strerror(-err));
+ }
+ }
+ return;
+ }
+#else
if (l == NULL)
return;
+#endif
service = l->data;
device->services = g_slist_delete_link(device->services, l);