diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2008-01-11 11:19:00 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2008-01-11 11:19:00 +0000 |
commit | 15ed6000c87ad5a4e314afb86fb98ea8b2dd76c6 (patch) | |
tree | b3f83866a05d4b59612f3228f40ba3d6121bfed6 /audio | |
parent | 751bbec3f68b51a8db3160985b62e2d0f7ea969c (diff) |
Make sure the correct handle value gets updated when parsing HSP/HFP records
Diffstat (limited to 'audio')
-rw-r--r-- | audio/headset.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/audio/headset.c b/audio/headset.c index cef32250..73c832f2 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -696,7 +696,6 @@ static void get_record_reply(DBusPendingCall *call, void *data) struct device *device = data; struct headset *hs = device->headset; struct pending_connect *c; - unsigned int id; c = hs->pending->data; @@ -741,17 +740,23 @@ static void get_record_reply(DBusPendingCall *call, void *data) memcpy(&uuid, classes->data, sizeof(uuid)); - if (!sdp_uuid128_to_uuid(&uuid)) { + if (!sdp_uuid128_to_uuid(&uuid) || uuid.type != SDP_UUID16) { error("Not a 16 bit UUID"); goto failed_not_supported; } - id = hs->search_hfp ? HANDSFREE_SVCLASS_ID : HEADSET_SVCLASS_ID; - - if ((uuid.type == SDP_UUID32 && uuid.value.uuid32 != id) - || (uuid.type == SDP_UUID16 && uuid.value.uuid16 != id)) { - error("Service classes did not contain the expected UUID"); - goto failed_not_supported; + if (hs->search_hfp) { + if (uuid.value.uuid16 != HANDSFREE_SVCLASS_ID) { + error("Service record didn't contain the HFP UUID"); + goto failed_not_supported; + } + hs->hfp_handle = record->handle; + } else { + if (uuid.value.uuid16 != HEADSET_SVCLASS_ID) { + error("Service record didn't contain the HSP UUID"); + goto failed_not_supported; + } + hs->hsp_handle = record->handle; } if (!sdp_get_access_protos(record, &protos)) { |