diff options
author | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2023-08-17 13:06:54 -0700 |
---|---|---|
committer | Ayush Garg <ayush.garg@samsung.com> | 2024-01-05 19:04:03 +0530 |
commit | 896799b60f3491cc60888b1a8abc20142b931ef6 (patch) | |
tree | 30a4792e2f1b6b9b883d36c555d5dead597d57f1 | |
parent | 9dbeccca61ac96fb915e70a5d643a45b86b76bb6 (diff) | |
download | bluez-896799b60f3491cc60888b1a8abc20142b931ef6.tar.gz bluez-896799b60f3491cc60888b1a8abc20142b931ef6.tar.bz2 bluez-896799b60f3491cc60888b1a8abc20142b931ef6.zip |
profile: Remove probe_on_discover
The concept of probing not connected devices is already supported when
loading devices from storage, so drivers shall already be capabable of
handling such a thing as there are dedicated callbacks to indicate when
there is a new connection in the form of .accept callback.
-rw-r--r-- | src/device.c | 33 | ||||
-rw-r--r-- | src/profile.h | 5 |
2 files changed, 13 insertions, 25 deletions
diff --git a/src/device.c b/src/device.c index 5f92caaf..807cf6ee 100644 --- a/src/device.c +++ b/src/device.c @@ -6486,17 +6486,13 @@ static bool device_match_profile(struct btd_device *device, struct btd_profile *profile, GSList *uuids) { - if (profile->remote_uuid == NULL) - return false; + GSList *l; - /* Don't match if device was just discovered, is temporary, and the - * profile don't have probe_on_discover flag set. - */ - if (device->temporary && !profile->probe_on_discover) + if (profile->remote_uuid == NULL) return false; - if (g_slist_find_custom(uuids, profile->remote_uuid, - bt_uuid_strcmp) == NULL) { + l = g_slist_find_custom(uuids, profile->remote_uuid, bt_uuid_strcmp); + if (!l) { #ifdef TIZEN_BT_HID_DEVICE_ENABLE if (strcmp(profile->name, "hid-device") == 0) return true; @@ -7744,8 +7740,15 @@ static struct btd_service *probe_service(struct btd_device *device, * accept connections. */ #ifndef TIZEN_FEATURE_BLUEZ_MODIFY - if (profile->auto_connect && profile->accept) - device_set_auto_connect(device, TRUE); + if (profile->auto_connect && profile->accept) { + /* If temporary mark auto_connect as disabled so when the + * device is connected it attempts to enable it. + */ + if (device->temporary) + device->disable_auto_connect = TRUE; + else + device_set_auto_connect(device, TRUE); + } #endif return service; @@ -7846,8 +7849,6 @@ void device_probe_profiles(struct btd_device *device, GSList *uuids) goto add_uuids; } - DBG("Probing profiles for device %s", addr); - btd_profile_foreach(dev_probe, &d); add_uuids: @@ -10290,9 +10291,6 @@ void btd_device_add_uuid(struct btd_device *device, const char *uuid) GSList *uuid_list; char *new_uuid; - if (g_slist_find_custom(device->uuids, uuid, bt_uuid_strcmp)) - return; - new_uuid = g_strdup(uuid); uuid_list = g_slist_append(NULL, new_uuid); @@ -10300,11 +10298,6 @@ void btd_device_add_uuid(struct btd_device *device, const char *uuid) g_free(new_uuid); g_slist_free(uuid_list); - - store_device_info(device); - - g_dbus_emit_property_changed(dbus_conn, device->path, - DEVICE_INTERFACE, "UUIDs"); } static sdp_list_t *read_device_records(struct btd_device *device) diff --git a/src/profile.h b/src/profile.h index 55a60c79..02291c1b 100644 --- a/src/profile.h +++ b/src/profile.h @@ -33,11 +33,6 @@ struct btd_profile { */ bool experimental; - /* Indicates the profile needs to be probed when the remote_uuid is - * discovered. - */ - bool probe_on_discover; - int (*device_probe) (struct btd_service *service); void (*device_remove) (struct btd_service *service); |