cbsref/csyrefplugins/csy27010/src/ChannelMgrCmdData.cpp
author hgs
Tue, 22 Jun 2010 11:02:32 +0100
changeset 44 8b72faa1200f
permissions -rw-r--r--
201024_02
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     1
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     2
// * Copyright 2004 Neusoft America Inc.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     3
// * All rights reserved.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     4
// * This component and the accompanying materials are made available
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     5
// * under the terms of the Eclipse Public License v1.0
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     6
// * which accompanies this distribution, and is available
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     7
// * at the URL "http://www.eclipse.org/legal/epl-v10.html".
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     8
// *
8b72faa1200f 201024_02
hgs
parents:
diff changeset
     9
// * Contributors:
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    10
// * Keith Collins (Neusoft America Inc.)  original software development and additional code and modifications.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    11
// * Thomas Gahagen (Neusoft America Inc.)  additional code and modifications.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    12
// * Zhen Yuan (Neusoft America Inc.)  additional code and modifications.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    13
// *
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    14
// * Description:  The CChannelMgrCmdData class defines a single 3GPP 27.010 based logical channel
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    15
// *               called DLC. Derived control and data channel add specific behavior.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    16
//
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    17
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    18
// ChannelMgrCmdData.cpp
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    19
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    20
/** @file ChannelMgrCmdData.cpp
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    21
 *
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    22
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    23
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    24
#include "ChannelMgrCmdData.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    25
#include "PortC32InterfaceBase.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    26
#include "PortC32Interface.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    27
#include "CsyMsgBufBPFrame.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    28
#include "CsyDebugLogger.h"
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    29
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    30
CChannelMgrCmdData* CChannelMgrCmdData::NewL(const TUint8 aDlcNum,
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    31
											 CPortFactory& aPortFactory,
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    32
											 CMux0710Protocol& aMux0710Protocol)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    33
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    34
 * This methods uses two phase construction and the cleanup stack to create
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    35
 * an instance of class CChannelMgrCmd.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    36
 * @param aDlcNum - DLC number of this channel
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    37
 * @param aPortFactory - Reference to the port factory
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    38
 * @param aMux0710Protocol - Pointer to the 27.010 mux protocol
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    39
 * @return Pointer to the created instance
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    40
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    41
    {
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    42
	_LOG_L4C2("CChannelMgrCmdData::NewL [aDlcNum=%d]", aDlcNum);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    43
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    44
    CChannelMgrCmdData* p = new(ELeave) CChannelMgrCmdData(aDlcNum, aPortFactory,
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    45
														   aMux0710Protocol);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    46
 	CleanupStack::PushL(p);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    47
 	p->ConstructL();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    48
	CleanupStack::Pop(p);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    49
 	return p;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    50
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    51
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    52
CChannelMgrCmdData::~CChannelMgrCmdData()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    53
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    54
 * Destructor. Delete all resources and memory allocated by this object.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    55
 * Disconnect the channel from the multiplexer.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    56
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    57
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    58
    _LOG_L4C1("CChannelMgrData::~CChannelMgrCmdData");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    59
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    60
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    61
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    62
CChannelMgrCmdData::CChannelMgrCmdData(const TUint8 aDlcNum,
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    63
									   CPortFactory& aPortFactory,
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    64
									   CMux0710Protocol& aMux0710Protocol)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    65
: CChannelMgrBase(aDlcNum, aPortFactory, aMux0710Protocol),
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    66
  iCount(0)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    67
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    68
 * Constructor.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    69
 * @param aDlcNum - DLC number of this channel
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    70
 * @param aPortFactory - Reference to the port factory
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    71
 * @param aMux0710Protocol - Reference to the 27.010 mux protocol
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    72
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    73
 	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    74
	iCsyAllowedToSendFrames = EFlowControlOn;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    75
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    76
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    77
void CChannelMgrCmdData::ConstructL()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    78
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    79
 * Create any instances and allocate any memory used by this object.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    80
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    81
 	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    82
	CChannelMgrBase::ConstructL();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    83
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    84
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    85
void CChannelMgrCmdData::Open(CPortC32InterfaceBase* aPort)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    86
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    87
 * Open the port
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    88
 *
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    89
 * @param aPort - Pointer to CPortC32Interface
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    90
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    91
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    92
	_LOG_L4C2(">>CChannelMgrCmdData::Open [aPort=0x%x]",aPort);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    93
	
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    94
	iCount++;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    95
	if (iCount == 1)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    96
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    97
		_LOG_L4C1("First client of port");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    98
		
8b72faa1200f 201024_02
hgs
parents:
diff changeset
    99
		if (aPort->GetClientType() == CPortFactory::EC32ClientIpNif)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   100
			{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   101
			ParameterNegotiate();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   102
			}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   103
		else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   104
			{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   105
			TInt err = Connect();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   106
			if (err != KErrNone)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   107
				_LOG_L4C2("Open Connect error =%d",err);				
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   108
			}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   109
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   110
	iPortArray.Insert(aPort,0);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   111
	SetOwner(aPort);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   112
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   113
	_LOG_L4C2("<<CChannelMgrCmdData::Open [iCount=%d]",iCount);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   114
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   115
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   116
void CChannelMgrCmdData::Close(CPortC32InterfaceBase* aPort)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   117
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   118
 * Close the port
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   119
 *
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   120
 * @param aPort - Pointer to CPortC32Interface
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   121
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   122
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   123
	_LOG_L4C2(">>CChannelMgrCmdData::Close [aPort=%d]",aPort->GetPortNumber());
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   124
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   125
	iCount--;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   126
	if (iCount < 1)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   127
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   128
		_LOG_L4C1("Last client of port");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   129
		Disconnect();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   130
		iCount = 0; // reset counter
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   131
		iChannelReady = EFalse;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   132
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   133
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   134
	// remove port from the port list, set next port in the queue to be the port owner
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   135
	TInt index;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   136
	index = iPortArray.Find(aPort);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   137
	if (index == KErrNotFound)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   138
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   139
		_LOG_L1C2("** Close() - Port %d not found **", aPort);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   140
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   141
	else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   142
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   143
		iPortArray.Remove(index);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   144
		if (iPortC32Interface == aPort)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   145
			{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   146
			// close the current owner of the channel, set owership to the first one in the port list
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   147
			// if there are one
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   148
			if (iPortArray.Count() > 0)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   149
				SetOwner(iPortArray[0]);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   150
			else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   151
				SetOwner(NULL);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   152
			}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   153
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   154
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   155
	_LOG_L4C2("<<CChannelMgrCmdData::Close [iCount=%d]",iCount);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   156
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   157
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   158
void CChannelMgrCmdData::SetOwner(CPortC32InterfaceBase* aPort)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   159
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   160
 * Set owner to the pointer
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   161
 * @param aPort - Pointer to new owner, which is a CPortC32Interface instance
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   162
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   163
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   164
	_LOG_L4C1(">>CChannelMgrCmdData::SetOwner");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   165
	
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   166
	if (iPortC32Interface == aPort)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   167
		return;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   168
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   169
	if (iPortC32Interface != NULL)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   170
		iPortC32Interface->CompleteOutstandingRequest();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   171
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   172
	if (aPort == NULL)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   173
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   174
		iPortC32Interface = aPort;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   175
		_LOG_L4C1("<<CChannelMgrCmdData::SetOwner aPort was Null");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   176
		return;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   177
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   178
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   179
	TInt index;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   180
	index = iPortArray.Find(aPort);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   181
	if (index == KErrNotFound)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   182
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   183
		_LOG_L1C2("** Port %d not found **", aPort);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   184
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   185
	else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   186
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   187
		iPortC32Interface = aPort;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   188
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   189
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   190
	_LOG_L4C1("<<CChannelMgrCmdData::SetOwner");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   191
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   192
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   193
void CChannelMgrCmdData::SetupCmdChannelsForATCmdsL()
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   194
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   195
 * Set up and prepare the ports for AT commands
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   196
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   197
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   198
	_LOG_L4C1("CChannelMgrCmdData::SetupCmdChannelsForATCmdsL");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   199
#if defined DSAMPLE || defined H2
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   200
	_LOG_L4C1("Setting up for DSample/H2 (or P2Sample on Wins)");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   201
#endif
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   202
#ifdef P2SAMPLE
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   203
	_LOG_L4C1("Setting up for P2Sample on TARGET");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   204
#endif
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   205
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   206
	TBuf8<20> temp;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   207
	temp.Copy(KATCmdSetup);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   208
	iMux0710Protocol.Create0710DataFrames(temp, (TInt8)GetDlcNumber());
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   209
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   210
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   211
void CChannelMgrCmdData::ProcessRecvUihFrame(CCsyMsgBufBpFrame* aBpFrame)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   212
/**
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   213
 * Process a received UIH frame. Set flow control off if an "ok" is received
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   214
 * and we are still initializing.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   215
 *
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   216
 * @param aBpFrame - Pointer to the frame received from the baseband
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   217
 */
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   218
	{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   219
#ifdef _DEBUG
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   220
	// The dlcNum is only needed for logging when _DEBUG is set.
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   221
	// Otherwise we get a warning for ARM v5
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   222
	TInt dlcNum;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   223
	dlcNum = aBpFrame->GetDlcNum();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   224
#endif
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   225
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   226
	if(!iInitFinished)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   227
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   228
		if (iChannelState != ECsyChannelStateConnected)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   229
			{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   230
			_LOG_L4C1("Waiting for AT interpreter");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   231
			if (aBpFrame->iMsg.Find(KATInitialised) != KErrNotFound)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   232
				{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   233
				_LOG_L3C2E("AT interpreter ready [dlcNum=%d]", dlcNum);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   234
				iChannelState = ECsyChannelStateConnected;
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   235
				// Send initial AT command
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   236
				TRAP_IGNORE(SetupCmdChannelsForATCmdsL());
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   237
				}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   238
			else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   239
				{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   240
				_LOG_L3C2E("Throw away unexpected response dlcNum=%d", dlcNum);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   241
				}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   242
			}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   243
		else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   244
			{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   245
			_LOG_L4C1("Waiting for response to initial AT command");
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   246
			if (aBpFrame->iMsg.Find(_L8("OK")) != KErrNotFound)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   247
				{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   248
				_LOG_L1C2E("**** Init completed [dlcNum=%d] ****", dlcNum);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   249
				NotifyChannelReady();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   250
				ModemAndCsyToClientFlowCtrl(EFlowControlOff);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   251
				}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   252
			/*else if (aBpFrame->iMsg.Find(_L8("ERROR")) != KErrNotFound)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   253
				{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   254
				_LOG_L1C2E("**** Init completed [dlcNum=%d] ****ERROR****", dlcNum);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   255
				NotifyChannelReady();
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   256
				ModemAndCsyToClientFlowCtrl(EFlowControlOff);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   257
				}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   258
			*/
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   259
			else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   260
				{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   261
				_LOG_L3C2E("Throw away unexpected response dlcNum=%d", dlcNum);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   262
				}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   263
			}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   264
		iMux0710Protocol.AddFrameFreeQ(aBpFrame);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   265
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   266
	else if (iPortC32Interface)
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   267
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   268
		// don't need to add to the mux's queue if we are not defragging messages
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   269
		// simply add to the port object's queue
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   270
		// send frame to client
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   271
		iPortC32Interface->SendFrameToClient(aBpFrame);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   272
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   273
	else
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   274
		{
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   275
		_LOG_L1C2E("** NULL C32 PORT ** dlcNum=%d", dlcNum);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   276
		iMux0710Protocol.AddFrameFreeQ(aBpFrame);
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   277
		// MAF __ASSERT_DEBUG(EFalse, PANIC(KPanicIllegalState));
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   278
		}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   279
	}
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   280
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   281
8b72faa1200f 201024_02
hgs
parents:
diff changeset
   282