bluetoothengine/btaudioman/src/basrvsdpquery.cpp
branchRCL_3
changeset 6 6a29d5ad0713
parent 2 0b192a3a05a4
equal deleted inserted replaced
2:0b192a3a05a4 6:6a29d5ad0713
    65     iServiceAttrs.Reset();
    65     iServiceAttrs.Reset();
    66     TBTSdpAttrInt SF;        //TBTSupportedFeature SF; 
    66     TBTSdpAttrInt SF;        //TBTSupportedFeature SF; 
    67     SF.iAttrValue = 0;
    67     SF.iAttrValue = 0;
    68     SF.iUUID = KAudioSinkUUID;  
    68     SF.iUUID = KAudioSinkUUID;  
    69     SF.iAttrID = KSdpAttrIdSupportedFeatures;        
    69     SF.iAttrID = KSdpAttrIdSupportedFeatures;        
    70     iServiceAttrs.Append(SF); // Advanced Audio Distribution Profile - BT Stereo Audio
    70     iServiceAttrs.AppendL(SF); // Advanced Audio Distribution Profile - BT Stereo Audio
    71     
    71     
    72     SF.iUUID = 0x111e;   // HFP
    72     SF.iUUID = 0x111e;   // HFP
    73     SF.iAttrID = KSdpAttrIdSupportedFeatures;
    73     SF.iAttrID = KSdpAttrIdSupportedFeatures;
    74     iServiceAttrs.Append(SF); // BT Handsfree Profile - BT Mono Audio
    74     iServiceAttrs.AppendL(SF); // BT Handsfree Profile - BT Mono Audio
    75     
    75     
    76     SF.iUUID = 0x1108;   // HSP
    76     SF.iUUID = 0x1108;   // HSP
    77     SF.iAttrID = 0x0302;  // Atti id of remote volume control
    77     SF.iAttrID = 0x0302;  // Atti id of remote volume control
    78     iServiceAttrs.Append(SF); // BT Headset Profile - BT Mono Audio 
    78     iServiceAttrs.AppendL(SF); // BT Headset Profile - BT Mono Audio 
    79 
    79 
    80     SF.iUUID = KAVRemoteControlTargetUUID;
    80     SF.iUUID = KAVRemoteControlTargetUUID;
    81     SF.iAttrID = KSdpAttrIdSupportedFeatures;
    81     SF.iAttrID = KSdpAttrIdSupportedFeatures;
    82     iServiceAttrs.Append(SF);  // Audio Video Remote Control Profile
    82     iServiceAttrs.AppendL(SF);  // Audio Video Remote Control Profile
    83     
    83     
    84     SF.iUUID = KAVRemoteControlTargetUUID;
    84     SF.iUUID = KAVRemoteControlTargetUUID;
    85     SF.iAttrID = KSdpAttrIdBluetoothProfileDescriptorList;
    85     SF.iAttrID = KSdpAttrIdBluetoothProfileDescriptorList;
    86     iServiceAttrs.Append(SF);  // Audio Video Remote Control Profile, to find out avrcp 1.4 support    
    86     iServiceAttrs.AppendL(SF);  // Audio Video Remote Control Profile, to find out avrcp 1.4 support    
    87 
    87 
    88     
    88     
    89     /*****************************************************
    89     /*****************************************************
    90      *   Series 60 Customer
    90      *   Series 60 Customer
    91      *   You may want to consider modifying the following
    91      *   You may want to consider modifying the following
    98     // not find a value.
    98     // not find a value.
    99     //
    99     //
   100     TUUID serviceUuid = TUUID((0x00005555),(0x00001000),(0x80000002),(0xEE000001)); // model number
   100     TUUID serviceUuid = TUUID((0x00005555),(0x00001000),(0x80000002),(0xEE000001)); // model number
   101     SF.iUUID = serviceUuid;  
   101     SF.iUUID = serviceUuid;  
   102     SF.iAttrID = 0x0300; // Attri id of device model number
   102     SF.iAttrID = 0x0300; // Attri id of device model number
   103     iServiceAttrs.Append(SF); 
   103     iServiceAttrs.AppendL(SF); 
   104     iCursor = 0;
   104     iCursor = 0;
   105     iTolerateSdpError = aTolerateSdpError;
   105     iTolerateSdpError = aTolerateSdpError;
   106     iSdpAgent = CSdpAgent::NewL(*this, iAddr);
   106     iSdpAgent = CSdpAgent::NewL(*this, iAddr);
   107     iSdpSearchPattern = CSdpSearchPattern::NewL();
   107     iSdpSearchPattern = CSdpSearchPattern::NewL();
   108     DoNextServiceRecordRequestL();
   108     DoNextServiceRecordRequestL();
   132     {
   132     {
   133     switch (aActive.RequestId())
   133     switch (aActive.RequestId())
   134         {
   134         {
   135         case ECreateView:
   135         case ECreateView:
   136             {
   136             {
       
   137             // if we're called with iResponse != NULL we're leaking memory.
       
   138             __ASSERT_ALWAYS(!iResponse, User::Invariant());
       
   139             
   137             iResponse = NULL;
   140             iResponse = NULL;
   138             if (aActive.iStatus > KErrNone)
   141             if (aActive.iStatus > KErrNone)
   139                 {
   142                 {
   140     		    iResponse = CBTRegistryResponse::NewL(iReg);	
   143                 TRAP_IGNORE( iResponse = CBTRegistryResponse::NewL(iReg) ); 
   141     		    aActive.SetRequestId(EGetResponse);    
   144                 if (iResponse)
   142     		    iResponse->Start(aActive.iStatus);
   145                     {
   143         	    aActive.GoActive();
   146                     aActive.SetRequestId(EGetResponse);    
       
   147                     iResponse->Start(aActive.iStatus);
       
   148                     aActive.GoActive();
       
   149                     }
   144                 }
   150                 }
   145             else
   151             else
   146                 {
   152                 {
   147                 QueryCompleteL(KErrNone);
   153                 QueryCompleteL(KErrNone);
   148                 }
   154                 }
   170 	}
   176 	}
   171 
   177 
   172 void CBasrvSdpQuery::QueryCompleteL(TInt aErr)
   178 void CBasrvSdpQuery::QueryCompleteL(TInt aErr)
   173     {
   179     {
   174     iSdpAgent->Cancel();
   180     iSdpAgent->Cancel();
       
   181 
   175     delete iSdpAgent;
   182     delete iSdpAgent;
   176     iSdpAgent = NULL;
   183     iSdpAgent = NULL;
       
   184 
   177     delete iSdpSearchPattern;
   185     delete iSdpSearchPattern;
   178     iSdpSearchPattern = NULL;
   186     iSdpSearchPattern = NULL;
       
   187 
   179     TBTDeviceClass cod = TBTDeviceClass();
   188     TBTDeviceClass cod = TBTDeviceClass();
   180 	if ( iResponse && iResponse->Results().Count() > 0 )
   189 	if ( iResponse && iResponse->Results().Count() > 0 )
   181     	{
   190     	{
   182     	cod = (iResponse->Results())[0]->DeviceClass();
   191     	cod = (iResponse->Results())[0]->DeviceClass();
   183     	}
   192     	}
       
   193 	delete iResponse;
       
   194 	iResponse = NULL;
       
   195 	
   184     if (!aErr)
   196     if (!aErr)
   185         {
   197         {
   186         TAccInfo info;
   198         TAccInfo info;
   187         MakeAccInfo(info);
   199         MakeAccInfo(info);
   188         iQuerier.GetAccInfoCompletedL(aErr, &info, &cod);
   200         iQuerier.GetAccInfoCompletedL(aErr, &info, &cod);