OSDN Git Service

Do SDP when HSP connection opened by remote.
authorSatheesh Kumar Pallemoni <palsat@codeaurora.org>
Thu, 4 Aug 2016 12:14:11 +0000 (17:44 +0530)
committerLinux Build Service Account <lnxbuild@localhost>
Wed, 24 Aug 2016 14:10:09 +0000 (08:10 -0600)
When HSP connection opened by Remote do SDP, So that AG could find out
whether remote supports remote volume control feature.

CRs-Fixed: 1052230
Change-Id: I6441142fcdebcd9f2b652f90e0d8d592dea3db3d

bta/ag/bta_ag_sdp.c

index 9c87211..1f8ca5c 100644 (file)
@@ -326,7 +326,8 @@ BOOLEAN bta_ag_sdp_find_attr(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK service)
     }
     else
     {
-        return result;
+        uuid = UUID_SERVCLASS_HEADSET_HS;
+        p_scb->peer_version = 0x0100;   /* Default version */
     }
 
     /* loop through all records we found */
@@ -463,10 +464,21 @@ void bta_ag_do_disc(tBTA_AG_SCB *p_scb, tBTA_SERVICE_MASK service)
             num_uuid = 2;
         }
     }
-    /* HSP acceptor; no discovery */
+    /* HSP acceptor; get features */
     else
     {
-        return;
+       attr_list[0] = ATTR_ID_SERVICE_CLASS_ID_LIST;
+       attr_list[1] = ATTR_ID_PROTOCOL_DESC_LIST;
+       attr_list[2] = ATTR_ID_BT_PROFILE_DESC_LIST;
+       attr_list[3] = ATTR_ID_REMOTE_AUDIO_VOLUME_CONTROL;
+       num_attr = 4;
+
+       uuid_list[0].uu.uuid16 = UUID_SERVCLASS_HEADSET;        /* Legacy from HSP v1.0 */
+       if (p_scb->hsp_version >= HSP_VERSION_1_2)
+       {
+           uuid_list[1].uu.uuid16 = UUID_SERVCLASS_HEADSET_HS;
+           num_uuid = 2;
+       }
     }
 
     /* allocate buffer for sdp database */