adaptationlayer/modematadaptation/modematcontroller_dll/src/catcommandreq.cpp
changeset 0 63b37f68c1ce
child 9 8486d82aef45
equal deleted inserted replaced
-1:000000000000 0:63b37f68c1ce
       
     1 /*
       
     2 * Copyright (c) 2009 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 the License "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 #include "catcommandreq.h"
       
    21 #include "modemattrace.h"
       
    22 #include "modematclientsrv.h"
       
    23 #include "rmodematcontroller.h"
       
    24 
       
    25 CAtCommandReq::CAtCommandReq( RModemAtController* aClient,
       
    26     const TDesC8& aCommand,
       
    27     TDes8& aResponse ) :
       
    28     CActive(EPriorityNormal),
       
    29     iClient(aClient)
       
    30     {
       
    31     C_TRACE((_L("CAtCommandReq::CAtCommandReq(0x%x, 0x%x, 0x%x) "), aClient, &aCommand, &aResponse));
       
    32     DUMP_MESSAGE( aCommand );
       
    33     CActiveScheduler::Add( this );
       
    34     aClient->SendReceiveATCommand( aCommand, aResponse, iStatus);
       
    35     SetActive();
       
    36     }
       
    37 
       
    38 CAtCommandReq::~CAtCommandReq() 
       
    39     {
       
    40     C_TRACE((_L("CAtCommandReq::~CAtCommandReq()")));
       
    41     Cancel();
       
    42     }
       
    43  
       
    44  void CAtCommandReq::RunL() 
       
    45     {
       
    46     C_TRACE((_L("CAtCommandReq::RunL()")));
       
    47     iClient->ATCommandResponseReceived( iStatus.Int() );
       
    48     delete this;
       
    49     }
       
    50  
       
    51 void CAtCommandReq::DoCancel() 
       
    52     {
       
    53     C_TRACE((_L("CAtCommandReq::DoCancel()")));
       
    54     iClient->SendReceiveAtCommandCancel();
       
    55     C_TRACE((_L("Status: %d"), iStatus.Int()));
       
    56     }
       
    57