adaptationlayer/modematadaptation/modematcontroller_exe/src/cmodematpipecontroller.cpp
author mikaruus
Tue, 19 Oct 2010 13:16:20 +0300
changeset 9 8486d82aef45
parent 8 6295dc2169f3
permissions -rw-r--r--
modemadaptation release 2010wk40
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     1
/*
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
     2
* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     3
* All rights reserved.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     8
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
     9
* Initial Contributors:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    11
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    12
* Contributors:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    13
* 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    14
* Description: 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    15
*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    16
*/
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    17
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    18
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    19
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    20
#include <iscapi.h>                 //For ISC
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    21
#include <iscnokiadefinitions.h>    //isc definitions
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    22
#include <pn_const.h>
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    23
#include <nsisi.h>
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
    24
#include <pipeisi.h>                //pipe
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
    25
#include <pipe_sharedisi.h>         //pipe
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    26
#include <tisi.h>                   //for isimessage
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    27
#include "cmodematpipecontroller.h"
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    28
#include "cmodemathandler.h"
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    29
#include <at_modemisi.h>            //redirectreq error codes
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    30
#include "modemattrace.h"
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    31
#include "cmodematsrv.h"
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    32
#include "OstTraceDefinitions.h"
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    33
#ifdef OST_TRACE_COMPILER_IN_USE
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    34
#include "cmodematpipecontrollerTraces.h"
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    35
#endif
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    36
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
    37
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    38
const TUint8 KFiller = 0;
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
    39
const TUint8 KDefaultTrId = 0;
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
    40
