bluetoothengine/headsetsimulator/profiles/hspprofile/src/hspprofile.cpp
branchheadsetsimulator
changeset 60 90dbfc0435e3
equal deleted inserted replaced
59:02103bf20ee5 60:90dbfc0435e3
       
     1 /* 
       
     2  *
       
     3  * Copyright (c) <2010> Comarch S.A. and/or its subsidiary(-ies).
       
     4  * All rights reserved.
       
     5  * This component and the accompanying materials are made available
       
     6  * under the terms of the License "Eclipse Public License v1.0"
       
     7  * which accompanies this distribution, and is available
       
     8  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     9  *
       
    10  * Original Contributors:
       
    11  * Comarch S.A. - original contribution.
       
    12  *
       
    13  * Contributors:
       
    14  *
       
    15  * Description:
       
    16  *
       
    17  */
       
    18 
       
    19 #include "hspprofileplugin.h"
       
    20 #include "hspdatahandler.h"
       
    21 #include "hspsettings.h"
       
    22 #include "debug.h"
       
    23 
       
    24 CHsHSPProfile* CHsHSPProfile::NewL()
       
    25     {
       
    26     CHsHSPProfile *self = CHsHSPProfile::NewLC();
       
    27     CleanupStack::Pop( self );
       
    28     return self;
       
    29     }
       
    30 
       
    31 CHsHSPProfile* CHsHSPProfile::NewLC()
       
    32     {
       
    33     CHsHSPProfile *self = new ( ELeave ) CHsHSPProfile;
       
    34     CleanupStack::PushL( self );
       
    35     self->ContructL();
       
    36     return self;
       
    37     }
       
    38 
       
    39 CHsHSPProfile::CHsHSPProfile()
       
    40     {
       
    41 
       
    42     }
       
    43 
       
    44 void CHsHSPProfile::ContructL()
       
    45     {
       
    46     iDataHandler = CHsHSPDataHandler::NewL();
       
    47     iSettings = CHsHSPSettings::InstanceL();
       
    48     }
       
    49 
       
    50 CHsHSPProfile::~CHsHSPProfile()
       
    51     {
       
    52     if ( iDataHandler )
       
    53         {
       
    54         delete iDataHandler;
       
    55         }
       
    56     if ( iSettings )
       
    57         {
       
    58         iSettings->Release();
       
    59         }
       
    60     }
       
    61 
       
    62 void CHsHSPProfile::HandleCommandL( const TDesC8& aCommandsIn,
       
    63         TDes8& aCommandsOut, const TBool aFromAG )
       
    64     {
       
    65     TRACE_FUNC_ENTRY
       
    66 
       
    67     iDataHandler->ProcessDataL( aCommandsIn, aFromAG, aCommandsOut );
       
    68 
       
    69     TRACE_FUNC_EXIT
       
    70     }
       
    71 
       
    72 void CHsHSPProfile::HandleClientDisconnected( TInt aErr )
       
    73     {
       
    74     TRACE_FUNC_ENTRY
       
    75     iDataHandler->HandleClientDisconnected( aErr );
       
    76     TRACE_FUNC_EXIT
       
    77     }
       
    78 
       
    79 void CHsHSPProfile::HandleClientConnected( TDes8& aCommandOut )
       
    80     {
       
    81     TRACE_FUNC_ENTRY
       
    82     iDataHandler->HandleClientConnected( aCommandOut );
       
    83     TRACE_FUNC_EXIT
       
    84     }
       
    85 
       
    86 void CHsHSPProfile::HandleAcceptCallL( TDes8& aCommandOut )
       
    87     {
       
    88     TRACE_FUNC_ENTRY
       
    89 
       
    90     iDataHandler->HandleAcceptCallL( aCommandOut );
       
    91 
       
    92     TRACE_FUNC_EXIT
       
    93     }
       
    94 
       
    95 void CHsHSPProfile::HandleReleaseCallL( TDes8& aCommandOut )
       
    96     {
       
    97     TRACE_FUNC_ENTRY
       
    98 
       
    99     iDataHandler->HandleReleaseCallL( aCommandOut );
       
   100 
       
   101     TRACE_FUNC_EXIT
       
   102     }