bluetooth/btstack/sdp/sdpclient.cpp
changeset 48 22de2e391156
parent 0 29b1cd4cb562
equal deleted inserted replaced
35:14e279d2bbb7 48:22de2e391156
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2000-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    38 
    38 
    39 void CSdpClient::ConstructL()
    39 void CSdpClient::ConstructL()
    40 	{
    40 	{
    41 	iBoundSAP=iL2CAP.NewSAPL(KSockSeqPacket);
    41 	iBoundSAP=iL2CAP.NewSAPL(KSockSeqPacket);
    42 	iBoundSAP->SetNotify(this);
    42 	iBoundSAP->SetNotify(this);
       
    43 	iBoundSAP->SecurityCheck(this);
    43 	CheckForIdle(KSDPIdleTimeout*4);// No point hanging about if no one connects
    44 	CheckForIdle(KSDPIdleTimeout*4);// No point hanging about if no one connects
    44 	}
    45 	}
    45 
    46 
    46 CSdpClient* CSdpClient::NewL(CSdpProtocol& aProt, CProtocolBase& aL2CAP)
    47 CSdpClient* CSdpClient::NewL(CSdpProtocol& aProt, CProtocolBase& aL2CAP)
    47 	{
    48 	{
    90 	remote.SetBTAddr(aAddr);
    91 	remote.SetBTAddr(aAddr);
    91 	remote.SetPort(KSDPPSM);  // Always 0x01
    92 	remote.SetPort(KSDPPSM);  // Always 0x01
    92 	if(iBoundSAP->SetRemName(remote)!=KErrNone)
    93 	if(iBoundSAP->SetRemName(remote)!=KErrNone)
    93 		{
    94 		{
    94 		Panic(ESdpErrorSettingAddress);
    95 		Panic(ESdpErrorSettingAddress);
       
    96 		}
       
    97 	TPckgBuf<TBool> noSecurityRequired;
       
    98 	noSecurityRequired() = ETrue;
       
    99 	
       
   100 	if(iBoundSAP->SetOption(KSolBtSAPBase, KBTSetNoSecurityRequired, noSecurityRequired)!=KErrNone)
       
   101 		{
       
   102 		Panic(ESdpAgentErrorSettingNoSecurity);
    95 		}
   103 		}
    96 	iBoundSAP->ActiveOpen();  // Signals ConnectComplete eventually!
   104 	iBoundSAP->ActiveOpen();  // Signals ConnectComplete eventually!
    97 	}
   105 	}
    98 
   106 
    99 void CSdpClient::AddNetDbProvider(CSdpNetDbProvider& aNetDbProvider)
   107 void CSdpClient::AddNetDbProvider(CSdpNetDbProvider& aNetDbProvider)
   648 		self->iProtocol.ClientDown(*self);	// Who'll promtly delete 'self'
   656 		self->iProtocol.ClientDown(*self);	// Who'll promtly delete 'self'
   649 		}
   657 		}
   650 	return FALSE;
   658 	return FALSE;
   651 	}
   659 	}
   652 
   660 
       
   661 TInt CSdpClient::CheckPolicy(const TSecurityPolicy& /*aPolicy*/, const char* /*aDiagnostic*/)
       
   662 	{
       
   663 	return KErrNone;
       
   664 	}