Commit: c730f68303d73f987dda829c17360a11308a046c
Parent: 2fa0703398125bc6a2aa25be05324f656ddc494f
Author: Archie Pusaka <apusaka@chromium.org>
Committer: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Date: 2020-03-03 00:13:17
Tree: 2c538458aa2b066d5e47febec9b17d65f3622e24

src/profile: Ensure class UUID matches before connecting profile According to bluetooth spec Ver 5.1, Vol 3, Part B, 4.7.2, there might be multiple service records returned in a SDP Service Search Attribute Response. Also, according to 2.5.2, the service pattern can match any UUID contained within the service record, it doesn't have to match only some specific attributes of the record. Therefore, before using the service record to connect to any profile, first we must check that the service class ID of the service record matches with whatever UUID specified in the service pattern we are looking for. This patch checks the service class ID of the records against the requested UUID whenever bt_search_service() is called and filter out the ones that don't match. For the alternative where filtering is not applied, use the method bt_search().

Diffstat

M src/device.c | 26 ++++++++- - - - - - - - - - - - - - - - - -
M src/sdp-client.c | 61 ++++++++++++++++++++++++++++++++++++++++- - - - -
M src/sdp-client.h | 3 +++

3 files changed, 67 insertions(+), 23 deletions(-)

View Full Diff | Patch