bthci/bthci2/hctl/interface/hctluartbase.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2006-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 /**
       
    17  @file
       
    18  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef HCTLUARTBASE_H
       
    23 #define HCTLUARTBASE_H
       
    24 
       
    25 #include <bluetooth/hci/hctlbase.h>
       
    26 #include <bluetooth/hci/hctlinterface.h>
       
    27 #include <bluetooth/hardresetinitiator.h>
       
    28 #include <d32comm.h>
       
    29 
       
    30 class MHCTLChannelObserver;
       
    31 class MHCTLDataObserver;
       
    32 class MHCTLEventObserver;
       
    33 class MControllerStateObserver;
       
    34 class RBtBusDevComm;
       
    35 
       
    36 /**
       
    37 An implementation of a HCTL Plugin, for use as a base class
       
    38 for UART based HCTL implementations.
       
    39 
       
    40 This class directly implements the interfaces MHCTLInterface. It 
       
    41 "exports" through the CHCTLBase::GetInterface function.
       
    42 
       
    43 
       
    44 This class is intended to be derived from.
       
    45 */
       
    46 class CHCTLUartBase : public CHCTLBase,
       
    47 					  public MHCTLInterface,
       
    48 					  public MHardResetInitiator
       
    49     {
       
    50 public:
       
    51 	enum TPowerControlDetectionMode
       
    52 		{
       
    53 		EPwrCtrlModeNone 	= 0x00,
       
    54 		EPwrCtrlCTSTimedLow = 0x01,
       
    55 		};
       
    56 
       
    57 public:
       
    58 	IMPORT_C ~CHCTLUartBase(); 
       
    59 
       
    60 protected:
       
    61 	IMPORT_C CHCTLUartBase();
       
    62 	IMPORT_C virtual TBool CheckHardwareConnected();
       
    63 	IMPORT_C void BaseConstructL(const TDesC& aIniFileName);
       
    64 	
       
    65 protected:
       
    66 	IMPORT_C TAny* Interface(TUid aUid);
       
    67 	IMPORT_C void SetPortBaudRateL(TUint32 aBaudRate);
       
    68 	/**
       
    69 	Accessor method for the port
       
    70 	*/
       
    71 	IMPORT_C RBusDevComm& Port();
       
    72 	
       
    73 	// Getter for iPowerCtrlMode
       
    74 	IMPORT_C CHCTLUartBase::TPowerControlDetectionMode PowerCtrlMode() const;
       
    75 
       
    76 private:
       
    77 	void OpenPortL(TUint aPortNo);
       
    78 	void ScanAndOpenPortL(TUint aStartingPortNo);
       
    79 
       
    80 	virtual void PortOpenedL() = 0;
       
    81 
       
    82 protected: 
       
    83 	// unowned
       
    84 	MHCTLChannelObserver* iChannelObserver;
       
    85 	MHCTLDataObserver* iDataObserver;
       
    86 	MHCTLEventObserver* iEventObserver;
       
    87 	MControllerStateObserver* iControllerStateObserver;
       
    88 
       
    89 private:
       
    90 	// owned
       
    91 	RBtBusDevComm* 				iPort;
       
    92 	TPowerControlDetectionMode	iPowerCtrlMode;
       
    93 	TUint32						iPadding;
       
    94     };
       
    95 
       
    96 #endif // HCTLUARTBASE_H