const TInt KLastByteIndex = 3;
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    41
const TUint8 KDpPadding = 0;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    42
const TUint8 KDialUpPort1 = 1;// from Dataport export (otherwise hard coded and incorrect)
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    43
const TUint8 KDialUpPort4 = 4;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    44
const TUint8 KDialUpPort5 = 5;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    45
const TUint8 KPepCtrlDataSize = 1;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    46
const TUint8 KPepFlowCtrlDataSize = 2;
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    47
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    48
CModemAtPipeController* CModemAtPipeController::NewL( RIscApi& aIscApi,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    49
    TUint& aObjId,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    50
    CModemAtHandler& aHandler )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    51
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    52
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_NEWL, "CModemAtPipeController::NewL" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    53
    CModemAtPipeController* self = new (ELeave) CModemAtPipeController( aIscApi,aObjId, aHandler );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    54
    CleanupStack::PushL( self );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    55
    self->ConstructL();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    56
    CleanupStack::Pop( self );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    57
    return self;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    58
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    59
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    60
void CModemAtPipeController::ConstructL()
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    61
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    62
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_CONSTRUCTL, "CModemAtPipeController::ConstructL" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    63
    C_TRACE (( _T("CModemAtPipeController::ConstructL()") ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    64
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    65
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    66
CModemAtPipeController::~CModemAtPipeController() 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    67
     {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    68
     OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_CMODEMATPIPECONTROLLER, "CModemAtPipeController::~CModemAtPipeController" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    69
     C_TRACE((_L(">>CModemAtPipeController::~CModemAtPipeController()")));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    70
     if( iSchedulerWait )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    71
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    72
        C_TRACE((_L("CModemAtPipeController::~CModemAtPipeController() iSchedulerWait->Stop")));
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    73
        OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_CMODEMATPIPECONTROLLER, "CModemAtPipeController::~CModemAtPipeController - iSchedulerWait->Stop" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    74
        iSchedulerWait->AsyncStop();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    75
        delete iSchedulerWait;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    76
        iSchedulerWait = NULL;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    77
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    78
     C_TRACE((_L("<<CModemAtPipeController::~CModemAtPipeController()")));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    79
     }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    80
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    81
CModemAtPipeController::CModemAtPipeController( RIscApi& aIscApi,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    82
    TUint& aObjId,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    83
    CModemAtHandler& aHandler ) : 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    84
    iIscApi( aIscApi ),
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    85
    iModemAtObjId( aObjId ),
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    86
    iModemAtDevId( THIS_DEVICE ),
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    87
    iDpDevId( 0 ),
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    88
    iDpObjId( 0 ),
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
    89
    iAtHandler( aHandler ),
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
    90
    iSchedulerWait( NULL )
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    91
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    92
        OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_CMODEMATPIPECONTROLLER, "CModemAtPipeController::CModemAtPipeController;aObjId=%d", aObjId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    93
        C_TRACE (( _T("CModemAtPipeController::CModemAtPipeController() obj id: 0x%x>"), aObjId ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    94
        iPipe.pipeHandle = KInvalidPipeHandle;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    95
        iPipe.firstDevId = 0;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    96
        iPipe.firstObjId = 0;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    97
        iPipe.secondDevId = 0;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    98
        iPipe.secondDevId = 0;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
    99
        iPipe.pipeState = TPipeInfo::EPipeNoPipe;
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   100
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   101
        C_TRACE (( _T("CModemAtPipeController::CModemAtPipeController()<") ));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   102
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   103
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   104
 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   105
 void CModemAtPipeController::HandleNameServiceMessage( const TIsiReceiveC& aReceivedMessage )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   106
     {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   107
     OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLENAMESERVICEMESSAGE, "CModemAtPipeController::HandleNameServiceMessage" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   108
     C_TRACE (( _T("CModemAtPipeController::HandleNameServiceMessage()") ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   109
     switch( aReceivedMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   110
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   111
        case PNS_NAME_QUERY_RESP: 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   112
            C_TRACE(_L("PNS_NAME_QUERY_RESP"));
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   113
            OstTrace0( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLENAMESERVICEMESSAGE, "CModemAtPipeController::HandleNameServiceMessage - PNS_NAME_QUERY_RESP" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   114
            HandleNameQueryResp( aReceivedMessage );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   115
            break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   116
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   117
        case PNS_NAME_ADD_IND:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   118
            C_TRACE(_L("PNS_NAME_ADD_IND"));
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   119
            OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLENAMESERVICEMESSAGE, "CModemAtPipeController::HandleNameServiceMessage - PNS_NAME_ADD_IND" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   120
            HandleNameAddInd( aReceivedMessage );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   121
            break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   122
         
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   123
        case PNS_NAME_REMOVE_IND:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   124
            C_TRACE(_L("PNS_NAME_REMOVE_IND")); 
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   125
            OstTrace0( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_HANDLENAMESERVICEMESSAGE, "CModemAtPipeController::HandleNameServiceMessage  - PNS_NAME_REMOVE_IND" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   126
            HandleNameRemoveInd( aReceivedMessage );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   127
            break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   128
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   129
        default:
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   130
            TRACE_ASSERT_ALWAYS;
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   131
            break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   132
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   133
     }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   134
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   135
 void CModemAtPipeController::HandlePipeServiceMessage( const TIsiReceiveC& aReceivedMessage)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   136
     {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   137
     OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLEPIPESERVICEMESSAGE, "CModemAtPipeController::HandlePipeServiceMessage" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   138
     OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLEPIPESERVICEMESSAGE, "CModemAtPipeController::HandlePipeServiceMessage;messageId=%d", aReceivedMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   139
     C_TRACE (( _T("CModemAtPipeController::HandlePipeServiceMessage()") ));
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   140
     C_TRACE((_L("message id: %d") , aReceivedMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) ));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   141
     switch( aReceivedMessage.Get8bit( ISI_HEADER_OFFSET_MESSAGEID ) )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   142
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   143
        case PNS_PIPE_CREATE_RESP:
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   144
            C_TRACE(_L("PNS_PIPE_CREATE_RESP"));
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   145
            OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLEPIPESERVICEMESSAGE, "CModemAtPipeController::HandlePipeServiceMessage - PNS_PIPE_CREATE_RESP" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   146
            HandlePipeCreateResp( aReceivedMessage );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   147
            break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   148
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   149
        case PNS_PIPE_REDIRECT_RESP:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   150
            C_TRACE(_L("PNS_PIPE_REDIRECT_RESP"));
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   151
            OstTrace0( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_HANDLEPIPESERVICEMESSAGE, "CModemAtPipeController::HandlePipeServiceMessage - PNS_PIPE_REDIRECT_RESP" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   152
            HandlePipeRedirectResp( aReceivedMessage );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   153
            break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   154
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   155
        case PNS_PIPE_REMOVE_RESP:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   156
            C_TRACE(_L("PNS_PIPE_REMOVE_RESP"));
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   157
            OstTrace0( TRACE_NORMAL, DUP4_CMODEMATPIPECONTROLLER_HANDLEPIPESERVICEMESSAGE, "CModemAtPipeController::HandlePipeServiceMessage - PNS_PIPE_REMOVE_RESP" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   158
            HandlePipeRemoveResp( aReceivedMessage );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   159
            break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   160
         
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   161
        case PNS_PIPE_ENABLE_RESP:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   162
            C_TRACE(_L("PNS_PIPE_ENABLE_RESP"));
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   163
            OstTrace0( TRACE_NORMAL, DUP5_CMODEMATPIPECONTROLLER_HANDLEPIPESERVICEMESSAGE, "CModemAtPipeController::HandlePipeServiceMessage - PNS_PIPE_ENABLE_RESP" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   164
            HandlePipeEnabledResp( aReceivedMessage );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   165
            break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   166
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   167
        case PNS_PEP_STATUS_IND :
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   168
            C_TRACE(_L("PNS_PEP_STATUS_IND"));
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   169
            OstTrace0( TRACE_NORMAL, DUP6_CMODEMATPIPECONTROLLER_HANDLEPIPESERVICEMESSAGE, "CModemAtPipeController::HandlePipeServiceMessage - PNS_PEP_STATUS_IND" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   170
            HandlePepStatusInd( aReceivedMessage );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   171
            break;
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   172
        
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   173
        case PNS_PEP_CTRL_RESP:
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   174
            C_TRACE(_L("PNS_PEP_CTRL_RESP"));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   175
            OstTrace0( TRACE_NORMAL, DUP7_CMODEMATPIPECONTROLLER_HANDLEPIPESERVICEMESSAGE, "CModemAtPipeController::HandlePipeServiceMessage - PNS_PEP_CTRL_RESP" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   176
            HandlePepCtrlResp( aReceivedMessage );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   177
            break;
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   178
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   179
        default:
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   180
            TRACE_ASSERT_ALWAYS;
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   181
            break;
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   182
        }
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   183
     }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   184
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   185
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   186
TBool CModemAtPipeController::MatchDataportName( TUint aName )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   187
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   188
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_MATCHDATAPORTNAME, "CModemAtPipeController::MatchDataportName" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   189
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   190
    /*
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   191
    See from dataport: 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   192
    void CDpMif::SendNameAddReqL():
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   193
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   194
        case KDpDialUpPort:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   195
        case KDpPort4:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   196
        case KDpPort5:
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   197
            {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   198
            messageData.Append( aUnit );                //name
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   199
            messageData.Append( KDpPadding );           //name
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   200
            messageData.Append( PN_PEP_TYPE_COMM );     //name
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   201
            messageData.Append( PN_PIPE );              //name
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   202
            break;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   203
    Only 3 last bytes count
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   204
    */
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   205
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_MATCHDATAPORTNAME, "CModemAtPipeController::MatchDataportName;aName=%d", aName );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   206
    C_TRACE((_L("CModemAtPipeController::MatchDataportName(): %d") , aName ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   207
    TBool ret( EFalse );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   208
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   209
    TUint dataportName1(0);
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   210
    dataportName1 = (
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   211
    ( (TUint)PN_PIPE ) | 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   212
    ( (TUint)PN_PEP_TYPE_COMM << 8 ) | 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   213
    ( KDpPadding << 16) | 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   214
    ( KDialUpPort1 << 24 ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   215
    OstTrace1( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_MATCHDATAPORTNAME, "CModemAtPipeController::MatchDataportName;dataportName1=%d", dataportName1 );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   216
    C_TRACE((_L("CModemAtPipeController::MatchDataportName(): name1 %d") , dataportName1 ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   217
    TUint dataportName4(0);
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   218
    dataportName4 = (
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   219
    ( (TUint)PN_PIPE ) | 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   220
    ( (TUint)PN_PEP_TYPE_COMM << 8 ) | 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   221
    ( KDpPadding << 16) | 
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   222
    ( KDialUpPort4 << 24 ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   223
    OstTrace1( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_MATCHDATAPORTNAME, "CModemAtPipeController::MatchDataportName;dataportName4=%d", dataportName4 );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   224
    C_TRACE((_L("CModemAtPipeController::MatchDataportName(): name4 %d") , dataportName4 ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   225
    TUint dataportName5(0);
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   226
    dataportName5 = (
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   227
    ( (TUint)PN_PIPE ) | 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   228
    ( (TUint)PN_PEP_TYPE_COMM << 8 ) | 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   229
    ( KDpPadding << 16) | 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   230
    ( KDialUpPort5 << 24 ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   231
    OstTrace1( TRACE_NORMAL, DUP4_CMODEMATPIPECONTROLLER_MATCHDATAPORTNAME, "CModemAtPipeController::MatchDataportName;dataportName5=%d", dataportName5 );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   232
    C_TRACE((_L("CModemAtPipeController::MatchDataportName(): name5 %d") , dataportName5 ) );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   233
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   234
      if( dataportName1 == aName ||
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   235
          dataportName4 == aName ||
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   236
          dataportName5 == aName )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   237
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   238
        ret = ETrue;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   239
        }        
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   240
    return ret;
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   241
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   242
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   243
void CModemAtPipeController::HandleNameAddInd( const TIsiReceiveC& aReceivedMessage )     
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   244
     {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   245
     OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLENAMEADDIND, "CModemAtPipeController::HandleNameAddInd" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   246
     C_TRACE (( _T("CModemAtPipeController::HandleNameAddInd()") ));
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   247
     TInt matchesInThisMsg = aReceivedMessage.Get16bit( ISI_HEADER_SIZE +
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   248
       PNS_NAME_ADD_IND_OFFSET_MATCHESINMSG );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   249
     
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   250
     OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLENAMEADDIND, "CModemAtPipeController::HandleNameAddInd;matchesInThisMsg=%d", matchesInThisMsg );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   251
     C_TRACE((_L("matchesInThisMsg: %d") ,matchesInThisMsg ));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   252
     TUint name = 0;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   253
    
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   254
     for( TInt i = 1; i <= matchesInThisMsg; i++ ) 
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   255
         {
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   256
         name = aReceivedMessage.Get32bit(ISI_HEADER_SIZE +
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   257
           PNS_NAME_ADD_IND_OFFSET_NAMEENTRYTBL * i);
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   258
         OstTraceExt2( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLENAMEADDIND, "CModemAtPipeController:;i=%d;name=%x", i, name );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   259
         C_TRACE((_L("name [%d] 0x%x"), i ,name));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   260
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   261
         if( MatchDataportName(name) )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   262
             {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   263
             TUint8 devId = aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   264
               PNS_NAME_ADD_IND_OFFSET_NAMEENTRYTBL * i +
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   265
               PN_NAME_SRV_ITEM_STR_OFFSET_DEV );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   266
             TUint8 objId = aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   267
               PNS_NAME_ADD_IND_OFFSET_NAMEENTRYTBL * i +
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   268
               PN_NAME_SRV_ITEM_STR_OFFSET_OBJ);
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   269
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   270
             if( devId == THIS_DEVICE )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   271
                {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   272
                OstTraceExt2( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_HANDLENAMEADDIND, "CModemAtPipeController::HandleNameAddInd - Adding dataport name.;devId=%x;objId=%x", devId, objId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   273
                C_TRACE((_L("Adding dataport name. (Dataport device id 0x%x,  object id: 0x%x)"),devId,objId));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   274
                iAtHandler.AddDevice( devId, objId );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   275
                }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   276
             else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   277
                {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   278
                OstTraceExt2( TRACE_NORMAL, DUP4_CMODEMATPIPECONTROLLER_HANDLENAMEADDIND, "CModemAtPipeController::HandleNameAddInd - ERROR: Pipe is not created.;devId=%x;objId=%x", devId, objId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   279
                C_TRACE((_L("ERROR: Pipe is not created. (Dataport device id 0x%x,  object id: 0x%x)"),devId, objId ));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   280
                }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   281
             }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   282
         }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   283
     }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   284
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   285
void CModemAtPipeController::HandleNameRemoveInd( const TIsiReceiveC& aReceivedMessage )     
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   286
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   287
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLENAMEREMOVEIND, "CModemAtPipeController::HandleNameRemoveInd" );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   288
    C_TRACE (( _T("CModemAtPipeController::HandleNameRemoveInd()") ));
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   289
    TInt matchesInThisMsg = aReceivedMessage.Get16bit( ISI_HEADER_SIZE +
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   290
      PNS_NAME_REMOVE_IND_OFFSET_MATCHESINMSG );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   291
    
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   292
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLENAMEREMOVEIND, "CModemAtPipeController::HandleNameRemoveInd;matchesInThisMsg=%d", matchesInThisMsg );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   293
    C_TRACE((_L("matchesInThisMsg: %d"), matchesInThisMsg ));
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   294
    TUint name = 0;
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   295
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   296
    for( TInt i = 1; i <= matchesInThisMsg; i++ ) 
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   297
        {
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   298
        name = aReceivedMessage.Get32bit(ISI_HEADER_SIZE +
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   299
          PNS_NAME_REMOVE_IND_OFFSET_NAMEENTRYTBL * i);
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   300
        OstTraceExt2( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLENAMEREMOVEIND, "CModemAtPipeController::HandleNameRemoveInd;i=%d;name=%x", i, name );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   301
        C_TRACE((_L("name [%d] 0x%x"), i ,name));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   302
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   303
        if( MatchDataportName(name) )
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   304
            {
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   305
            TUint devId = aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   306
              PNS_NAME_REMOVE_IND_OFFSET_NAMEENTRYTBL * i +
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   307
              PN_NAME_SRV_ITEM_STR_OFFSET_DEV );
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   308
            TUint objId = aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   309
              PNS_NAME_REMOVE_IND_OFFSET_NAMEENTRYTBL * i +
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   310
              PN_NAME_SRV_ITEM_STR_OFFSET_OBJ);
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   311
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   312
            OstTraceExt2( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_HANDLENAMEREMOVEIND, "CModemAtPipeController::HandleNameRemoveInd - Dataport removed from name service;devId=%x;objId=%x", devId, objId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   313
            C_TRACE((_L("Dataport removed from name service (devid %x  o-bjid %x) "), devId, objId));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   314
            iAtHandler.RemoveDevice( devId, objId );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   315
            }
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   316
        }
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   317
    }
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   318
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   319
void CModemAtPipeController::HandleNameQueryResp( const TIsiReceiveC& aReceivedMessage )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   320
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   321
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLENAMEQUERYRESP, "CModemAtPipeController::HandleNameQueryResp" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   322
    C_TRACE((_L("CModemAtPipeHandler::HandleNameQueryResp")));
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   323
    TUint16 matchesInThisMsg( aReceivedMessage.Get16bit(
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   324
        ISI_HEADER_SIZE + PNS_NAME_QUERY_RESP_OFFSET_MATCHESINMSG ) );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   325
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLENAMEQUERYRESP, "CModemAtPipeController::HandleNameQueryResp;matchesInThisMsg=%d", matchesInThisMsg );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   326
    C_TRACE((_L("matchesInThisMsg: %d"), matchesInThisMsg ));
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   327
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   328
    TBool found = EFalse;
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   329
    if( 0 < matchesInThisMsg )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   330
        {
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   331
        for( TInt i = 0; i < matchesInThisMsg; i++ )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   332
            {
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   333
            TInt recordIndex( i * SIZE_PN_NAME_SRV_ITEM_STR );
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   334
            TUint8 name( aReceivedMessage.Get8bit(
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   335
                ISI_HEADER_SIZE + PNS_NAME_QUERY_RESP_OFFSET_NAMEENTRYTBL +
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   336
                recordIndex + ( PN_NAME_SRV_ITEM_STR_OFFSET_NAME + KLastByteIndex ) ) );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   337
            OstTraceExt2( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLENAMEQUERYRESP, "CModemAtPipeController::HandleNameQueryResp;i=%d;name=%x", i, name );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   338
            C_TRACE((_L("name [%d] 0x%x"), i, name ));
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   339
            if( PN_AT_MODEM == name )
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   340
                {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   341
                OstTrace0( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_HANDLENAMEQUERYRESP, "CModemAtPipeController::HandleNameQueryResp - PN_AT_MODEM found." );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   342
                C_TRACE((_L("PN_AT_MODEM found.")));
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   343
                i = matchesInThisMsg;
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   344
                found = ETrue;
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   345
                }
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   346
            }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   347
        }
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   348
    iAtHandler.SetModemAtExistsInCmt( found );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   349
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   350
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   351
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   352
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   353
void CModemAtPipeController::SendCreatePipeMessage( const TUint8 aDevId, const TUint8 aObjId ) 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   354
     {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   355
     OstTraceExt2( TRACE_NORMAL, CMODEMATPIPECONTROLLER_SENDCREATEPIPEMESSAGE, "CModemAtPipeController::SendCreatePipeMessage;aDevId=%x;aObjId=%x", aDevId, aObjId );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   356
     C_TRACE (( _T("CModemAtPipeController::SendCreatePipeMessage() DevId: 0x%x ObjId: 0x%x"), aDevId, aObjId ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   357
     HBufC8* message = HBufC8::New( ISI_HEADER_SIZE + SIZE_PNS_PIPE_CREATE_REQ );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   358
     TRACE_ASSERT(message);
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   359
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   360
     iDpObjId = aObjId;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   361
     iDpDevId = aDevId;
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   362
     
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   363
     TPtr8 messageptr = message->Des();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   364
     TIsiSend isimessage( messageptr, ISI_HEADER_SIZE + SIZE_PNS_PIPE_CREATE_REQ );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   365
     isimessage.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_PIPE );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   366
     
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   367
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_UTID, 0);
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   368
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_SUBFUNCTION, PNS_PIPE_CREATE_REQ );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   369
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_STATEAFTERCREATION ,PN_PIPE_DISABLE );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   370
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_PRIORITY ,0 );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   371
     
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   372
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_FIRSTPEPDEV, aDevId );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   373
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_FIRSTPEPOBJ, aObjId );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   374
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_FIRSTPEPTYPE, PN_PEP_TYPE_COMMON );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   375
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_FILLERBYTE1, KFiller );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   376
     
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   377
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_SECONDPEPDEV, THIS_DEVICE );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   378
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_SECONDPEPOBJ, iModemAtObjId );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   379
     isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_CREATE_REQ_OFFSET_SECONDPEPTYPE, PN_PEP_TYPE_COMMON );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   380
     isimessage.Complete();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   381
    
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   382
     OstTrace0( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_SENDCREATEPIPEMESSAGE, "CModemAtPipeController::SendCreatePipeMessage - Created ISI-message" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   383
     OstTraceExt1( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_SENDCREATEPIPEMESSAGE, "CModemAtPipeController::SendCreatePipeMessage - msg;messageptr=%s", messageptr );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   384
     C_TRACE(_L("Created ISI-message"));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   385
     DUMP_MESSAGE( messageptr );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   386
     TInt retVal = iIscApi.Send( messageptr );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   387
     TRACE_ASSERT( retVal == KErrNone );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   388
     delete message;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   389
     }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   390
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   391
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   392
 void CModemAtPipeController::HandlePipeCreateResp( const TIsiReceiveC& aReceivedMessage )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   393
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   394
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLEPIPECREATERESP, "CModemAtPipeController::HandlePipeCreateResp" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   395
    C_TRACE (( _T("CModemAtPipeController::HandlePipeCreateResp()") ));
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   396
    TInt error = aReceivedMessage.Get8bit(ISI_HEADER_SIZE +
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   397
      PNS_PIPE_CREATE_RESP_OFFSET_ERRORCODE );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   398
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLEPIPECREATERESP, "CModemAtPipeController::HandlePipeCreateResp - Pipe create resp:;error=%d", error );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   399
    C_TRACE((_L("Pipe create resp: %d"), error ));
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   400
    
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   401
    if( error == PN_PIPE_NO_ERROR)
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   402
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   403
        TUint8 pipeHandle;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   404
        pipeHandle = aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   405
          PNS_PIPE_CREATE_RESP_OFFSET_PIPEHANDLE );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   406
        OstTrace1( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLEPIPECREATERESP, "CModemAtPipeController::HandlePipeCreateResp - Pipe created successfully.;pipeHandle=%d", pipeHandle );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   407
        C_TRACE( (_L("Pipe created successfully. Pipehandle: %d"), pipeHandle ));
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   408
        
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   409
        // Now that pipehandle is received, it will also be used as dteId when connecting to AT Modem.
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   410
        OstTrace0( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_HANDLEPIPECREATERESP, "CModemAtPipeController::HandlePipeCreateResp -  pipe found" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   411
        C_TRACE((_L("CModemAtPipeHandler::HandlePipeCreateResp: pipe found")));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   412
        iPipe.pipeHandle = pipeHandle;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   413
        iPipe.firstDevId = iDpDevId;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   414
        iPipe.firstObjId = iDpObjId;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   415
        iPipe.secondObjId = iModemAtObjId;
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   416
        iPipe.secondDevId = THIS_DEVICE;
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   417
        ChangePipeState( TPipeInfo::EPipeCreated );
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   418
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   419
        iAtHandler.PipeCreated( pipeHandle, KErrNone );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   420
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   421
    else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   422
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   423
        OstTrace1( TRACE_NORMAL, DUP4_CMODEMATPIPECONTROLLER_HANDLEPIPECREATERESP, "CModemAtPipeController::HandlePipeCreateResp - Pipe creation failed:;error=%d", error );
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   424
        C_TRACE((_L("Pipe creation failed: %d"), error ));
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   425
        iPipe.pipeHandle = KInvalidPipeHandle;
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   426
        iPipe.firstDevId = 0;
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   427
        iPipe.firstObjId = 0;
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   428
        iPipe.secondDevId = 0;
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   429
        iPipe.secondObjId = 0;
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   430
        ChangePipeState( TPipeInfo::EPipeNoPipe );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   431
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   432
        iAtHandler.PipeCreated( KInvalidPipeHandle, KErrGeneral  );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   433
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   434
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   435
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   436
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   437
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   438
void CModemAtPipeController::HandlePipeRemoveResp( const TIsiReceiveC& aReceivedMessage )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   439
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   440
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLEPIPEREMOVERESP, "CModemAtPipeController::HandlePipeRemoveResp" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   441
    C_TRACE (( _T(">>CModemAtPipeController::HandlePipeRemoveResp()") ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   442
    TInt error = aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   443
      PNS_PIPE_REMOVE_RESP_OFFSET_ERRORCODE );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   444
    TInt pipehandle = aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   445
      PNS_PIPE_REMOVE_RESP_OFFSET_PIPEHANDLE );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   446
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   447
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   448
    TRACE_ASSERT( error == PN_PIPE_NO_ERROR )
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   449
    if( error != PN_PIPE_NO_ERROR )
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   450
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   451
        OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLEPIPEREMOVERESP, "CModemAtPipeController::HandlePipeRemoveResp;error=%d", error );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   452
        C_TRACE(( _T("CModemAtPipeController::HandlePipeRemoveResp() error %d"), error ));
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   453
        return;
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   454
        }
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   455
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   456
    ChangePipeState( TPipeInfo::EPipeNoPipe );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   457
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   458
    if( iSchedulerWait )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   459
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   460
        OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLEPIPEREMOVERESP, "CModemAtPipeController::HandlePipeRemoveResp - iSchedulerWait->Stop" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   461
        C_TRACE((_L("CModemAtPipeController::HandlePipeRemoveResp() iSchedulerWait->Stop")));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   462
        iSchedulerWait->AsyncStop();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   463
        delete iSchedulerWait;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   464
        iSchedulerWait = NULL;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   465
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   466
    C_TRACE((_L("<<CModemAtPipeController::HandlePipeRemoveResp()")));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   467
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   468
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   469
 
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   470
void CModemAtPipeController::RemovePipe()
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   471
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   472
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_REMOVEPIPE, "CModemAtPipeController::RemovePipe" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   473
    OstTraceExt3( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_REMOVEPIPE, "CModemAtPipeController::RemovePipe - ;iPipe.pipeHandle=%d;this=%p;iPipe.pipeState=%d", iPipe.pipeHandle, this, iPipe.pipeState );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   474
    C_TRACE (( _T("CModemAtPipeController::RemovePipe(%d, 0x%x)"), iPipe.pipeHandle, this ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   475
    C_TRACE (( _T("CModemAtPipeController::RemovePipe( dteID: %d, state: %d)"), iPipe.pipeHandle, iPipe.pipeState ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   476
            
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   477
    if( KInvalidPipeHandle != iPipe.pipeHandle &&
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   478
        TPipeInfo::EPipeRemoving != iPipe.pipeState &&
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   479
        TPipeInfo::EPipeNoPipe != iPipe.pipeState )
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   480
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   481
        OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_REMOVEPIPE, "CModemAtPipeController::RemovePipe - start to remove pipe" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   482
        C_TRACE((_L("CModemAtPipeController::RemovePipe: start to remove pipe")));
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   483
        ChangePipeState( TPipeInfo::EPipeRemoving );
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   484
        SendRemovePipeReq( iPipe.pipeHandle );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   485
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   486
    else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   487
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   488
        OstTrace0( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_REMOVEPIPE, "CModemAtPipeController::RemovePipe - no need to remove pipe" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   489
        C_TRACE((_L("CModemAtPipeController::RemovePipe: no need to remove pipe")));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   490
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   491
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   492
 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   493
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   494
void CModemAtPipeController::SendRemovePipeReq( const TUint8 aPipeHandle ) 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   495
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   496
    OstTrace1( TRACE_NORMAL, CMODEMATPIPECONTROLLER_SENDREMOVEPIPEREQ, "CModemAtPipeController::SendRemovePipeReq();aPipeHandle=%d", aPipeHandle );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   497
    C_TRACE (( _T(">>CModemAtPipeController::SendRemovePipeReq()") ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   498
    C_TRACE((_L("Remove pipe handle %d"), aPipeHandle));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   499
    TInt size = ISI_HEADER_SIZE + SIZE_PNS_PIPE_REMOVE_REQ;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   500
    HBufC8* message = HBufC8::New( size );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   501
    TRACE_ASSERT( message );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   502
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   503
    TPtr8 messageptr = message->Des();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   504
    TIsiSend isimessage( messageptr, size );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   505
    isimessage.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_PIPE );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   506
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REMOVE_REQ_OFFSET_UTID, 0 );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   507
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REMOVE_REQ_OFFSET_SUBFUNCTION, 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   508
      PNS_PIPE_REMOVE_REQ );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   509
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REMOVE_REQ_OFFSET_PIPEHANDLE,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   510
      aPipeHandle ); //disabled
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   511
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REMOVE_REQ_OFFSET_FILLERBYTE1 ,0 );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   512
    isimessage.Complete();
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   513
    OstTrace0( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_SENDREMOVEPIPEREQ, "CModemAtPipeController::SendRemovePipeReq - Created ISI-message" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   514
    C_TRACE(_L("Created ISI-message"));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   515
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   516
    TInt retVal = iIscApi.Send( messageptr );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   517
    TRACE_ASSERT( retVal == KErrNone );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   518
    delete message;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   519
    if( !iSchedulerWait )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   520
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   521
        OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_SENDREMOVEPIPEREQ, "CModemAtPipeController::SendRemovePipeReq - iSchedulerWait->Start()" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   522
        C_TRACE(_L("CModemAtPipeController::SendRemovePipeReq() iSchedulerWait->Start()"));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   523
        TRAPD(err, iSchedulerWait = new (ELeave) CActiveSchedulerWait);
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   524
        ASSERT_PANIC_ALWAYS( err == KErrNone );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   525
        iSchedulerWait->Start();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   526
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   527
    C_TRACE (( _T("<<CModemAtPipeController::SendRemovePipeReq()") ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   528
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   529
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   530
void CModemAtPipeController::RedirectPipe( 
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   531
    const TUint8 aNewDevId,
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   532
    const TUint8 aNewObjId ) 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   533
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   534
    OstTraceExt2( TRACE_NORMAL, CMODEMATPIPECONTROLLER_REDIRECTPIPE, "CModemAtPipeController::RedirectPipe;aNewDevId=%x;aNewObjId=%x", aNewDevId, aNewObjId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   535
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_REDIRECTPIPE, "CModemAtPipeController::RedirectPipe;iPipe.pipeHandle=%d", iPipe.pipeHandle );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   536
    C_TRACE (( _T("CModemAtPipeController::RedirectPipe() dteid %d"), iPipe.pipeHandle));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   537
    C_TRACE((_L("CModemAtPipeController::RedirectPipe() New pep, deviceId: 0x%x objId: 0x%x "), aNewDevId, aNewObjId));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   538
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   539
    if( iPipe.pipeState == TPipeInfo::EPipeRemoving || 
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   540
        iPipe.pipeState == TPipeInfo::EPipeNoPipe ) 
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   541
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   542
        OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_REDIRECTPIPE, "CModemAtPipeController::RedirectPipe - Pipe is already removed -> cant redirect" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   543
        C_TRACE(_L("CModemAtPipeController::RedirectPipe() Pipe is already removed -> cant redirect"));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   544
        return;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   545
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   546
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   547
    if( aNewDevId == THIS_DEVICE && aNewObjId == iModemAtObjId )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   548
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   549
        OstTrace1( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_REDIRECTPIPE, "CModemAtPipeController::RedirectPipe - EPipeDisabled.;iModemAtObjId=%x", iModemAtObjId );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   550
        C_TRACE((_L("CModemAtPipeController::RedirectPipe() EPipeDisabled. iModemAtObjId: 0x%x"), iModemAtObjId));
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   551
        // NOTE: Setting pipe state disabled here won't send command mode yet.
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   552
        iPipe.pipeState = TPipeInfo::EPipeDisabled;
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   553
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   554
    else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   555
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   556
        OstTrace0( TRACE_NORMAL, DUP4_CMODEMATPIPECONTROLLER_REDIRECTPIPE, "CModemAtPipeController::RedirectPipe - EPipeRedirected" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   557
        C_TRACE(_L("CModemAtPipeController::RedirectPipe() EPipeRedirected"));
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   558
        ChangePipeState( TPipeInfo::EPipeRedirected );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   559
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   560
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   561
    OstTrace0( TRACE_NORMAL, DUP5_CMODEMATPIPECONTROLLER_REDIRECTPIPE, "CModemAtPipeController::RedirectPipe - Redirecting pipe" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   562
    C_TRACE(_L("CModemAtPipeController::RedirectPipe() Redirecting pipe"));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   563
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   564
    HBufC8* message = HBufC8::New( ISI_HEADER_SIZE + SIZE_PNS_PIPE_REDIRECT_REQ );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   565
    ASSERT_PANIC_ALWAYS( message );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   566
    TPtr8 messageptr = message->Des();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   567
    TIsiSend isimessage( messageptr, ISI_HEADER_SIZE + SIZE_PNS_PIPE_REDIRECT_REQ );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   568
    isimessage.Set8bit( ISI_HEADER_OFFSET_RESOURCEID,PN_PIPE);
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   569
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_UTID, 0); 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   570
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_SUBFUNCTION,
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   571
        PNS_PIPE_REDIRECT_REQ );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   572
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_PIPEHANDLE,
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   573
        iPipe.pipeHandle );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   574
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_STATEAFTERCREATION,
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   575
        PN_PIPE_DISABLE );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   576
    //old pep 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   577
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_OLDPEPDEV,
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   578
        iPipe.secondDevId );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   579
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_OLDPEPOBJ, 
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   580
        iPipe.secondObjId );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   581
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_OLDPEPTYPE, PN_PEP_TYPE_COMMON); 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   582
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_FILLERBYTE1, KFiller );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   583
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   584
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_REPLACEMENTPEPDEV, aNewDevId );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   585
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_REPLACEMENTPEPOBJ, aNewObjId );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   586
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_REPLACEMENTPEPTYPE, 
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   587
        PN_PEP_TYPE_COMMON ); 
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   588
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   589
    iPipe.secondDevId = aNewDevId;
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   590
    iPipe.secondObjId = aNewObjId;
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   591
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   592
    isimessage.Set8bit(ISI_HEADER_SIZE + PNS_PIPE_REDIRECT_REQ_OFFSET_NSB, KFiller );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   593
    isimessage.Complete();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   594
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   595
    OstTrace0( TRACE_NORMAL, DUP6_CMODEMATPIPECONTROLLER_REDIRECTPIPE, "CModemAtPipeController::RedirectPipe - Created ISI-message" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   596
    C_TRACE(_L("Created ISI-message"));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   597
    TInt retVal = iIscApi.Send( messageptr );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   598
    TRACE_ASSERT( retVal == KErrNone );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   599
    delete message;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   600
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   601
 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   602
void CModemAtPipeController::HandlePipeRedirectResp( const TIsiReceiveC& aReceivedMessage )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   603
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   604
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLEPIPEREDIRECTRESP, "CModemAtPipeController::HandlePipeRedirectResp" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   605
    C_TRACE (( _T("CModemAtPipeController::HandlePipeRedirectResp()") ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   606
    TInt error = aReceivedMessage.Get8bit( ISI_HEADER_SIZE +
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   607
      PNS_PIPE_REDIRECT_RESP_OFFSET_ERRORCODE );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   608
    TInt pipeHandle = aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   609
      PNS_PIPE_REDIRECT_RESP_OFFSET_PIPEHANDLE );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   610
    C_TRACE((_L("CModemAtPipeController::HandlePipeRedirectResp() pipehandle: %d"), pipeHandle ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   611
    
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   612
    if( error != PN_PIPE_NO_ERROR )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   613
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   614
        iAtHandler.SendAtModemDataRedirectResultReq( AT_MODEM_REDIRECT_RESULT_ERROR );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   615
        RemovePipe();
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   616
        }
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   617
    else
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   618
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   619
        iAtHandler.SendAtModemDataRedirectResultReq( AT_MODEM_REDIRECT_RESULT_OK );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   620
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   621
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   622
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   623
void CModemAtPipeController::QueryModemAtFromNameService() 
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   624
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   625
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_QUERYMODEMATFROMNAMESERVICE, "CModemAtPipeController::QueryModemAtFromNameService" );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   626
    C_TRACE (( _T("CModemAtPipeController::QueryModemAtFromNameService()") ));
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   627
    HBufC8* message = HBufC8::New( ISI_HEADER_SIZE + SIZE_PNS_NAME_QUERY_REQ );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   628
    TRACE_ASSERT( message );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   629
    if( message )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   630
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   631
        TPtr8 messageptr = message->Des();
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   632
        TIsiSend isimessage( messageptr, ISI_HEADER_SIZE + SIZE_PNS_NAME_QUERY_REQ );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   633
        isimessage.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_NAMESERVICE );       
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   634
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_NAME_QUERY_REQ_OFFSET_UTID, KDefaultTrId );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   635
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_NAME_QUERY_REQ_OFFSET_SUBFUNCTION, PNS_NAME_QUERY_REQ );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   636
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_NAME_QUERY_REQ_OFFSET_RESERVED1, 0 );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   637
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_NAME_QUERY_REQ_OFFSET_RESERVED2, 0);
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   638
        isimessage.Set32bit( ISI_HEADER_SIZE + PNS_NAME_QUERY_REQ_OFFSET_NAME, PN_AT_MODEM );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   639
        isimessage.Set32bit( ISI_HEADER_SIZE + PNS_NAME_QUERY_REQ_OFFSET_BITMASK, PN_AT_MODEM );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   640
        isimessage.Complete();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   641
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   642
        OstTraceExt1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_QUERYMODEMATFROMNAMESERVICE, "CModemAtPipeController::QueryModemAtFromNameService - msg dump;messageptr=%s", messageptr );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   643
        DUMP_MESSAGE( messageptr );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   644
        TInt retVal = iIscApi.Send( messageptr );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   645
        TRACE_ASSERT( retVal == KErrNone );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   646
        delete message;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   647
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   648
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   649
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   650
void CModemAtPipeController::SendEnablePipeReq()
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   651
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   652
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_SENDENABLEPIPEREQ, "CModemAtPipeController::SendEnablePipeReq" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   653
    C_TRACE (( _T("CModemAtPipeController::SendEnablePipeReq()") ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   654
    HBufC8* message = HBufC8::New( ISI_HEADER_SIZE + SIZE_PNS_PIPE_ENABLE_REQ );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   655
    ASSERT_PANIC_ALWAYS( message ) 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   656
    TPtr8 messageptr = message->Des();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   657
    TIsiSend isimessage( messageptr, ISI_HEADER_SIZE + SIZE_PNS_PIPE_ENABLE_REQ );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   658
    isimessage.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_PIPE );       
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   659
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_ENABLE_REQ_OFFSET_UTID, 0 );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   660
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_ENABLE_REQ_OFFSET_SUBFUNCTION, PNS_PIPE_ENABLE_REQ );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   661
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_ENABLE_REQ_OFFSET_PIPEHANDLE , iPipe.pipeHandle );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   662
    isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PIPE_ENABLE_REQ_OFFSET_FILLERBYTE1 , 0 );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   663
    isimessage.Complete();
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   664
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   665
    DUMP_MESSAGE( messageptr );
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   666
    TInt retVal = iIscApi.Send( messageptr );
