tsrc/public/basic/btengapitest/inc/btapidiscovery.h
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BTAPIDISCOVERY_H
       
    21 #define BTAPIDISCOVERY_H
       
    22 
       
    23 #include <e32cmn.h>
       
    24 #include <btengdiscovery.h>
       
    25 
       
    26 #include "testobserver.h"
       
    27 
       
    28 /**
       
    29 *  Class for testing BT engine API
       
    30 */
       
    31 NONSHARABLE_CLASS ( CBTApiDiscovery ): public CBase, public MBTEngSdpResultReceiver
       
    32     {
       
    33     public:  // Constructors and destructor
       
    34 
       
    35 	/**
       
    36 	* Two-phased constructor.
       
    37 	*/
       
    38 	static CBTApiDiscovery* NewL(MBTTestObserver& aObserver);
       
    39 
       
    40 	/**
       
    41 	* Destructor.
       
    42 	*/
       
    43 	virtual ~CBTApiDiscovery();
       
    44 	
       
    45 	TInt SearchRemoteDeviceL();
       
    46     TInt RegisterSdpRecord();
       
    47     TInt DeleteSdpRecord();
       
    48     TInt RemoteSdpQueryL( TBTDevAddr& aAddr );
       
    49     TInt ParseSdpAttrValues();
       
    50 
       
    51     private:
       
    52 
       
    53 	/** from MBTEngSdpResultReceiver  */
       
    54     void ServiceSearchComplete( const RSdpRecHandleArray& aResult, 
       
    55                                          TUint aTotalRecordsCount, TInt aErr );
       
    56     void AttributeSearchComplete( TSdpServRecordHandle aHandle, 
       
    57                                            const RSdpResultArray& aAttr, 
       
    58                                            TInt aErr );
       
    59     void ServiceAttributeSearchComplete( TSdpServRecordHandle aHandle, 
       
    60                                                   const RSdpResultArray& aAttr, 
       
    61                                                   TInt aErr );
       
    62     void DeviceSearchComplete( CBTDevice* aDevice, TInt aErr );
       
    63     
       
    64 	/**
       
    65 	* C++ default constructor.
       
    66 	*/
       
    67 	CBTApiDiscovery( MBTTestObserver& aObserver );
       
    68 
       
    69     /**
       
    70 	* By default Symbian 2nd phase constructor is private.
       
    71 	*/
       
    72 	void ConstructL();
       
    73 
       
    74     private:
       
    75 
       
    76     MBTTestObserver& iObserver;
       
    77 	CBTEngDiscovery* iBTEngDiscovery;
       
    78     CActiveSchedulerWait iWaiter;
       
    79     TInt iError;
       
    80     CBTDevice* iRemoteDevice;
       
    81     TSdpServRecordHandle iHandle1;
       
    82     TSdpServRecordHandle iHandle2;
       
    83     RSdpResultArray iSdpResults;
       
    84     };
       
    85 
       
    86 #endif      // BTAPIDISCOVERY_H
       
    87 
       
    88 // End of File