bluetoothengine/btsac/inc/btsacStateConnected.h
changeset 0 f63038272f30
child 1 6a1fe72036e3
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2006 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:  state Listening declaration.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_BTSACCONNECTED_H
       
    20 #define C_BTSACCONNECTED_H
       
    21 
       
    22 #include "btsacState.h"
       
    23 
       
    24 /**
       
    25  * The state Connected
       
    26  *
       
    27  *
       
    28  *  @since S60 v3.1 
       
    29  */
       
    30 	
       
    31 class CBtsacConnected : public CBtsacState, public MBtsacActiveObserver
       
    32     {
       
    33     
       
    34 public:
       
    35 
       
    36     static CBtsacConnected* NewL(CBTSAController& aParent, TBTConnType aConnType);
       
    37     
       
    38     virtual ~CBtsacConnected();
       
    39     
       
    40 private:
       
    41     
       
    42     // From base class CBtsacState
       
    43     
       
    44     /**
       
    45      * From CBtsacState
       
    46      * Entry of this state.
       
    47      */
       
    48     void EnterL();
       
    49     
       
    50     /** 
       
    51      * disconnect the connected accessory
       
    52      *
       
    53      * @since S60 v3.1
       
    54      * @param aAddr the BD address of the accessory
       
    55      * @param aStatus On completion, will contain an error code
       
    56      */
       
    57     void DisconnectL();
       
    58     
       
    59     /** 
       
    60      * From CBtsacState
       
    61      * Open audio link to BT accessory
       
    62      *
       
    63      * @since S60 v3.1
       
    64      * @param aAddr the BD address of the accessory
       
    65      * @param aStatus On completion, will contain an error code
       
    66      */
       
    67 	void OpenAudioLinkL(const TBTDevAddr& aAddr);
       
    68 	
       
    69     /** 
       
    70      * From CBtsacState
       
    71      * Cancel the outstanding connecting operation
       
    72      *
       
    73      * @since S60 v3.1
       
    74      */
       
    75     void CancelConnectL();
       
    76 
       
    77     void CancelOpenAudioLinkL();
       
    78 
       
    79    	void ConfigureL();
       
    80    	void GetCapabilitiesOfAllSEPs();
       
    81      
       
    82     // From class MInternalGavdpUser
       
    83    	void GAVDP_ConfigurationConfirm();
       
    84    	void GAVDP_BearerReady(RSocket aSocket, const TAvdtpSockAddr& aAddress);
       
    85    	void GAVDP_SEPDiscovered(const TAvdtpSEPInfo& aSEP);
       
    86    	void GAVDP_SEPDiscoveryComplete();
       
    87    	void GAVDP_SEPCapability(TAvdtpServiceCapability* aCapability); 
       
    88 	void GAVDP_SEPCapabilityComplete();	
       
    89 	void GAVDP_AbortIndication(TSEID aSEID);
       
    90 	void GAVDP_ConfigurationStartIndication(TSEID aLocalSEID, TSEID aRemoteSEID);
       
    91 	
       
    92 	/**
       
    93      * Handles the request completion event.
       
    94      *
       
    95      * @since S60 v3.1
       
    96      * @param aActive the Active Object to which the request is assigned to.
       
    97      */
       
    98 	void RequestCompletedL(CBtsacActive& aActive);
       
    99     
       
   100     /**
       
   101      * Handles the cancellation of an outstanding request.
       
   102      *
       
   103      * @since S60 v3.1
       
   104      * @param aActive the Active Object to which the request is assigned to.
       
   105      */
       
   106 	virtual void CancelRequest(CBtsacActive& aActive);
       
   107     
       
   108     void StartTimer(TTimeIntervalMicroSeconds32 aTimeout, TInt aRequestId);
       
   109     void StopTimer();
       
   110     
       
   111     void CancelActionL(TInt aError, TBTSACGavdpResetReason aGavdpReset);
       
   112     void HandleGavdpErrorL(TInt aError);
       
   113     
       
   114     void StartConfigurationL();
       
   115 
       
   116 private:    
       
   117 
       
   118     CBtsacConnected(CBTSAController& aParent, TBTConnType aConnType);
       
   119     void ConstructL();
       
   120 
       
   121 private:
       
   122 	enum TBTSACSepFound
       
   123 	    {
       
   124 	    ESEPNotInitialized,
       
   125 	    ESEPConfigure,
       
   126 	    ESEPInUse,
       
   127 	    ESEPCodecTypeNotAllowed
       
   128 	    };
       
   129 	
       
   130 	/**
       
   131      * AO for configuration timer.
       
   132      */
       
   133     CBtsacActive* iTimerActive;
       
   134     
       
   135 	/**
       
   136      * Configuration timer 
       
   137      */
       
   138     RTimer iTimer;
       
   139     
       
   140     TBool iSuitableSEPFoundAlready;
       
   141     TBTConnType iConnType; // Connection type: incoming/outgoing
       
   142     TBool iFirstConn; // used to learn if configuration should be done
       
   143     TBTSACSepFound iSEPFound;
       
   144     TInt iRemoteSEPIndex;
       
   145     TBool iBearersQuery;
       
   146     TBool iCancelConnectReq;
       
   147     TAudioOpenedBy iAudioOpenedBy;
       
   148     };
       
   149 
       
   150 #endif      // C_BTSACCONNECTED_H
       
   151