5
8ccc39f9d787 New release based on our 2010wk02 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 0
diff changeset
   667
    TRACE_ASSERT( retVal == KErrNone );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   668
    delete message;
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   669
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   670
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   671
void CModemAtPipeController::HandlePipeEnabledResp( const TIsiReceiveC& aReceivedMessage )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   672
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   673
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLEPIPEENABLEDRESP, "CModemAtPipeController::HandlePipeEnabledResp" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   674
    C_TRACE (( _T("CModemAtPipeController::HandlePipeEnabledResp()") ));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   675
    TInt error = aReceivedMessage.Get8bit(ISI_HEADER_SIZE + 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   676
      PNS_PIPE_ENABLE_RESP_OFFSET_ERRORCODE);
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   677
    TInt pipeHandle = aReceivedMessage.Get8bit(ISI_HEADER_SIZE + 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   678
      PNS_PIPE_ENABLE_RESP_OFFSET_PIPEHANDLE);
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   679
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   680
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLEPIPEENABLEDRESP, "CModemAtPipeController::HandlePipeEnabledResp;pipeHandle=%d", pipeHandle );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   681
    C_TRACE((_L("CModemAtPipeController::HandlePipeEnabledResp() pipehandle %d"), pipeHandle));       
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   682
    if( error == PN_PIPE_NO_ERROR )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   683
        {
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   684
        ChangePipeState( TPipeInfo::EPipeEnabled );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   685
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   686
    else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   687
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   688
        OstTrace1( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLEPIPEENABLEDRESP, "CModemAtPipeController::HandlePipeEnabledResp - pipe;error=%d", error );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   689
        C_TRACE((_L("CModemAtPipeController::HandlePipeEnabledResp() pipe error: %d"), error));
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   690
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   691
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   692
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   693
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   694
void CModemAtPipeController::ChangePipeState( TPipeInfo::EPipeState aState )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   695
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   696
    OstTraceExt2( TRACE_NORMAL, CMODEMATPIPECONTROLLER_CHANGEPIPESTATE, "CModemAtPipeController::ChangePipeState;aState=%d;iPipe.pipeHandle=%d", (TInt)aState, iPipe.pipeHandle );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   697
    C_TRACE((_L("CModemAtPipeController::ChangePipeState: pipe handle: %d ( New state: %d )"), iPipe.pipeHandle, (TInt)aState));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   698
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   699
    iPipe.pipeState = aState;
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   700
    if( TPipeInfo::EPipeRedirected == aState )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   701
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   702
        // NOTE: Setting data mode when pipe is being redirected.
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   703
        // This will fasten the discovery of data mode.
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   704
        // If pipe fails, we return to command mode.
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   705
        OstTrace0( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_CHANGEPIPESTATE, "CModemAtPipeController::ChangePipeState - DATA MODE" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   706
        C_TRACE(( _T("DATA MODE") ));
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   707
        iAtHandler.HandleCommandModeChange( EDataMode );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   708
        }
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   709
    else if( TPipeInfo::EPipeDisabled == aState )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   710
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   711
        OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_CHANGEPIPESTATE, "CModemAtPipeController::ChangePipeState - COMMAND MODE" );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   712
        C_TRACE(( _T("COMMAND MODE") ));
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   713
        iAtHandler.HandleCommandModeChange( ECommandMode );
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   714
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   715
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   716
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   717
void CModemAtPipeController::HandlePepStatusInd( const TIsiReceiveC& aReceivedMessage )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   718
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   719
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "CModemAtPipeController::HandlePepStatusInd" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   720
    C_TRACE(( _L("CModemAtPipeController::HandlePepStatusInd()")));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   721
    TUint8 pepType( aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   722
      PNS_PEP_STATUS_IND_OFFSET_PEPTYPE ) );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   723
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "CModemAtPipeController::HandlePepStatusInd;pepType=%d", pepType );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   724
    C_TRACE(( _L("pepType: %d"), pepType ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   725
    
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   726
    TUint8 pipeHandle( aReceivedMessage.Get8bit( ISI_HEADER_SIZE +
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   727
      PNS_PEP_STATUS_IND_OFFSET_PIPEHANDLE ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   728
    OstTrace1( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "CModemAtPipeController::HandlePepStatusInd;pipeHandle=%d", pipeHandle );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   729
    C_TRACE(( _L("pipeHandle: %d"), pipeHandle ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   730
    
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   731
    if( iPipe.pipeHandle != pipeHandle )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   732
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   733
        C_TRACE( (_L("Unknown pipe handle: %d, iPipe.pipeHandle: %d "), pipeHandle, iPipe.pipeHandle ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   734
        return;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   735
        }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   736
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   737
    if( pepType == PN_PEP_TYPE_COMM )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   738
        {
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   739
        TUint8 indicationId( aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   740
          PNS_PEP_STATUS_IND_OFFSET_INDICATIONID ) );
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   741
        OstTrace1( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "CModemAtPipeController::HandlePepStatusInd;indicationId=%d", indicationId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   742
        C_TRACE(( _L("indicationId: %d"), indicationId ));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   743
        if( indicationId == PEP_COMM_IND_ID_ESCAPE )
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   744
            {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   745
            C_TRACE(( _T("PEP_COMM_IND_ID_ESCAPE -> AT_MODEM_SIGNAL_ESCAPE_DETECTED") ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   746
            iAtHandler.SendSignalDetection( AT_MODEM_SIGNAL_ESCAPE_DETECTED );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   747
            }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   748
        else if( indicationId == PEP_COMM_IND_ID_V24_CHANGE )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   749
            {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   750
			OstTrace0( TRACE_NORMAL, DUP4_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "PEP_COMM_IND_ID_V24_CHANGE" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   751
            C_TRACE(( _T("PEP_COMM_IND_ID_V24_CHANGE") ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   752
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   753
            TUint8 indicationData( aReceivedMessage.Get8bit( ISI_HEADER_SIZE +
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   754
              PNS_PEP_STATUS_IND_OFFSET_INDICATIONDATA ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   755
            OstTrace1( TRACE_NORMAL, DUP5_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "CModemAtPipeController::HandlePepStatusInd;indicationData=%d", indicationData );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   756
            C_TRACE(( _L("indicationData: %d"), indicationData ));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   757
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   758
            if( indicationData == PEP_COMM_SIGNAL_DTR_ON )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   759
                {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   760
                OstTrace0( TRACE_NORMAL, DUP6_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "AT_MODEM_SIGNAL_DTR_ON" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   761
                C_TRACE(( _T("PEP_COMM_SIGNAL_DTR_ON -> AT_MODEM_SIGNAL_DTR_ON") ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   762
                iAtHandler.SendSignalDetection( AT_MODEM_SIGNAL_DTR_ON );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   763
                }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   764
            else if( indicationData == PEP_COMM_SIGNAL_DTR_OFF )
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   765
                {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   766
				OstTrace0( TRACE_NORMAL, DUP7_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "AT_MODEM_SIGNAL_DTR_OFF" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   767
                C_TRACE(( _T("PEP_COMM_SIGNAL_DTR_OF -> AT_MODEM_SIGNAL_DTR_OFF") ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   768
                iAtHandler.SendSignalDetection( AT_MODEM_SIGNAL_DTR_OFF );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   769
                }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   770
            else
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   771
                {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   772
				OstTrace0( TRACE_NORMAL, DUP8_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "Unknown indication data" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   773
                C_TRACE(( _T("Unknown indication data") ));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   774
                }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   775
            }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   776
        else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   777
            {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   778
			OstTrace1( TRACE_NORMAL, DUP9_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "CModemAtPipeController::HandlePepStatusInd;indicationId=%d", indicationId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   779
            C_TRACE((_L("Unknown indicationId: %d pepType %d"), indicationId, pepType));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   780
            }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   781
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   782
     else
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   783
        {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   784
        OstTrace1( TRACE_NORMAL, DUP10_CMODEMATPIPECONTROLLER_HANDLEPEPSTATUSIND, "CModemAtPipeController::HandlePepStatusInd;pepType=%d", pepType );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   785
        C_TRACE((_L("CModemAtPipeController::HandlePepStatusInd() Peptype ignored %d "), pepType));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   786
        }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   787
    }
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   788
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   789
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   790
TPipeInfo::EPipeState CModemAtPipeController::GetPipeState()
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   791
    {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   792
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_GETPIPESTATE, "CModemAtPipeController::GetPipeState" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   793
    C_TRACE((_L("CModemAtPipeController::GetPipeState") ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   794
    return iPipe.pipeState;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   795
    }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   796
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   797
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   798
void CModemAtPipeController::SendPepCtrlReq( const TUint8 aControlId, TDesC8& aData )
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   799
    {
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   800
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_SENDPEPCTRLREQ, "CModemAtPipeController::SendPepCtrlReq" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   801
    C_TRACE (( _T("CModemAtPipeController::SendPepCtrlReq()") ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   802
    TInt length( ISI_HEADER_SIZE + SIZE_PNS_PEP_CTRL_REQ );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   803
    TInt fillers( 0 );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   804
    if( aControlId == PEP_COMM_CTRL_ID_ESCAPE )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   805
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   806
        fillers++;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   807
        length += ( KPepCtrlDataSize + fillers );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   808
        }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   809
    else if( aControlId == PEP_COMM_CTRL_ID_FLOW_CTRL)
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   810
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   811
        length += KPepFlowCtrlDataSize;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   812
        }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   813
    else
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   814
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   815
        TRACE_ASSERT_ALWAYS;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   816
        return;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   817
        }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   818
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_SENDPEPCTRLREQ, "CModemAtPipeController::SendPepCtrlReq;length=%d", length );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   819
    C_TRACE((_L("ISI message length: %d"), length));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   820
    HBufC8* message = HBufC8::New( length );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   821
    if( message )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   822
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   823
        TPtr8 messageptr = message->Des();
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   824
        TIsiSend isimessage( messageptr, length );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   825
        isimessage.Set8bit( ISI_HEADER_OFFSET_RECEIVERDEVICE, iDpDevId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   826
        isimessage.Set8bit( ISI_HEADER_OFFSET_RECEIVEROBJECT, iDpObjId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   827
        isimessage.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_PIPE );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   828
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_CTRL_REQ_OFFSET_UTID, 0 );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   829
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_CTRL_REQ_OFFSET_SUBFUNCTION, PNS_PEP_CTRL_REQ );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   830
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_CTRL_REQ_OFFSET_PIPEHANDLE , iPipe.pipeHandle );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   831
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_CTRL_REQ_OFFSET_PEPTYPE , PN_PEP_TYPE_COMM );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   832
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_CTRL_REQ_OFFSET_PEPCTRLID, aControlId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   833
        for( TInt i = 0; i < aData.Length(); i++ )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   834
            {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   835
            C_TRACE((_L("Setting control data[%d] = 0x%x"), ISI_HEADER_SIZE + PNS_PEP_CTRL_REQ_OFFSET_PEPCTRLDATA + i, aData[ i ] ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   836
            isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_CTRL_REQ_OFFSET_PEPCTRLDATA + i, aData[ i ] );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   837
            }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   838
        if( fillers > 0 )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   839
            {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   840
            C_TRACE((_L("Setting filler to data[%d] = 0x%x"), length - 1, KFiller ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   841
            isimessage.Set8bit( length - 1, KFiller );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   842
            }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   843
        isimessage.Complete();
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   844
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   845
        DUMP_MESSAGE( messageptr );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   846
        TInt retVal = iIscApi.Send( messageptr );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   847
        TRACE_ASSERT( KErrNone == retVal );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   848
        delete message;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   849
        }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   850
    else
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   851
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   852
        OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_SENDPEPCTRLREQ, "CModemAtPipeController::SendPepCtrlReq - No enough memory" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   853
        C_TRACE (( _T("CModemAtPipeController::SendPepCtrlReq(): No enough memory") ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   854
        }
8
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   855
    }
6295dc2169f3 New release based on our 2010wk15 release
mikaruus <mika.a.ruuskanen@nokia.com>
parents: 5
diff changeset
   856
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   857
void CModemAtPipeController::HandlePepCtrlResp( const TIsiReceiveC& aReceivedMessage )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   858
    {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   859
    OstTrace0( TRACE_NORMAL, CMODEMATPIPECONTROLLER_HANDLEPEPCTRLRESP, "CModemAtPipeController::HandlePepCtrlResp" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   860
    C_TRACE(( _L("CModemAtPipeController::HandlePepCtrlResp") ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   861
    TUint8 pepType( aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   862
        PNS_PEP_CTRL_RESP_OFFSET_PEPTYPE ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   863
    C_TRACE(( _L("pepType: %d"), pepType ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   864
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   865
    TUint8 pipeHandle( aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   866
        PNS_PEP_CTRL_RESP_OFFSET_PIPEHANDLE ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   867
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_HANDLEPEPCTRLRESP, "CModemAtPipeController::HandlePepCtrlResp;pipeHandle=%d", pipeHandle );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   868
    C_TRACE(( _L("pipeHandle: %d"), pipeHandle ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   869
    
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   870
    TUint8 controlId( aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   871
        PNS_PEP_CTRL_RESP_OFFSET_PEPCTRLID ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   872
    OstTrace1( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_HANDLEPEPCTRLRESP, "CModemAtPipeController::HandlePepCtrlResp;controlId=%d", controlId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   873
    C_TRACE(( _L("controlId: %d"), controlId ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   874
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   875
    if( PN_PEP_TYPE_COMM == pepType &&
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   876
        PEP_COMM_CTRL_ID_ESCAPE == controlId )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   877
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   878
        TUint8 error( aReceivedMessage.Get8bit( ISI_HEADER_SIZE + 
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   879
            PNS_PEP_CTRL_RESP_OFFSET_ERRORCODE ) );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   880
        OstTrace1( TRACE_NORMAL, DUP3_CMODEMATPIPECONTROLLER_HANDLEPEPCTRLRESP, "CModemAtPipeController::HandlePepCtrlResp;error=%d", error );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   881
        C_TRACE(( _L("error code: %d"), error ));
0
63b37f68c1ce First Contribution. Vanilla as it came from Nokia
<dalarub>
parents:
diff changeset
   882
9
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   883
        switch( error )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   884
            {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   885
            case PN_PIPE_NO_ERROR:
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   886
                {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   887
                OstTrace0( TRACE_NORMAL, DUP4_CMODEMATPIPECONTROLLER_HANDLEPEPCTRLRESP, "CModemAtPipeController::HandlePepCtrlResp - PN_PIPE_NO_ERROR" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   888
                C_TRACE(( _L("PN_PIPE_NO_ERROR")));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   889
                break;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   890
                }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   891
            case PN_PIPE_ERR_NOT_SUPPORTED:
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   892
                {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   893
                OstTrace0( TRACE_NORMAL, DUP5_CMODEMATPIPECONTROLLER_HANDLEPEPCTRLRESP, "CModemAtPipeController::HandlePepCtrlResp - error:PN_PIPE_ERR_NOT_SUPPORTED" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   894
                C_TRACE(( _L("error: PN_PIPE_ERR_NOT_SUPPORTED")));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   895
                break;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   896
                }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   897
            case PN_PIPE_ERR_INVALID_PARAM:
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   898
                {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   899
                OstTrace0( TRACE_NORMAL, DUP6_CMODEMATPIPECONTROLLER_HANDLEPEPCTRLRESP, "CModemAtPipeController::HandlePepCtrlResp - error: PN_PIPE_ERR_INVALID_PARAM" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   900
                C_TRACE(( _L("error: PN_PIPE_ERR_INVALID_PARAM")));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   901
                break;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   902
                }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   903
            case PN_PIPE_ERR_INVALID_CTRL_ID:
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   904
                {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   905
                OstTrace0( TRACE_NORMAL, DUP7_CMODEMATPIPECONTROLLER_HANDLEPEPCTRLRESP, "CModemAtPipeController::HandlePepCtrlResp - error: PN_PIPE_ERR_INVALID_CTRL_ID" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   906
                C_TRACE(( _L("error: PN_PIPE_ERR_INVALID_CTRL_ID")));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   907
                break;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   908
                }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   909
            case PN_PIPE_ERR_GENERAL:
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   910
                {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   911
                OstTrace0( TRACE_NORMAL, DUP8_CMODEMATPIPECONTROLLER_HANDLEPEPCTRLRESP, "CModemAtPipeController::HandlePepCtrlResp - error: PN_PIPE_ERR_GENERAL" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   912
                C_TRACE(( _L("error: PN_PIPE_ERR_GENERAL")));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   913
                break;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   914
                }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   915
            }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   916
        }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   917
    }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   918
//  sending PNS_PEP_STATUS_IND from pipe controller should be moved to PEP !
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   919
void CModemAtPipeController::SendPepStatusIndSignal( const TUint8 aPepCommSignal )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   920
    {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   921
    OstTrace1( TRACE_NORMAL, CMODEMATPIPECONTROLLER_SENDPEPSTATUSINDSIGNAL, "CModemAtPipeController::SendPepStatusIndSignal;aPepCommSignal=%x", aPepCommSignal );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   922
    C_TRACE((_L("CModemAtPipeController::SendPepStatusIndSignal() aPepCommSignal: 0x%x"), aPepCommSignal ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   923
    TInt length( ISI_HEADER_SIZE + SIZE_PNS_PEP_STATUS_IND );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   924
    OstTrace1( TRACE_NORMAL, DUP1_CMODEMATPIPECONTROLLER_SENDPEPSTATUSINDSIGNAL, "CModemAtPipeController::SendPepStatusIndSignal;length=%d", length );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   925
	C_TRACE((_L("ISI message length: %d"), length));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   926
    HBufC8* message = HBufC8::New( length );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   927
    if( message )
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   928
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   929
        TPtr8 messageptr = message->Des();
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   930
        TIsiSend isimessage( messageptr, length );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   931
        isimessage.Set8bit( ISI_HEADER_OFFSET_RECEIVERDEVICE, iDpDevId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   932
        isimessage.Set8bit( ISI_HEADER_OFFSET_RECEIVEROBJECT, iDpObjId );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   933
        isimessage.Set8bit( ISI_HEADER_OFFSET_RESOURCEID, PN_PIPE );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   934
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_STATUS_IND_OFFSET_UTID, 0 );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   935
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_STATUS_IND_OFFSET_SUBFUNCTION, PNS_PEP_STATUS_IND );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   936
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_STATUS_IND_OFFSET_PIPEHANDLE, iPipe.pipeHandle );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   937
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_STATUS_IND_OFFSET_PEPTYPE, PN_PEP_TYPE_COMM );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   938
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_STATUS_IND_OFFSET_INDICATIONID, PEP_COMM_IND_ID_V24_CHANGE );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   939
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_STATUS_IND_OFFSET_FILLERBYTE1, 0 );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   940
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_STATUS_IND_OFFSET_FILLERBYTE2, 0 );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   941
        isimessage.Set8bit( ISI_HEADER_SIZE + PNS_PEP_STATUS_IND_OFFSET_INDICATIONDATA, aPepCommSignal );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   942
        isimessage.Complete();
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   943
        DUMP_MESSAGE( messageptr );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   944
        TInt retVal = iIscApi.Send( messageptr );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   945
        TRACE_ASSERT( KErrNone == retVal );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   946
        delete message;
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   947
        }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   948
    else
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   949
        {
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   950
        OstTrace0( TRACE_NORMAL, DUP2_CMODEMATPIPECONTROLLER_SENDPEPSTATUSINDSIGNAL, "CModemAtPipeController::SendPepStatusIndSignal - error: not enough memory" );
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   951
        C_TRACE (( _T("CModemAtPipeController::SendPepStatusIndSignal(): Not enough memory") ));
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   952
        }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   953
    }
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   954
8486d82aef45 modemadaptation release 2010wk40
mikaruus
parents: 8
diff changeset
   955