bluetooth/btexample/test/TestConsole/BTTestHelpers.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef BTTESTHELPERS_H_
       
    17 #define BTTESTHELPERS_H_
       
    18 
       
    19 #include <e32std.h>
       
    20 #include <e32cons.h>
       
    21 #include <e32base.h>
       
    22 #include <e32test.h>
       
    23 #include <f32file.h>
       
    24 
       
    25 #include <bt_sock.h>
       
    26 
       
    27 
       
    28 // L2CAP DEBUG P&S
       
    29 const TUint KUidBluetoothDebugPubSubKeyBase = 0x10272368; //	Range of 550 values registered
       
    30 
       
    31 
       
    32 // L2CAP debug P&S key values.
       
    33 const TUint KPropertyKeyBluetoothL2CapDebugBase = (KUidBluetoothDebugPubSubKeyBase + 0);
       
    34 
       
    35 const TUint KPropertyKeyBluetoothBasePDUAlloc	= (KUidBluetoothDebugPubSubKeyBase + 0x00);
       
    36 const TUint KPropertyKeyBluetoothBasePDUDel		= (KUidBluetoothDebugPubSubKeyBase + 0x01);
       
    37 const TUint KPropertyKeyBluetoothBasePDUPeak	= (KUidBluetoothDebugPubSubKeyBase + 0x02);
       
    38 
       
    39 const TUint KPropertyKeyBluetoothBFrameAlloc	= (KUidBluetoothDebugPubSubKeyBase + 0x10);
       
    40 const TUint KPropertyKeyBluetoothBFrameDel		= (KUidBluetoothDebugPubSubKeyBase + 0x11);
       
    41 const TUint KPropertyKeyBluetoothBFramePeak		= (KUidBluetoothDebugPubSubKeyBase + 0x12);
       
    42 const TUint KPropertyKeyBluetoothIFrameAlloc	= (KUidBluetoothDebugPubSubKeyBase + 0x20);
       
    43 const TUint KPropertyKeyBluetoothIFrameDel		= (KUidBluetoothDebugPubSubKeyBase + 0x21);
       
    44 const TUint KPropertyKeyBluetoothIFramePeak		= (KUidBluetoothDebugPubSubKeyBase + 0x22);
       
    45 const TUint KPropertyKeyBluetoothSFrameAlloc	= (KUidBluetoothDebugPubSubKeyBase + 0x30);
       
    46 const TUint KPropertyKeyBluetoothSFrameDel		= (KUidBluetoothDebugPubSubKeyBase + 0x31);
       
    47 const TUint KPropertyKeyBluetoothSFramePeak		= (KUidBluetoothDebugPubSubKeyBase + 0x32);
       
    48 const TUint KPropertyKeyBluetoothCFrameAlloc	= (KUidBluetoothDebugPubSubKeyBase + 0x40);
       
    49 const TUint KPropertyKeyBluetoothCFrameDel		= (KUidBluetoothDebugPubSubKeyBase + 0x41);
       
    50 const TUint KPropertyKeyBluetoothCFramePeak		= (KUidBluetoothDebugPubSubKeyBase + 0x42);
       
    51 const TUint KPropertyKeyBluetoothGFrameAlloc	= (KUidBluetoothDebugPubSubKeyBase + 0x50);
       
    52 const TUint KPropertyKeyBluetoothGFrameDel		= (KUidBluetoothDebugPubSubKeyBase + 0x51);
       
    53 const TUint KPropertyKeyBluetoothGFramePeak		= (KUidBluetoothDebugPubSubKeyBase + 0x52);
       
    54 const TUint KPropertyKeyBluetoothDataFrameAlloc	= (KUidBluetoothDebugPubSubKeyBase + 0x60);
       
    55 const TUint KPropertyKeyBluetoothDataFrameDel	= (KUidBluetoothDebugPubSubKeyBase + 0x61);
       
    56 const TUint KPropertyKeyBluetoothDataFramePeak	= (KUidBluetoothDebugPubSubKeyBase + 0x62);
       
    57 const TUint KPropertyKeyBluetoothFragFrameAlloc	= (KUidBluetoothDebugPubSubKeyBase + 0x70);
       
    58 const TUint KPropertyKeyBluetoothFragFrameDel	= (KUidBluetoothDebugPubSubKeyBase + 0x71);
       
    59 const TUint KPropertyKeyBluetoothFragFramePeak	= (KUidBluetoothDebugPubSubKeyBase + 0x72);
       
    60 
       
    61 const TUint KPropertyKeyBluetoothSDUAlloc		= (KUidBluetoothDebugPubSubKeyBase + 0x80);
       
    62 const TUint KPropertyKeyBluetoothSDUDel			= (KUidBluetoothDebugPubSubKeyBase + 0x81);
       
    63 const TUint KPropertyKeyBluetoothSDUPeak		= (KUidBluetoothDebugPubSubKeyBase + 0x82);
       
    64 
       
    65 const TUint KPropertyKeyBluetoothMuxerAlloc		= (KUidBluetoothDebugPubSubKeyBase + 0x90);
       
    66 const TUint KPropertyKeyBluetoothMuxerDel		= (KUidBluetoothDebugPubSubKeyBase + 0x91);
       
    67 const TUint KPropertyKeyBluetoothMuxerPeak		= (KUidBluetoothDebugPubSubKeyBase + 0x92);
       
    68 
       
    69 const TUint KPropertyKeyBluetoothLSAPAlloc		= (KUidBluetoothDebugPubSubKeyBase + 0xa0);
       
    70 const TUint KPropertyKeyBluetoothLSAPDel		= (KUidBluetoothDebugPubSubKeyBase + 0xa1);
       
    71 const TUint KPropertyKeyBluetoothLSAPPeak		= (KUidBluetoothDebugPubSubKeyBase + 0xa2);
       
    72 
       
    73 const TUint KPropertyKeyBluetoothASAPAlloc		= (KUidBluetoothDebugPubSubKeyBase + 0xb0);
       
    74 const TUint KPropertyKeyBluetoothASAPDel		= (KUidBluetoothDebugPubSubKeyBase + 0xb1);
       
    75 const TUint KPropertyKeyBluetoothASAPPeak		= (KUidBluetoothDebugPubSubKeyBase + 0xb2);
       
    76 
       
    77 const TUint KPropertyKeyBluetoothPSAPAlloc		= (KUidBluetoothDebugPubSubKeyBase + 0xc0);
       
    78 const TUint KPropertyKeyBluetoothPSAPDel		= (KUidBluetoothDebugPubSubKeyBase + 0xc1);
       
    79 const TUint KPropertyKeyBluetoothPSAPPeak		= (KUidBluetoothDebugPubSubKeyBase + 0xc2);
       
    80 
       
    81 const TUint KPropertyKeyBluetoothCommandAlloc	= (KUidBluetoothDebugPubSubKeyBase + 0xd0);
       
    82 const TUint KPropertyKeyBluetoothCommandDel		= (KUidBluetoothDebugPubSubKeyBase + 0xd1);
       
    83 const TUint KPropertyKeyBluetoothCommandPeak	= (KUidBluetoothDebugPubSubKeyBase + 0xd2);
       
    84 
       
    85 const TUint KPropertyKeyBluetoothL2DBGGetTimerGrpCID	= (KUidBluetoothDebugPubSubKeyBase + 0x100);
       
    86 const TUint KPropertyKeyBluetoothL2DBGSetTimerGrpCID	= (KUidBluetoothDebugPubSubKeyBase + 0x101);
       
    87 
       
    88 const TUint KPropertyKeyBluetoothL2DBGMinPDUGetTime		= (KUidBluetoothDebugPubSubKeyBase + 0x110);
       
    89 const TUint KPropertyKeyBluetoothL2DBGMaxPDUGetTime		= (KUidBluetoothDebugPubSubKeyBase + 0x111);
       
    90 
       
    91 const TUint KPropertyKeyBluetoothL2DBGMinPDUSentTime	= (KUidBluetoothDebugPubSubKeyBase + 0x112);
       
    92 const TUint KPropertyKeyBluetoothL2DBGMaxPDUSentTime	= (KUidBluetoothDebugPubSubKeyBase + 0x113);
       
    93 
       
    94 const TUint KPropertyKeyBluetoothL2DBGAvePDUGetTime		= (KUidBluetoothDebugPubSubKeyBase + 0x114);
       
    95 const TUint KPropertyKeyBluetoothL2DBGAvePDUSentTime	= (KUidBluetoothDebugPubSubKeyBase + 0x115);
       
    96 
       
    97 
       
    98 const TUint KPropertyKeyBluetoothQueuedSDUFlushedCounter		= (KUidBluetoothDebugPubSubKeyBase + 0x200);
       
    99 const TUint KPropertyKeyBluetoothPartialSentSDUFlushedCounter	= (KUidBluetoothDebugPubSubKeyBase + 0x201);
       
   100 const TUint KPropertyKeyBluetoothSentSDUFlushedCounter			= (KUidBluetoothDebugPubSubKeyBase + 0x202);
       
   101 const TUint KPropertyKeyBluetoothFlushedPDUMuxerResend			= (KUidBluetoothDebugPubSubKeyBase + 0x203);
       
   102 const TUint KPropertyKeyBluetoothFlushedPDUDataFlowResend		= (KUidBluetoothDebugPubSubKeyBase + 0x204);
       
   103 const TUint KPropertyKeyBluetoothFlushedPDUIFrame				= (KUidBluetoothDebugPubSubKeyBase + 0x205);
       
   104 const TUint KPropertyKeyBluetoothIncompleteErroredSDUReceived	= (KUidBluetoothDebugPubSubKeyBase +  0x206);
       
   105 
       
   106 
       
   107 
       
   108 class CBTTestConnection;
       
   109 class CBTTestConsole;
       
   110 
       
   111 
       
   112 class TBTQueuedBasebandEventNotification : public TBTBasebandEventNotification
       
   113 /**
       
   114 	Extends via aggregation public TBTBasebandEventNotification class to make it queue-able
       
   115 **/
       
   116 	{
       
   117 public:
       
   118 	TBTQueuedBasebandEventNotification(const TBTBasebandEventNotification& aEvent)
       
   119 		: TBTBasebandEventNotification(aEvent) {};
       
   120 
       
   121 public:
       
   122 	TSglQueLink iLink;
       
   123 	};
       
   124 
       
   125 class TConnProfile
       
   126 	{
       
   127 public:
       
   128 	enum TConnRole
       
   129 		{
       
   130 		ENone,
       
   131 		EMaster,
       
   132 		ESlave,
       
   133 		ENumRoles
       
   134 		};
       
   135 
       
   136 	enum TConnMode
       
   137 		{
       
   138 		EActive,
       
   139 		ESniff,
       
   140 		EPark,
       
   141 		EHold,
       
   142 		EExplicitActive,
       
   143 		ENumModes
       
   144 		};
       
   145 
       
   146 	enum TConnState
       
   147 		{
       
   148 		EConnIdle,
       
   149 		EConnListening,
       
   150 		EConnListeningAccept,
       
   151 		EConnAccepting,
       
   152 		EConnConnecting,
       
   153 		EConnConnected,
       
   154 		EConnDisconnected,
       
   155 		EConnServerDisconnected,
       
   156 		EConnFailed,
       
   157 		ENumStates
       
   158 		};
       
   159 
       
   160 
       
   161 	enum TDataState
       
   162 		{
       
   163 		EDataIdle,
       
   164 		EDataDialog1,
       
   165 		EDataDialog2,
       
   166 		EDataFailed,
       
   167 		EDataSend,
       
   168 		EDataRecv,
       
   169 		EDataRecvAny,
       
   170 		EDataSendReceive,
       
   171 		EDataSendOneShot,
       
   172 		EDataRecvOneShot,
       
   173 		ENumDataStates,
       
   174 		ERecvContinuationData
       
   175 		};
       
   176 
       
   177 	TConnProfile();
       
   178 
       
   179 
       
   180 	TInt		iPhyLinkIx;
       
   181 	TConnState	iState;
       
   182 	TConnRole	iRole;
       
   183 	TUint		iPackets;
       
   184 	TUint		iMaxSlots;
       
   185 	//TBTLinkMode	iMode;
       
   186 	TConnMode	iMode2;
       
   187 	TUint		iModeAllowed;
       
   188 	TBool		iSwitchAllowed;
       
   189 	TBool		iEncryption;
       
   190 	TDataState	iData;
       
   191 	TPoint		iDataCursor;
       
   192 
       
   193 	TInt		iAccepterIx;
       
   194 
       
   195 	TBool		iIsSocketBased;
       
   196 
       
   197 	TBTSockAddr	iRemoteBTAddr;
       
   198 	TInt 		iErrorCode;
       
   199 
       
   200 	TUint16		iSendingMTUSize;
       
   201 	TUint16		iRecvMTUSize;
       
   202 
       
   203 	TBool		iIsStreamProtocol;
       
   204 	TBool		iIsSCO;
       
   205 	TBool		iAutoSniffActive;
       
   206 
       
   207 	static const TDesC& StateName(TConnState aState);
       
   208 	static const TDesC& RoleName(TConnRole aState);
       
   209 	static const TDesC& ModeName(TBTLinkMode aState);
       
   210 	static const TDesC& ModeName(TConnProfile::TConnMode aState);
       
   211 	static const TDesC& DataStateName(TDataState aState);
       
   212 	};
       
   213 
       
   214 
       
   215 class CBTTestConnectionNotifier : public CActive
       
   216 	{
       
   217 public:
       
   218 	static CBTTestConnectionNotifier* NewL(CBTTestConnection & aParent);
       
   219 	static CBTTestConnectionNotifier* NewLC(CBTTestConnection & aParent);
       
   220 	CBTTestConnectionNotifier(CBTTestConnection & aParent);
       
   221 
       
   222 	void CancelRequests();
       
   223 	virtual ~CBTTestConnectionNotifier();
       
   224 
       
   225 	void RequestNotifications(TUint32 aNotifications, RBTPhysicalLinkAdapter & aPhyAdapter);
       
   226 
       
   227 private:
       
   228 	void DoCancel();
       
   229 	void RunL();
       
   230 
       
   231 	CBTTestConnection& iParent;
       
   232 	TBTBasebandEvent iEvent;
       
   233 	TBTBasebandEventNotification iNotification;
       
   234 	};
       
   235 
       
   236 
       
   237 class CBTTestConnection;
       
   238 
       
   239 // Thin handler class used to solver the issue of name clashes in BT API.
       
   240 class TBTTestConnectionSyncLinkHandler : public MBluetoothSynchronousLinkNotifier
       
   241 	{
       
   242 public:
       
   243 	TBTTestConnectionSyncLinkHandler(CBTTestConnection& aTestConnection) : iTestConnection(aTestConnection) {};
       
   244 
       
   245 	// MBluetoothSynchronousLinkNotifier definitions
       
   246 	inline void HandleSetupConnectionCompleteL(TInt aErr);
       
   247 	inline void HandleDisconnectionCompleteL(TInt aErr);
       
   248 	inline void HandleAcceptConnectionCompleteL(TInt aErr);
       
   249 	inline void HandleSendCompleteL(TInt aErr);
       
   250 	inline void HandleReceiveCompleteL(TInt aErr);
       
   251 
       
   252 private:
       
   253 	CBTTestConnection& iTestConnection;
       
   254 	};
       
   255 
       
   256 
       
   257 
       
   258 class CBTTestConnection : public CBase,
       
   259                           public MBluetoothSocketNotifier,
       
   260 						  public MBluetoothPhysicalLinksNotifier,
       
   261 						  public MBluetoothPhysicalLinkMetricsObserver
       
   262 	{
       
   263 public:
       
   264 	enum TBTTestConnectionPanic
       
   265 		{
       
   266 		EBTConsoleNoSocketForSocketBasedConnection,
       
   267 		EBTConsoleShutdownCalledOnNonCBluetoothSocket,
       
   268 		EBTConsoleDisconnectCalledOnCBluetoothSocket,
       
   269 		EBTConsoleInvalidLowPowerMode,
       
   270 		EBTConsoleActivateActiveRequesterCalledOnCBluetoothSocket,
       
   271 		};
       
   272 
       
   273 	// METHODS
       
   274 	static CBTTestConnection* NewL(CBTTestConsole* aConsole, RSocketServ& aSocketServer);
       
   275 	static CBTTestConnection* NewLC(CBTTestConsole* aConsole, RSocketServ& aSocketServer);
       
   276 
       
   277 	CBTTestConnection(CBTTestConsole* aConsole, RSocketServ& aSocketServer);
       
   278 	virtual ~CBTTestConnection();
       
   279 
       
   280 	TInt CreateListeningSocket(TUint16 aPort, TDesC16 const& aProtocolName, TBTServiceSecurity & aSecurity, TBool aUseDefaultConfig);
       
   281 	TInt Accept(CBluetoothSocket& aListeningSocket);
       
   282 
       
   283 	TInt ConnectToPeer(TBTDevAddr &aAddr, TUint16 aPort, TDesC16 const& aProtocolName, TBTServiceSecurity & aSecurity, TBool aUseDefaultConfig);
       
   284 	TInt ConnectUsingBAP(TBTDevAddr &aAddr);
       
   285 
       
   286 	TInt SetupPhysAdapter();
       
   287 
       
   288 	void AcceptComplete(TInt result);
       
   289 	void UpdateProfileAcceptComplete();
       
   290 	void ConnectComplete(TInt result);
       
   291 	void ConnectBAPComplete(TInt result);
       
   292 
       
   293 	TInt ConfigureLink(TBool aUseIoctl);
       
   294 
       
   295 	TInt SendEchoRequest(TInt aPayloadSize);
       
   296 
       
   297 	void CancelAccept();
       
   298 	void CancelConnect();
       
   299 
       
   300 	void Close(RSocket& aSocket);
       
   301 	TInt ShutdownSocket(RSocket::TShutdown aShutdownType);
       
   302 	TInt DisconnectLink();
       
   303 	TInt IncreaseRTXTimer(TUint aTime);
       
   304 
       
   305 	void RequestNotification(TUint32 aNotification);
       
   306 	void OutputEventNotification(TBTBasebandEventNotification & aNotification);
       
   307 	void OutputOneShotEventNotification(TBTBasebandEventNotification & aNotification);
       
   308 	void CancelBasebandNotifyRequest();
       
   309 
       
   310 	TInt ChangeSupportedPacketTypes(TUint16 aPacketTypes);
       
   311 
       
   312 	TInt RoleChangeAllowed(TBool aAllowed);
       
   313 	TInt RequestRoleChange(TBTBasebandRole aRole);
       
   314 	TInt RequestAuthentication();
       
   315 
       
   316 	void StartACLData();
       
   317 	void StopACLData();
       
   318 
       
   319 	TBool SendComplete(TInt aIndex, TInt aStatus);
       
   320 	TBool RecvComplete(TInt aIndex, TInt aStatus, TInt aDataErr);
       
   321 
       
   322 	TInt RequestLPM(TConnProfile::TConnMode aLPM);
       
   323 	TInt SupportLPM(TBTLinkMode aLPM);
       
   324 	TInt PreventLPM(TBTLinkMode aLPM);
       
   325 	TInt RemoveLPMRequest();
       
   326 
       
   327 	TInt KillAllLinks(TInt aReason);
       
   328 	TInt KillLink(TInt aReason);
       
   329 
       
   330 	TInt ToggleAutoSniff();
       
   331 
       
   332 	TInt PassiveSCO();
       
   333 	TInt ActiveSCO(TBTDevAddr& aAddr);
       
   334 
       
   335 	TInt PassiveESCO();
       
   336 	TInt ActiveESCO(TBTDevAddr& aAddr);
       
   337 
       
   338 	TInt SendMTUIoctl(TBool aIsIncomingMTU, TUint16 aNewValue);
       
   339 	TInt SendPretendIncomingSduQFullIoctl(TBool aPretendIncomingSduQFull);
       
   340 	TInt GetChannelMode(TL2CapChannelMode& aMode);
       
   341 	TInt GetLocalPSM(TL2CAPPort& aPsm);
       
   342 
       
   343 	TInt RecvOneShotData();
       
   344 	//Send Data filled with 0123456789012... sequences
       
   345 	TInt SendOneShotData(TUint16 aDataSize);
       
   346 
       
   347 	//Receive part of data according buffer size aDataSize and check continuation in the mean time
       
   348 	TInt RecvContinuationData(TUint16 aDataSize);
       
   349 
       
   350 	TInt SetLocalModemStatus(TUint8 aModemStatus);
       
   351 	TInt RequestRFCommConfChgInd();
       
   352 
       
   353 	void StartPlmDisplayL();
       
   354 	void StopPlmDisplayL();
       
   355 
       
   356 	void StoreEvent(TBTBasebandEventNotification & aEvent);
       
   357 	TBool PrintEvents(TInt aCurrentEvent, TInt aNumEvents);
       
   358 	void ClearEventStore();
       
   359 	TInt PrintBTPhyConnections();
       
   360 	void StartLinkMonitorL();
       
   361 	void StopLinkMonitor();
       
   362 	void DoMonitor();
       
   363 
       
   364 	CBluetoothSocket& GetBTSocket() const { return *iBTSocket; };
       
   365 	TInt GetRemoteName(TNameEntry& aNameEntry);
       
   366 
       
   367 	// CBluetoothSocket MBluetoothSocketNotifier definitions
       
   368 	void HandleConnectCompleteL(TInt aErr);
       
   369 	void HandleAcceptCompleteL(TInt aErr);
       
   370 	void HandleShutdownCompleteL(TInt aErr);
       
   371 	void HandleSendCompleteL(TInt aErr);
       
   372 	void HandleReceiveCompleteL(TInt aErr);
       
   373 	void HandleIoctlCompleteL(TInt aErr);
       
   374 	void HandleActivateBasebandEventNotifierCompleteL(TInt aErr, TBTBasebandEventNotification& aEventNotification);
       
   375 
       
   376 	// MBluetoothPhysicalLinksNotifier definitions
       
   377 	void HandleCreateConnectionCompleteL(TInt aErr);
       
   378 	void HandleDisconnectCompleteL(TInt aErr);
       
   379 	void HandleDisconnectAllCompleteL(TInt aErr);
       
   380 
       
   381 	// MBluetoothSynchronousLinkNotifier definitions
       
   382 	void HandleSyncSetupConnectionCompleteL(TInt aErr);
       
   383 	void HandleSyncDisconnectionCompleteL(TInt aErr);
       
   384 	void HandleSyncAcceptConnectionCompleteL(TInt aErr);
       
   385 	void HandleSyncSendCompleteL(TInt aErr);
       
   386 	void HandleSyncReceiveCompleteL(TInt aErr);
       
   387 
       
   388 	// MBluetoothPhysicalLinkMetricsObserver definitions
       
   389 	void MbplmoRssiChanged(TInt8 aRssi);
       
   390 	void MbplmoLinkQualityChanged(TUint8 aLinkQuality);
       
   391 	void MbplmoFailedContactCounterChanged(TUint16 aFailedContactCounter);
       
   392 	void MbplmoTransmitPowerLevelChanged(TInt8 aTransmitPowerLevel);
       
   393 	void MbplmoError(TInt aError);
       
   394 
       
   395 	void ContinueDialog();
       
   396 	void DoSend(TUint8 aVal);
       
   397 	void DoRecv();
       
   398 	TInt CheckRecvData();
       
   399 
       
   400 	static TInt MonitorCB(TAny* aCBTTestConnection);
       
   401 
       
   402 	void Panic(TBTTestConnectionPanic aPanic);
       
   403 
       
   404 // ----------------------------------------------------------------------------
       
   405 //							DEBUG METHODS
       
   406 // ----------------------------------------------------------------------------
       
   407 #ifdef _DEBUG
       
   408 	TInt DataPlaneConfig();
       
   409 	TInt IssueManualFlush();
       
   410 #endif
       
   411 
       
   412 
       
   413 protected:
       
   414 private:
       
   415 
       
   416 // DATA
       
   417 public:
       
   418 	TConnProfile iProfile;
       
   419 	TUint iDataDialogCount;
       
   420 
       
   421 protected:
       
   422 	void ConstructL();
       
   423 private:
       
   424 	enum TCurrentIOCTL
       
   425 		{
       
   426 		EDontCare,
       
   427 		ERFCOMMConfigInd,
       
   428 		};
       
   429 
       
   430 	TTime iTime;
       
   431 
       
   432 	CBTTestConsole*				iParent;
       
   433 	RSocketServ&				iSocketServer;
       
   434 
       
   435 	CBTTestConnectionNotifier	iNotifier;
       
   436 
       
   437 	CBluetoothSocket*			iBTSocket;
       
   438 	CBluetoothPhysicalLinks*	iBTPhyLinks;
       
   439 	CBluetoothSynchronousLink*  iBTSyncLink;
       
   440 	TBTTestConnectionSyncLinkHandler iSyncLinkHandler;
       
   441 
       
   442 	RBTPhysicalLinkAdapter		iPhyLinkAdapter;
       
   443 
       
   444 	TBuf8<0xffff>				iRecvBuffer;
       
   445 	TBuf8<0xffff>				iSendBuffer;
       
   446 	TBuf8<0xffff>				iStreamRecvBuffer;
       
   447 
       
   448 	TBuf8<672>					iEchoDataBuffer;
       
   449 	TPckgBuf<TUint16>			i16bitIoctlBuffer;
       
   450 	TPckgBuf<TBool>				iBoolIoctlBuffer;
       
   451 	TSockXfrLength				iRecvBufferLength;
       
   452 	TL2CapConfigPkg 			iConfigPkg;
       
   453 
       
   454 	TSglQue<TBTQueuedBasebandEventNotification> iEventNotificationQueue;
       
   455 	TCurrentIOCTL				iCurrentIOCTL;
       
   456 
       
   457 	RBuf8 iCustomSendRecvBuffer;
       
   458 	//Record the last digit from the former sequence, initial value is -1
       
   459 	TInt iTailDigit;
       
   460 	//Count the total number of bytes received for each UDP transfer
       
   461 	TInt iTotalRecvByte;
       
   462 
       
   463 	TL2CAPSockAddr				iPeerSocketAddr;
       
   464 	TBool						iAutoSniff;
       
   465 	CPeriodic*					iPeriodic;
       
   466 	CBluetoothPhysicalLinkMetrics*		iMetrics;
       
   467 	CConsoleBase*				iMetricsConsole;
       
   468 	TUint						iLogTime;
       
   469 	};
       
   470 
       
   471 
       
   472 inline void TBTTestConnectionSyncLinkHandler::HandleSetupConnectionCompleteL(TInt aErr)
       
   473 	{
       
   474 	iTestConnection.HandleSyncSetupConnectionCompleteL(aErr);
       
   475 	}
       
   476 
       
   477 inline void TBTTestConnectionSyncLinkHandler::HandleDisconnectionCompleteL(TInt aErr)
       
   478 	{
       
   479 	iTestConnection.HandleSyncDisconnectionCompleteL(aErr);
       
   480 	}
       
   481 
       
   482 inline void TBTTestConnectionSyncLinkHandler::HandleAcceptConnectionCompleteL(TInt aErr)
       
   483 	{
       
   484 	iTestConnection.HandleSyncAcceptConnectionCompleteL(aErr);
       
   485 	}
       
   486 
       
   487 inline void TBTTestConnectionSyncLinkHandler::HandleSendCompleteL(TInt aErr)
       
   488 	{
       
   489 	iTestConnection.HandleSyncSendCompleteL(aErr);
       
   490 	}
       
   491 
       
   492 inline void TBTTestConnectionSyncLinkHandler::HandleReceiveCompleteL(TInt aErr)
       
   493 	{
       
   494 	iTestConnection.HandleSyncReceiveCompleteL(aErr);
       
   495 	}
       
   496 
       
   497 
       
   498 #endif