adaptationlayer/modematadaptation/modematcontroller_dll/src/catcommandreq.cpp
author mikaruus <mika.a.ruuskanen@nokia.com>
Wed, 21 Apr 2010 14:29:55 +0300
changeset 8 6295dc2169f3
parent 0 63b37f68c1ce
child 9 8486d82aef45
permissions -rw-r--r--
New release based on our 2010wk15 release

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
* 
* Description: 
*
*/



#include "catcommandreq.h"
#include "modemattrace.h"
#include "modematclientsrv.h"
#include "rmodematcontroller.h"

CAtCommandReq::CAtCommandReq( RModemAtController* aClient,
    const TDesC8& aCommand,
    TDes8& aResponse ) :
    CActive(EPriorityNormal),
    iClient(aClient)
    {
    C_TRACE((_L("CAtCommandReq::CAtCommandReq(0x%x, 0x%x, 0x%x) "), aClient, &aCommand, &aResponse));
    DUMP_MESSAGE( aCommand );
    CActiveScheduler::Add( this );
    aClient->SendReceiveATCommand( aCommand, aResponse, iStatus);
    SetActive();
    }

CAtCommandReq::~CAtCommandReq() 
    {
    C_TRACE((_L("CAtCommandReq::~CAtCommandReq()")));
    Cancel();
    }
 
 void CAtCommandReq::RunL() 
    {
    C_TRACE((_L("CAtCommandReq::RunL()")));
    iClient->ATCommandResponseReceived( iStatus.Int() );
    delete this;
    }
 
void CAtCommandReq::DoCancel() 
    {
    C_TRACE((_L("CAtCommandReq::DoCancel()")));
    iClient->SendReceiveAtCommandCancel();
    C_TRACE((_L("Status: %d"), iStatus.Int()));
    }