summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-09-30 14:43:37 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-09-30 14:43:37 +0000
commit0f5a5a9580084a3c4e0644ef5cd75689aeb5ff40 (patch)
tree102107b86a68b251bb99aad652c2c679914f370c
parent12862715c961bf6dabce2ed4e58da58e5dfe8c6b (diff)
Fix profile descriptor problem with Samsung phones
-rw-r--r--src/sdp.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/sdp.c b/src/sdp.c
index 56c74d49..e0df7582 100644
--- a/src/sdp.c
+++ b/src/sdp.c
@@ -1529,12 +1529,24 @@ int sdp_get_profile_descs(const sdp_record_t *rec, sdp_list_t **profDescSeq)
return -1;
}
for (seq = sdpdata->val.dataseq; seq && seq->val.dataseq; seq = seq->next) {
- sdp_data_t *uuid = seq->val.dataseq;
- sdp_data_t *pVnum = seq->val.dataseq->next;
- if (uuid && pVnum) {
+ uuid_t *uuid = NULL;
+ uint16_t version = 0x100;
+
+ if (SDP_IS_UUID(seq->dtd)) {
+ uuid = &seq->val.uuid;
+ } else {
+ sdp_data_t *puuid = seq->val.dataseq;
+ sdp_data_t *pVnum = seq->val.dataseq->next;
+ if (puuid && pVnum) {
+ uuid = &puuid->val.uuid;
+ version = pVnum->val.uint16;
+ }
+ }
+
+ if (uuid != NULL) {
profDesc = (sdp_profile_desc_t *)malloc(sizeof(sdp_profile_desc_t));
- profDesc->uuid = uuid->val.uuid;
- profDesc->version = pVnum->val.uint16;
+ profDesc->uuid = *uuid;
+ profDesc->version = version;
#ifdef SDP_DEBUG
sdp_uuid_print(&profDesc->uuid);
SDPDBG("Vnum : 0x%04x\n", profDesc->version);