bluetooth/btstack/sdp/sdp.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2000-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef SDP_H
       
    17 #define SDP_H
       
    18 
       
    19 #include <es_prot.h>
       
    20 #include <bttypes.h>
       
    21 
       
    22 #include "secman.h"
       
    23 #include "btsockettimer.h"
       
    24 #include <es_prot_internal.h>
       
    25 
       
    26 class CBTProtocolFamily;
       
    27 class CSdpClient;
       
    28 class CSdpNetDbProvider;
       
    29 class CServProviderBase;
       
    30 
       
    31 /**
       
    32 	The SDP Protocol class.
       
    33 
       
    34 	This is the singleton object created by ESOCK to provide access to all
       
    35 	the SDP NetDb service.
       
    36 	Currently supports only client mode -- i.e. query but not register.
       
    37 **/
       
    38 
       
    39 NONSHARABLE_CLASS(CSdpProtocol) : public CBluetoothProtocolBase
       
    40 	{
       
    41 public:
       
    42 	// Create ourselves
       
    43 	static CSdpProtocol* NewL(CBTSecMan& aSecMan, RBTControlPlane& aControlPlane, CBTCodServiceMan& aCodMan);
       
    44 	
       
    45 	// From CProtocolBase
       
    46 	// Factories
       
    47 	CNetDBProvdBase* NewNetDatabaseL();
       
    48 	
       
    49 	void Close();
       
    50 	void Open();
       
    51 	void CloseNow();
       
    52 
       
    53 	// From ProtocolManager before all binding.
       
    54 	void InitL(TDesC &aTag);
       
    55 	// From Protocol Manager - after all binding
       
    56 	void StartL();	
       
    57 	// From Protocol Manager
       
    58 	void BindToL(CProtocolBase* aProtocol);
       
    59 
       
    60 	virtual TInt BearerConnectComplete(const TBTDevAddr& aAddr, CServProviderBase* aSSP);
       
    61 
       
    62 	// Query functions
       
    63 	void Identify(TServerProtocolDesc* aProtocolDesc)const;	
       
    64 	static void ProtocolIdentity(TServerProtocolDesc* aDesc);	
       
    65 
       
    66 	// Sdp specific functions
       
    67 	void GetClient(CSdpNetDbProvider& aNetDbProvider);
       
    68 	void ClientDown(CSdpClient& aClient);
       
    69 
       
    70 private:
       
    71 	// Functions
       
    72 	CSdpProtocol(CBTSecMan& aSecMan, RBTControlPlane& aControlPlane, CBTCodServiceMan& aCodMan);
       
    73 	~CSdpProtocol();
       
    74 
       
    75 	CSdpClient* FindClient(const TBTDevAddr& aAddr);
       
    76 	void TryToClose();
       
    77 
       
    78 private:
       
    79 	// Data members
       
    80 	TBool				iClosePending;
       
    81 	TDblQue<CSdpClient> iClients;   // All the Clients
       
    82 	};
       
    83 
       
    84 
       
    85 #endif