bluetoothengine/btaudioman/inc/basrvaccfwconn.h
changeset 0 f63038272f30
equal deleted inserted replaced
-1:000000000000 0:f63038272f30
       
     1 /*
       
     2 * Copyright (c) 2005-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:  
       
    15 *                This class communicates with Nokia "Accessory Framework" 
       
    16 *                to, e.g. get permission to attach/detach a remote bluetooth
       
    17 *                device and also recieves requests to open/close audio connections.
       
    18 *  Version     : %version:  1.2.4 %
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 #ifndef BTACC_FW_CONNECTION_H
       
    24 #define BTACC_FW_CONNECTION_H
       
    25 
       
    26 //  INCLUDES
       
    27 #include <e32base.h>        // Declaration of CActive
       
    28 #include <AccessoryServer.h> 
       
    29 #include <AccessoryBTControl.h>
       
    30 #include "BTAccFwIf.h"
       
    31 
       
    32 /**
       
    33 *  CBTSession class represent session on server side
       
    34 *
       
    35 */
       
    36 NONSHARABLE_CLASS(CBasrvAccfwConn) : public CBasrvAccfwIf
       
    37                                            
       
    38 {
       
    39 public:  // Constructors and destructor
       
    40 
       
    41     /**
       
    42     * Constructor.
       
    43     */
       
    44     static CBasrvAccfwIf* NewL();
       
    45 
       
    46     /**
       
    47     * Destructor.
       
    48     */
       
    49     ~CBasrvAccfwConn();
       
    50 
       
    51 public: // from BTAccFwIf
       
    52 
       
    53     /**
       
    54     * 
       
    55     * @param
       
    56     * return     
       
    57     */
       
    58     virtual void CompleteReq(TBool aUse);
       
    59 
       
    60     /**
       
    61     * Request Accessory Framework to attach accessory
       
    62     * @param    aBDAddr BT Device Address of accessory to be attached
       
    63     * @param     aStatus Success status of the operation.
       
    64     * return     success code of request to attach accessory
       
    65     */
       
    66     virtual void AttachAccessory(const TBTDevAddr& aBDAddr, TRequestStatus& aStatus);
       
    67     
       
    68     
       
    69     /**
       
    70     * Request Accessory Framework to cancel attach accessory
       
    71     * @param    aBDAddr BT Device Address of accessory to be attached
       
    72     * return     success code of request to attach accessory
       
    73     */
       
    74     virtual void CancelAttachAccessory(const TBTDevAddr& aBDAddr);
       
    75     
       
    76     /**
       
    77     * Request Accessory Framework to detatch accessory
       
    78     * @param    aBDAddr BT Device Address of accessory to be attached
       
    79     * @param     aStatus Success status of the operation.
       
    80     * return     None.
       
    81     */
       
    82     virtual void DetatchAccessory(const TBTDevAddr& aBDAddr, TRequestStatus& aStatus);
       
    83     
       
    84     /**
       
    85     * Register for notification when audio link is required to be opened.
       
    86     * @param aStatus                Success status of the operation.
       
    87     * @return                       None.
       
    88     */
       
    89     virtual void NotifyBTAudioLinkOpenReq(TBTDevAddr& aBDAddress, TRequestStatus& aStatus, TAccAudioType& aType );
       
    90 
       
    91     /**
       
    92     * Register for notification when audio link is required to be closed.
       
    93     * @param aStatus                Success status of the operation.
       
    94     * @return                       None.
       
    95     */
       
    96     virtual void NotifyBTAudioLinkCloseReq(TBTDevAddr& aBDAdress, TRequestStatus& aStatus, TAccAudioType& aType ); 
       
    97 
       
    98     /**
       
    99     * Cancel registeration for notification when audio link is required to be opened.
       
   100     * @param aStatus                Success status of the operation.
       
   101     * @return                       None.
       
   102     */
       
   103     virtual void CancelNotifyBTAudioLinkOpenReq();
       
   104 
       
   105     /**
       
   106     * Cancel registeration for notification when audio link is required to be closed.
       
   107     * @param aStatus                Success status of the operation.
       
   108     * @return                       None.
       
   109     */
       
   110     virtual void CancelNotifyBTAudioLinkCloseReq(); 
       
   111 
       
   112     /**
       
   113     * Informs that the audio connection open operation has completed.
       
   114     * @param aStatus                Success status of the operation.
       
   115     * @return                       None.
       
   116     */
       
   117     virtual void AudioConnectionOpenCompleteL( const TBTDevAddr& aBDAddress,
       
   118                                       TInt aResp, TInt aLatency = 0 );
       
   119 
       
   120     /**
       
   121     * Informs that the audio connection close operation has completed.
       
   122     * @param aStatus                Success status of the operation.
       
   123     * @return                       None.
       
   124     */
       
   125     virtual void AudioConnectionCloseCompleteL( const TBTDevAddr& aBDAddress, 
       
   126                                         TInt aResp );
       
   127 
       
   128     /**
       
   129     * Notifies the DOS that an audio connection to the currently connected
       
   130     * accessory has been opened.
       
   131     * @param aBDAddress             BT hardware address of the accessory.
       
   132     * @return                       None.
       
   133     */
       
   134     virtual void NotifyAudioLinkOpenL( const TBTDevAddr& aBDAddress, TAccAudioType aType );
       
   135 
       
   136     /**
       
   137     * Notifies the DOS that the audio connection to the currently connected
       
   138     * accessory has been closed.
       
   139     * @param aBDAddress             BT hardware address of the accessory.
       
   140     * @return                       None.
       
   141     */
       
   142     virtual void NotifyAudioLinkCloseL( const TBTDevAddr& aBDAddress, TAccAudioType aType );
       
   143 
       
   144         /**
       
   145     * Requests Accessory Framework to disable NREC
       
   146     * @param aBDAddress             BT hardware address of the accessory.
       
   147     * @return                       None.
       
   148     */
       
   149     virtual TInt DisableNREC(const TBTDevAddr& aBDAddress); 
       
   150     
       
   151 private: // New Functions
       
   152 
       
   153     /**
       
   154     * C++ default constructor.
       
   155     */
       
   156     CBasrvAccfwConn();
       
   157     
       
   158     /**
       
   159     * 2nd Phase Construction
       
   160     */
       
   161     void ConstructL();
       
   162     
       
   163 
       
   164 private: // Data
       
   165 
       
   166     RAccessoryServer iAccessoryServerSession;
       
   167     RAccessoryBTControl    iAccessoryBTControlSession;
       
   168 
       
   169 };
       
   170 
       
   171 #endif      // BTACC_FW_CONNECTION_H
       
   172 
       
   173 // End of File