# HG changeset patch
# User hgs
# Date 1287126357 -28800
# Node ID 4dc88a4ac6f4cc99e8aea2693ea52cdad788deb3
# Parent 866b4af7ffbe9482ac682986d23b8fd87d4e8019
201041_02
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 layers.sysdef.xml
--- a/layers.sysdef.xml Tue Sep 28 20:14:08 2010 +0800
+++ b/layers.sysdef.xml Fri Oct 15 15:05:57 2010 +0800
@@ -83,8 +83,6 @@
-
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/inc/DunAtCmdPusher.h
--- a/localconnectivityservice/dun/atext/inc/DunAtCmdPusher.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/inc/DunAtCmdPusher.h Fri Oct 15 15:05:57 2010 +0800
@@ -138,9 +138,9 @@
* Stops AT command handling
*
* @since TB9.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
/**
* Manages request to abort command handling
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/inc/DunAtEcomListen.h
--- a/localconnectivityservice/dun/atext/inc/DunAtEcomListen.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/inc/DunAtEcomListen.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -107,9 +107,9 @@
* Stops waiting for Ecom plugin install/uninstall/version status changes
*
* @since TB9.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -161,11 +161,6 @@
MDunAtEcomListen* iCallback;
/**
- * Current state of ECom interface listening: active or inactive
- */
- TDunState iEcomListenState;
-
- /**
* UID of the installed, uninstalled or changed plugin
*/
TUid iPluginUid;
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/inc/DunAtModeListen.h
--- a/localconnectivityservice/dun/atext/inc/DunAtModeListen.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/inc/DunAtModeListen.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -99,9 +99,9 @@
* Stops monitoring for mode status changes
*
* @since TB9.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -153,11 +153,6 @@
MDunAtModeListen* iCallback;
/**
- * Current state of mode listening: active or inactive
- */
- TDunState iModeListenState;
-
- /**
* Stored mode status change
*/
TUint iMode;
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/inc/DunAtNvramListen.h
--- a/localconnectivityservice/dun/atext/inc/DunAtNvramListen.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/inc/DunAtNvramListen.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -78,9 +78,9 @@
* Stops waiting for NVRAM status changes
*
* @since TB9.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -132,11 +132,6 @@
RATExtCommon* iAtCmdExtCommon;
/**
- * Current state of NVRAM status change listening; active or inactive
- */
- TDunState iNvramHandleState;
-
- /**
* Buffer for NVRAM
*/
TBuf8 iNvramBuffer;
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/inc/DunAtUrcHandler.h
--- a/localconnectivityservice/dun/atext/inc/DunAtUrcHandler.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/inc/DunAtUrcHandler.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -79,9 +79,9 @@
* Stops waiting for an incoming URC message
*
* @since TB9.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
/**
* UID of the owning plugin
@@ -153,11 +153,6 @@
MDunStreamManipulator* iStreamCallback;
/**
- * Current state of URC message handling: active or inactive
- */
- TDunState iUrcHandleState;
-
- /**
* Buffer for receiving
*/
TBuf8 iRecvBuffer;
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp
--- a/localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/src/DunAtCmdHandler.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -307,14 +307,13 @@
{
FTRACE(FPrint( _L("CDunAtCmdHandler::StopUrc()") ));
TInt i;
- TInt retVal = KErrNone;
TInt count = iUrcHandlers.Count();
for ( i=0; iStop();
+ iUrcHandlers[i]->Stop();
}
FTRACE(FPrint( _L("CDunAtCmdHandler::StopUrc() complete") ));
- return retVal;
+ return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -1385,7 +1384,7 @@
// We still need to save the iParseInfo.iLimit and skip non-delimiter characters.
if ( aCharacter == '=' )
{
- if ( iParseInfo.iLimit < 0 ) // Only first the first '"'
+ if ( iParseInfo.iLimit < 0 ) // Only the first '"'
{
iParseInfo.iLimit = aEndIndex - aStartIndex;
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/src/DunAtCmdPusher.cpp
--- a/localconnectivityservice/dun/atext/src/DunAtCmdPusher.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/src/DunAtCmdPusher.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -118,7 +118,6 @@
FTRACE(FPrint( _L("CDunAtCmdPusher::IssueRequest() (in queue!) complete") ));
return KErrGeneral;
}
- iStatus = KRequestPending;
iAtPushState = EDunStateAtCmdPushing;
iAtCmdExt->HandleCommand( iStatus,
aInput,
@@ -134,22 +133,13 @@
// Stops AT command handling
// ---------------------------------------------------------------------------
//
-TInt CDunAtCmdPusher::Stop()
+void CDunAtCmdPusher::Stop()
{
FTRACE(FPrint( _L("CDunAtCmdPusher::Stop()") ));
SetEndOfCmdLine();
- if ( iAtPushState != EDunStateAtCmdPushing )
- {
- FTRACE(FPrint( _L("CDunAtCmdHandler::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- // As the EDunStateAtCmdHandling can be set even when the actual request
- // has completed (when replying with NotifyDataPushComplete() and setting
- // idle eventually), cancel the actual operation in DoCancel()
Cancel();
iAtPushState = EDunStateIdle;
FTRACE(FPrint( _L("CDunAtCmdPusher::Stop() complete") ));
- return KErrNone;
}
// ---------------------------------------------------------------------------
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/src/DunAtEcomListen.cpp
--- a/localconnectivityservice/dun/atext/src/DunAtEcomListen.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/src/DunAtEcomListen.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -80,13 +80,11 @@
TInt CDunAtEcomListen::IssueRequest()
{
FTRACE(FPrint( _L("CDunAtEcomListen::IssueRequest()") ));
- if ( iEcomListenState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunAtEcomListen::IssueRequest() (not ready) complete") ));
return KErrNotReady;
}
- iStatus = KRequestPending;
- iEcomListenState = EDunStateEcomListening;
iAtCmdExt->ReceiveEcomPluginChange( iStatus, iPluginUidPckg, iEcomTypePckg );
SetActive();
FTRACE(FPrint( _L("CDunAtEcomListen::IssueRequest() complete") ));
@@ -97,19 +95,11 @@
// Stops waiting for Ecom plugin install/uninstall/version status changes
// ---------------------------------------------------------------------------
//
-TInt CDunAtEcomListen::Stop()
+void CDunAtEcomListen::Stop()
{
FTRACE(FPrint( _L("CDunAtEcomListen::Stop()") ));
- if ( iEcomListenState != EDunStateEcomListening )
- {
- FTRACE(FPrint( _L("CDunAtEcomListen::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- iAtCmdExt->CancelReceiveEcomPluginChange();
Cancel();
- iEcomListenState = EDunStateIdle;
FTRACE(FPrint( _L("CDunAtEcomListen::Stop() complete") ));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -150,7 +140,6 @@
{
// Don't initialize iAtCmdExt here (it is set through NewL)
// Don't initialize iCallback here (it is set through NewL)
- iEcomListenState = EDunStateIdle;
iPluginUid = TUid::Null();
}
@@ -162,7 +151,6 @@
void CDunAtEcomListen::RunL()
{
FTRACE(FPrint( _L("CDunAtEcomListen::RunL()") ));
- iEcomListenState = EDunStateIdle;
TInt retTemp = iStatus.Int();
if ( retTemp != KErrNone )
{
@@ -195,5 +183,6 @@
void CDunAtEcomListen::DoCancel()
{
FTRACE(FPrint( _L("CDunAtEcomListen::DoCancel()") ));
+ iAtCmdExt->CancelReceiveEcomPluginChange();
FTRACE(FPrint( _L("CDunAtEcomListen::DoCancel() complete") ));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/src/DunAtModeListen.cpp
--- a/localconnectivityservice/dun/atext/src/DunAtModeListen.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/src/DunAtModeListen.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -78,13 +78,11 @@
TInt CDunAtModeListen::IssueRequest()
{
FTRACE(FPrint( _L("CDunAtModeListen::IssueRequest()" )));
- if ( iModeListenState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunAtModeListen::IssueRequest() (not ready) complete" ) ));
return KErrNotReady;
}
- iStatus = KRequestPending;
- iModeListenState = EDunStateModeListening;
iAtCmdExtCommon->ReceiveModeStatusChange( iStatus, iModePckg );
SetActive();
FTRACE(FPrint( _L("CDunAtModeListen::IssueRequest() complete" )));
@@ -95,19 +93,11 @@
// Stops monitoring for mode status changes
// ---------------------------------------------------------------------------
//
-TInt CDunAtModeListen::Stop()
+void CDunAtModeListen::Stop()
{
FTRACE(FPrint( _L("CDunAtModeListen::Stop()" )));
- if ( iModeListenState != EDunStateModeListening )
- {
- FTRACE(FPrint( _L("CDunAtModeListen::Stop() (not ready) complete" ) ));
- return KErrNotReady;
- }
- iAtCmdExtCommon->CancelReceiveModeStatusChange();
Cancel();
- iModeListenState = EDunStateIdle;
FTRACE(FPrint( _L("CDunAtModeListen::Stop() complete" )));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -147,7 +137,6 @@
{
// Don't initialize iAtCmdExtCommon here (it is set through NewL)
// Don't initialize iCallback here (it is set through NewL)
- iModeListenState = EDunStateIdle;
iMode = 0;
}
@@ -159,7 +148,6 @@
void CDunAtModeListen::RunL()
{
FTRACE(FPrint( _L("CDunAtModeListen::RunL()") ));
- iModeListenState = EDunStateIdle;
TInt retTemp = iStatus.Int();
if ( retTemp != KErrNone )
{
@@ -180,5 +168,6 @@
void CDunAtModeListen::DoCancel()
{
FTRACE(FPrint( _L("CDunAtModeListen::DoCancel()") ));
+ iAtCmdExtCommon->CancelReceiveModeStatusChange();
FTRACE(FPrint( _L("CDunAtModeListen::DoCancel() complete") ));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/src/DunAtNvramListen.cpp
--- a/localconnectivityservice/dun/atext/src/DunAtNvramListen.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/src/DunAtNvramListen.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -79,7 +79,7 @@
TInt CDunAtNvramListen::IssueRequest()
{
FTRACE(FPrint( _L("CDunAtNvramListen::IssueRequest()") ));
- if ( iNvramHandleState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunAtNvramListen::IssueRequest() (not ready) complete") ));
return KErrNotReady;
@@ -90,8 +90,6 @@
iAtCmdExt->BroadcastNvramStatusChange( iNvramBuffer );
iStarted = ETrue;
}
- iStatus = KRequestPending;
- iNvramHandleState = EDunStateNvramListening;
iAtCmdExtCommon->ReceiveNvramStatusChange( iStatus, iNvramBuffer );
SetActive();
FTRACE(FPrint( _L("CDunAtNvramListen::IssueRequest() complete") ));
@@ -102,20 +100,12 @@
// Stops waiting for NVRAM status changes
// ---------------------------------------------------------------------------
//
-TInt CDunAtNvramListen::Stop()
+void CDunAtNvramListen::Stop()
{
FTRACE(FPrint( _L("CDunAtNvramListen::Stop()") ));
- if ( iNvramHandleState != EDunStateNvramListening )
- {
- FTRACE(FPrint( _L("CDunAtNvramListen::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- iAtCmdExtCommon->CancelReceiveNvramStatusChange();
Cancel();
- iNvramHandleState = EDunStateIdle;
FTRACE(FPrint( _L("CDunAtNvramListen::Stop() complete") ));
// Note: Don't mark iStarted to EFalse here!
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -154,7 +144,6 @@
{
// Don't initialize iAtCmdExt here (it is set through NewL)
// Don't initialize iAtCmdExtCommon here (it is set through NewL)
- iNvramHandleState = EDunStateIdle;
iStarted = EFalse;
}
@@ -166,7 +155,6 @@
void CDunAtNvramListen::RunL()
{
FTRACE(FPrint( _L("CDunAtNvramListen::RunL()") ));
- iNvramHandleState = EDunStateIdle;
TInt retTemp = iStatus.Int();
if ( retTemp != KErrNone )
{
@@ -186,5 +174,6 @@
void CDunAtNvramListen::DoCancel()
{
FTRACE(FPrint( _L("CDunAtNvramListen::DoCancel()") ));
+ iAtCmdExtCommon->CancelReceiveNvramStatusChange();
FTRACE(FPrint( _L("CDunAtNvramListen::DoCancel() complete") ));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/atext/src/DunAtUrcHandler.cpp
--- a/localconnectivityservice/dun/atext/src/DunAtUrcHandler.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/atext/src/DunAtUrcHandler.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -84,13 +84,11 @@
TInt CDunAtUrcHandler::IssueRequest()
{
FTRACE(FPrint( _L("CDunAtUrcHandler::IssueRequest()") ));
- if ( iUrcHandleState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunAtUrcHandler::IssueRequest() (not ready) complete") ));
return KErrNotReady;
}
- iStatus = KRequestPending;
- iUrcHandleState = EDunStateAtUrcHandling;
iAtCmdExt->ReceiveUnsolicitedResult( iStatus, iRecvBuffer, iOwnerUidPckg );
SetActive();
// Next mark ownership
@@ -112,20 +110,12 @@
// Stops waiting for an incoming URC message
// ---------------------------------------------------------------------------
//
-TInt CDunAtUrcHandler::Stop()
+void CDunAtUrcHandler::Stop()
{
FTRACE(FPrint( _L("CDunAtUrcHandler::Stop()") ));
- if ( iUrcHandleState != EDunStateAtUrcHandling )
- {
- FTRACE(FPrint( _L("CDunAtUrcHandler::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- iAtCmdExt->CancelReceiveUnsolicitedResult( iOwnerUid );
Cancel();
- iUrcHandleState = EDunStateIdle;
FTRACE(FPrint( _L("CDunAtUrcHandler::Stop() complete") ));
// Note: Don't mark iStarted to EFalse here as it is used to get the UID
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -173,7 +163,6 @@
void CDunAtUrcHandler::Initialize()
{
// Don't initialize iStreamCallback here (it is set through NewL)
- iUrcHandleState = EDunStateIdle;
iOwnerUid = TUid::Null();
iStarted = EFalse;
}
@@ -186,7 +175,6 @@
void CDunAtUrcHandler::RunL()
{
FTRACE(FPrint( _L("CDunAtUrcHandler::RunL()") ));
- iUrcHandleState = EDunStateIdle;
TInt retTemp = iStatus.Int();
if ( retTemp != KErrNone )
{
@@ -214,6 +202,7 @@
void CDunAtUrcHandler::DoCancel()
{
FTRACE(FPrint( _L("CDunAtUrcHandler::DoCancel()") ));
+ iAtCmdExt->CancelReceiveUnsolicitedResult( iOwnerUid );
FTRACE(FPrint( _L("CDunAtUrcHandler::DoCancel() complete") ));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/plugins/inc/bt/DunBtListen.h
--- a/localconnectivityservice/dun/plugins/inc/bt/DunBtListen.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/plugins/inc/bt/DunBtListen.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -25,12 +25,6 @@
class TBtPortEntity;
-enum TBtListenState
- {
- EBtListenStateIdle,
- EBtListenStateListening
- };
-
/**
* DUN Bluetooth plugin's listener class
* This class starts listening on a created BT RFComm channel and notifies
@@ -86,9 +80,9 @@
* Stops listening
*
* @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -223,11 +217,6 @@
TBtPortEntity& iEntity;
/**
- * Current state of listening: active or inactive
- */
- TBtListenState iListenState;
-
- /**
* Listener socket that will listen for activity in RFComm channel
*/
RSocket iListenSocket;
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/plugins/inc/usb/DunUsbConfig.h
--- a/localconnectivityservice/dun/plugins/inc/usb/DunUsbConfig.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/plugins/inc/usb/DunUsbConfig.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -23,12 +23,6 @@
#include
#include "DunPlugin.h"
-enum TUsbConfigState
- {
- EUsbConfigStateIdle,
- EUsbConfigStateWaiting
- };
-
/**
* Notification interface class to report USB ACM configuration change
*
@@ -117,9 +111,9 @@
* Stops listening for ACM configuration changes
*
* @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -175,11 +169,6 @@
*/
MDunUsbConfig* iCallback;
- /**
- * Current state of configuration waiting: active or inactive
- */
- TUsbConfigState iConfigState;
-
/*
* Protocol number of USB ACM to which listening is done
*/
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/plugins/inc/usb/DunUsbListen.h
--- a/localconnectivityservice/dun/plugins/inc/usb/DunUsbListen.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/plugins/inc/usb/DunUsbListen.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -24,12 +24,6 @@
#include
#include "DunPlugin.h"
-enum TUsbListenState
- {
- EUsbListenStateIdle,
- EUsbListenStateListening
- };
-
/**
* DUN USB plugin's listener class
* This class starts listening for USB device state to change to configured.
@@ -81,9 +75,9 @@
* Stops listening
*
* @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -143,11 +137,6 @@
MDunListenCallback* iParent;
/**
- * Current state of listening: active or inactive
- */
- TUsbListenState iListenState;
-
- /**
* USB server (USB manager) needed for device state notifications
* Device states needed to create transporter channel
*/
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/plugins/src/bt/DunBtListen.cpp
--- a/localconnectivityservice/dun/plugins/src/bt/DunBtListen.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/plugins/src/bt/DunBtListen.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -94,7 +94,7 @@
{
FTRACE(FPrint( _L( "CDunBtListen::IssueRequestL()" ) ));
- if ( iListenState == EBtListenStateListening )
+ if ( IsActive() )
{
FTRACE(FPrint( _L( "CDunBtListen::IssueRequestL() (already active) complete" ) ));
User::Leave( KErrNotReady );
@@ -141,8 +141,6 @@
FTRACE(FPrint( _L( "CDunBtListen::IssueRequestL() (ERROR) complete (%d)" ), retTemp));
User::Leave( retTemp );
}
- iStatus = KRequestPending;
- iListenState = EBtListenStateListening;
iListenSocket.Accept( iEntity.iBTPort, iStatus );
SetActive();
@@ -153,19 +151,11 @@
// Stops listening
// ---------------------------------------------------------------------------
//
-TInt CDunBtListen::Stop()
+void CDunBtListen::Stop()
{
FTRACE(FPrint( _L( "CDunBtListen::Stop()") ));
- if ( iListenState != EBtListenStateListening )
- {
- FTRACE(FPrint( _L("CDunBtListen::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- iListenSocket.CancelAccept();
Cancel();
- iListenState = EBtListenStateIdle;
FTRACE(FPrint( _L( "CDunBtListen::Stop() complete") ));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -222,7 +212,6 @@
// Don't initialize iParent here (it is set through NewL)
// Don't initialize iTransporter here (it is set through NewL)
// Don't initialize iEntity here (it is set through NewL)
- iListenState = EBtListenStateIdle;
iDiscovery = NULL;
iChannelNum = 0;
iSDPHandleDun = 0;
@@ -394,7 +383,6 @@
void CDunBtListen::RunL()
{
FTRACE(FPrint( _L( "CDunBtListen::RunL()" ) ));
- iListenState = EBtListenStateIdle;
StopServiceAdvertisement();
@@ -432,6 +420,9 @@
//
void CDunBtListen::DoCancel()
{
+ FTRACE(FPrint( _L( "CDunBtListen::DoCancel()" ) ));
+ iListenSocket.CancelAccept();
+ FTRACE(FPrint( _L( "CDunBtListen::DoCancel() complete" ) ));
}
// ---------------------------------------------------------------------------
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/plugins/src/usb/DunUsbConfig.cpp
--- a/localconnectivityservice/dun/plugins/src/usb/DunUsbConfig.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/plugins/src/usb/DunUsbConfig.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -71,7 +71,7 @@
TInt CDunUsbConfig::GetConfigValidityByIndex( TInt aIndex, TBool& aValidity )
{
FTRACE(FPrint( _L("CDunUsbConfig::GetConfigValidityByIndex()" )));
- if ( iConfigState != EUsbConfigStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunUsbConfig::GetConfigValidityByIndex() (not ready) complete" )));
return KErrNotReady;
@@ -111,13 +111,11 @@
TInt CDunUsbConfig::IssueRequest()
{
FTRACE(FPrint( _L("CDunUsbConfig::IssueRequest()" )));
- if ( iConfigState != EUsbConfigStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunUsbConfig::IssueRequest() (not ready) complete" )));
return KErrNotReady;
}
- iStatus = KRequestPending;
- iConfigState = EUsbConfigStateWaiting;
iAcmProperty.Subscribe( iStatus );
SetActive();
FTRACE(FPrint( _L("CDunUsbConfig::IssueRequest() complete" )));
@@ -128,19 +126,11 @@
// Stops listening for ACM configuration changes
// ---------------------------------------------------------------------------
//
-TInt CDunUsbConfig::Stop()
+void CDunUsbConfig::Stop()
{
FTRACE(FPrint( _L("CDunUsbConfig::Stop()" )));
- if ( iConfigState != EUsbConfigStateWaiting )
- {
- FTRACE(FPrint( _L("CDunUsbConfig::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- iAcmProperty.Cancel();
Cancel();
- iConfigState = EUsbConfigStateIdle;
FTRACE(FPrint( _L("CDunUsbConfig::Stop() complete" )));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -182,7 +172,6 @@
{
// Don't initialize iCallback here (it is set through NewL)
// Don't initialize iProtocol here (it is set through NewL)
- iConfigState = EUsbConfigStateIdle;
iConfig.iAcmConfigVersion = 0;
iConfig.iAcmCount = 0;
iConfigExist = EFalse;
@@ -228,7 +217,6 @@
void CDunUsbConfig::RunL()
{
FTRACE(FPrint( _L("CDunUsbConfig::RunL()" )));
- iConfigState = EUsbConfigStateIdle;
TPublishedAcmConfigs newConfig;
TInt retTemp = GetConfiguration( newConfig );
@@ -289,4 +277,7 @@
//
void CDunUsbConfig::DoCancel()
{
+ FTRACE(FPrint( _L("CDunUsbConfig::DoCancel()" )));
+ iAcmProperty.Cancel();
+ FTRACE(FPrint( _L("CDunUsbConfig::DoCancel() complete" )));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/plugins/src/usb/DunUsbListen.cpp
--- a/localconnectivityservice/dun/plugins/src/usb/DunUsbListen.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/plugins/src/usb/DunUsbListen.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2008 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -107,21 +107,13 @@
// Stops listening
// ---------------------------------------------------------------------------
//
-TInt CDunUsbListen::Stop()
+void CDunUsbListen::Stop()
{
FTRACE(FPrint( _L( "CDunUsbListen::Stop()" ) ));
- if ( iListenState != EUsbListenStateListening )
- {
- FTRACE(FPrint( _L( "CDunUsbListen::Stop() (not ready) complete" ) ));
- return KErrNotReady;
- }
- iUsbServer.DeviceStateNotificationCancel();
Cancel();
- iListenState = EUsbListenStateIdle;
iDeviceState = EUsbDeviceStateUndefined;
iDeviceStatePrev = EUsbDeviceStateUndefined;
FTRACE(FPrint( _L( "CDunUsbListen::Stop() complete" ) ));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -175,14 +167,12 @@
{
FTRACE(FPrint( _L( "CDunUsbListen::Activate()" ) ));
- if ( iListenState != EUsbListenStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L( "CDunUsbListen::Activate() (not ready) complete" ) ));
return KErrNotReady;
}
iDeviceStatePrev = iDeviceState;
- iStatus = KRequestPending;
- iListenState = EUsbListenStateListening;
iUsbServer.DeviceStateNotification( KDunUsbDeviceStateMask,
iDeviceState,
iStatus );
@@ -199,7 +189,6 @@
void CDunUsbListen::RunL()
{
FTRACE(FPrint( _L( "CDunUsbListen::RunL() iStatus=%d"), iStatus.Int() ));
- iListenState = EUsbListenStateIdle;
if ( iStatus.Int() != KErrNone )
{
@@ -256,4 +245,7 @@
//
void CDunUsbListen::DoCancel()
{
+ FTRACE(FPrint( _L( "CDunUsbListen::DoCancel()" )));
+ iUsbServer.DeviceStateNotificationCancel();
+ FTRACE(FPrint( _L( "CDunUsbListen::DoCancel() complete" )));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/server/inc/DunCloseWait.h
--- a/localconnectivityservice/dun/server/inc/DunCloseWait.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/server/inc/DunCloseWait.h Fri Oct 15 15:05:57 2010 +0800
@@ -96,9 +96,9 @@
* Stops closing the objects in the close list
*
* @since S60 5.0
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/server/src/DunCloseWait.cpp
--- a/localconnectivityservice/dun/server/src/DunCloseWait.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/server/src/DunCloseWait.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -108,17 +108,11 @@
// Stops closing the objects in the close list
// ---------------------------------------------------------------------------
//
-TInt CDunCloseWait::Stop()
+void CDunCloseWait::Stop()
{
FTRACE(FPrint( _L("CDunCloseWait::Stop()" )));
- if ( !IsActive() )
- {
- FTRACE(FPrint( _L("CDunCloseWait::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
Cancel();
FTRACE(FPrint( _L("CDunCloseWait::Stop() complete" )));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -175,4 +169,6 @@
//
void CDunCloseWait::DoCancel()
{
+ FTRACE(FPrint( _L("CDunCloseWait::DoCancel()" )));
+ FTRACE(FPrint( _L("CDunCloseWait::DoCancel() complete" )));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/inc/DunDataPusher.h
--- a/localconnectivityservice/dun/utils/inc/DunDataPusher.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/inc/DunDataPusher.h Fri Oct 15 15:05:57 2010 +0800
@@ -164,17 +164,9 @@
* Stops sending for write endpoint
*
* @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
-
- /**
- * Stops sending for write endpoint and clears event queue
- *
- * @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
- */
- TInt StopAndClearQueue();
+ void Stop();
/**
* Signals completion status in round robin and clears event queue
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/inc/DunDataWaiter.h
--- a/localconnectivityservice/dun/utils/inc/DunDataWaiter.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/inc/DunDataWaiter.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -88,9 +88,9 @@
* Stops monitoring for new data
*
* @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -141,11 +141,6 @@
MDunChannelAllocator* iChannelCallback;
/**
- * Current state of data monitoring: active or inactive
- */
- TDunState iDataWaiterState;
-
- /**
* RComm object of local media side
* Not own.
*/
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/inc/DunSignalCopy.h
--- a/localconnectivityservice/dun/utils/inc/DunSignalCopy.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/inc/DunSignalCopy.h Fri Oct 15 15:05:57 2010 +0800
@@ -88,9 +88,9 @@
* Stops monitoring the endpoint for line status change
*
* @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -195,11 +195,6 @@
TDunStreamType iStreamType;
/**
- * Current state of connection monitoring: active or inactive
- */
- TDunState iSignalCopyState;
-
- /**
* Signal to listen with RComm::NotifySignalChange()
*/
TUint iListenSignals;
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/inc/DunSignalNotify.h
--- a/localconnectivityservice/dun/utils/inc/DunSignalNotify.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/inc/DunSignalNotify.h Fri Oct 15 15:05:57 2010 +0800
@@ -85,9 +85,9 @@
* Stops monitoring the endpoint for line status change
*
* @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -156,11 +156,6 @@
MDunTransporterUtilityAux* iUtility;
/**
- * Current state of signal monitoring: active or inactive
- */
- TDunState iSignalNotifyState;
-
- /**
* Signals to listen with RComm::NotifySignalChange()
*/
TUint iListenSignals;
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/inc/DunSignalWaiter.h
--- a/localconnectivityservice/dun/utils/inc/DunSignalWaiter.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/inc/DunSignalWaiter.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -88,9 +88,9 @@
* Stops monitoring for new data
*
* @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt Stop();
+ void Stop();
private:
@@ -141,11 +141,6 @@
MDunChannelAllocator* iChannelCallback;
/**
- * Current state of data monitoring: active or inactive
- */
- TDunState iSignalWaiterState;
-
- /**
* Signals set when RComm::NotifySignalChange() request completes
*/
TUint iSignals;
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/inc/DunStream.h
--- a/localconnectivityservice/dun/utils/inc/DunStream.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/inc/DunStream.h Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -184,11 +184,6 @@
TDunOperationType iOperationType;
/**
- * Current state of transfer: active or inactive
- */
- TDunState iTransferState;
-
- /**
* Direction of data transfer
* This is set after iStreamType and iOperationType are known
*/
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/inc/DunTransporter.h
--- a/localconnectivityservice/dun/utils/inc/DunTransporter.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/inc/DunTransporter.h Fri Oct 15 15:05:57 2010 +0800
@@ -74,20 +74,10 @@
enum TDunState
{
EDunStateIdle,
- EDunStateTransferring, // Transporter state for data tranfer (up/downstream)
- EDunStateSignalCopy, // Transporter state for signal copying (RComm)
- EDunStateSignalNotify, // Transporter state for signal notifying (RSocket)
- EDunStateDataWaiting, // Transporter state for data waiting
- EDunStateSignalWaiting, // Transporter state for signal waiting
- EDunStateDataPushing, // Transporter state for data pushing (multiplexer)
EDunStateCallListen, // Transporter state for call state listening
- EDunStateAtCmdHandling, // ATEXT state for AT command handling
- EDunStateAtCmdPushing, // ATEXT state for AT command reply pushing
- EDunStateAtCmdEchoing, // ATEXT state for AT command character echoing (text mode)
- EDunStateAtUrcHandling, // ATEXT state for URC handling
- EDunStateModeListening, // ATEXT state for mode change listening
- EDunStateEcomListening, // ATEXT state for ECOM change listening
- EDunStateNvramListening, // ATEXT state for NVRAM change listening
+ EDunStateAtCmdHandling, // State for AT command handling
+ EDunStateAtCmdPushing, // State for AT command reply pushing
+ EDunStateAtCmdEchoing, // State for AT command character echoing (text mode)
EDunStateUiNoting // Transporter state for UI note showing
};
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/inc/DunUpstream.h
--- a/localconnectivityservice/dun/utils/inc/DunUpstream.h Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/inc/DunUpstream.h Fri Oct 15 15:05:57 2010 +0800
@@ -110,7 +110,7 @@
* @since S60 3.2
* @return None
*/
- virtual TInt StopAtCmdHandling() = 0;
+ virtual void StopAtCmdHandling() = 0;
};
@@ -292,9 +292,9 @@
* This is an accessor for CDunDownstream's Stop()
*
* @since S60 3.2
- * @return Symbian error code on error, KErrNone otherwise
+ * @return None
*/
- TInt StopAtCmdHandling();
+ void StopAtCmdHandling();
// from base class MDunCmdModeMonitor
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/src/DunDataPusher.cpp
--- a/localconnectivityservice/dun/utils/src/DunDataPusher.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/src/DunDataPusher.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -202,34 +202,11 @@
// Stops sending for write endpoint
// ---------------------------------------------------------------------------
//
-TInt CDunDataPusher::Stop()
+void CDunDataPusher::Stop()
{
FTRACE(FPrint( _L("CDunDataPusher::Stop()" )));
- if ( iPushState != EDunStateDataPushing )
- {
- FTRACE(FPrint( _L("CDunDataPusher::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- // As the EDunStateDataPushing can be on even with multiple requests,
- // cancel the actual operation in DoCancel()
Cancel();
- iPushState = EDunStateIdle;
FTRACE(FPrint( _L("CDunDataPusher::Stop() complete" )));
- return KErrNone;
- }
-
-// ---------------------------------------------------------------------------
-// Stops sending for write endpoint and clears event queue
-// ---------------------------------------------------------------------------
-//
-TInt CDunDataPusher::StopAndClearQueue()
- {
- FTRACE(FPrint( _L("CDunDataPusher::StopAndClearQueue()" )));
- TInt retVal = Stop();
- iEventQueue.Reset();
- iEventIndex = 0;
- FTRACE(FPrint( _L("CDunDataPusher::StopAndClearQueue() complete" )));
- return retVal;
}
// ---------------------------------------------------------------------------
@@ -309,7 +286,6 @@
{
// Don't initialize iUtility here (it is set through NewL)
// Don't initialize iStreamCallback here (it is set through NewL)
- iPushState = EDunStateIdle;
iEventIndex = 0;
iSocket = NULL;
iComm = NULL;
@@ -336,16 +312,12 @@
const TDesC8* dataToPush = iEventQueue[iEventIndex].iDataToPush;
if ( iComm )
{
- iStatus = KRequestPending;
- iPushState = EDunStateDataPushing;
iComm->Write( iStatus, *dataToPush );
SetActive();
FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() RComm Write() requested for %d bytes... (buffer=0x%08X)" ), dataToPush->Length(), dataToPush ));
}
else if ( iSocket )
{
- iStatus = KRequestPending;
- iPushState = EDunStateDataPushing;
iSocket->Send( *dataToPush, 0, iStatus );
SetActive();
FTRACE(FPrint( _L("CDunDataPusher::ManageOneEvent() RSocket Send() requested for %d bytes... (buffer=0x%08X)" ), dataToPush->Length(), dataToPush ));
@@ -408,13 +380,11 @@
else
{
// Last was served so stop processing and notify
- iPushState = EDunStateIdle;
iStreamCallback->NotifyDataPushComplete( ETrue );
}
} // if ( !stop )
else // stop -> tear down connection
{
- iPushState = EDunStateIdle;
TDunConnectionReason connReason;
connReason.iReasonType = EDunReasonTypeRW;
connReason.iContext = EDunMediaContextLocal;
@@ -449,5 +419,9 @@
iSocket->CancelWrite();
FTRACE(FPrint( _L("CDunDataPusher::DoCancel() (RSocket) cancelled" )));
}
+ else
+ {
+ FTRACE(FPrint( _L("CDunDataPusher::DoCancel() (ERROR) complete" )));
+ }
FTRACE(FPrint( _L("CDunDataPusher::DoCancel() complete" )));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/src/DunDataWaiter.cpp
--- a/localconnectivityservice/dun/utils/src/DunDataWaiter.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/src/DunDataWaiter.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2006-2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -124,7 +124,7 @@
TInt CDunDataWaiter::IssueRequest()
{
FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest()" )));
- if ( iDataWaiterState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest() (not ready) complete" )));
return KErrNotReady;
@@ -135,8 +135,6 @@
return KErrGeneral;
}
iComm->ResetBuffers();
- iStatus = KRequestPending;
- iDataWaiterState = EDunStateDataWaiting;
iComm->NotifyDataAvailable( iStatus );
SetActive();
FTRACE(FPrint( _L("CDunDataWaiter::IssueRequest() complete" )));
@@ -147,24 +145,11 @@
// Stops monitoring for new data
// ---------------------------------------------------------------------------
//
-TInt CDunDataWaiter::Stop()
+void CDunDataWaiter::Stop()
{
FTRACE(FPrint( _L("CDunDataWaiter::Stop()" )));
- if ( iDataWaiterState != EDunStateDataWaiting )
- {
- FTRACE(FPrint( _L("CDunDataWaiter::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- if ( !iComm )
- {
- FTRACE(FPrint( _L("CDunDataWaiter::Stop() (iComm) not initialized!" )));
- return KErrGeneral;
- }
- iComm->NotifyDataAvailableCancel();
Cancel();
- iDataWaiterState = EDunStateIdle;
FTRACE(FPrint( _L("CDunDataWaiter::Stop() complete" )));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -201,7 +186,6 @@
{
FTRACE(FPrint( _L("CDunDataWaiter::Initialize()" ) ));
// Don't initialize iChannelCallback here (it is set through NewL)
- iDataWaiterState = EDunStateIdle;
iComm = NULL;
FTRACE(FPrint( _L("CDunDataWaiter::Initialize() complete" ) ));
}
@@ -214,7 +198,6 @@
void CDunDataWaiter::RunL()
{
FTRACE(FPrint( _L("CDunDataWaiter::RunL()" ) ));
- iDataWaiterState = EDunStateIdle;
TInt retTemp = iStatus.Int();
if ( retTemp != KErrNone )
{
@@ -250,4 +233,7 @@
//
void CDunDataWaiter::DoCancel()
{
+ FTRACE(FPrint( _L("CDunDataWaiter::DoCancel()" ) ));
+ iComm->NotifyDataAvailableCancel();
+ FTRACE(FPrint( _L("CDunDataWaiter::DoCancel() complete" ) ));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/src/DunDownstream.cpp
--- a/localconnectivityservice/dun/utils/src/DunDownstream.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/src/DunDownstream.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -187,11 +187,6 @@
TInt CDunDownstream::Stop( TBool aStopMplex )
{
FTRACE(FPrint( _L("CDunDownstream::Stop() (Dir=%d)" ), iDirection));
- if ( !iPushData.iDataPusher )
- {
- FTRACE(FPrint( _L("CDunDownstream::Stop() (iPushData.iDatapusher not initialized!) complete" )));
- return KErrGeneral;
- }
// Stop the downstream related AT command handling functionality
if ( aStopMplex ) // optional
{
@@ -200,28 +195,12 @@
iPushData.iAtCmdHandler->StopAtCmdHandling();
}
// Stop the multiplexer separately
- iPushData.iDataPusher->Stop();
- }
- if ( iTransferState != EDunStateTransferring )
- {
- FTRACE(FPrint( _L("CDunDownstream::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- // Stop only current operation
- if ( iOperationType == EDunOperationTypeRead )
- {
- if ( iNetwork )
+ if ( iPushData.iDataPusher )
{
- iNetwork->ReadCancel();
- Cancel();
- FTRACE(FPrint( _L("CDunDownstream::Stop() (Network) cancelled" )));
+ iPushData.iDataPusher->Stop();
}
}
- else if ( iOperationType == EDunOperationTypeWrite )
- {
- iPushData.iDataPusher->StopOneEvent( iBufferPtr );
- }
- iTransferState = EDunStateIdle;
+ Cancel();
iOperationType = EDunOperationTypeUndefined;
FTRACE(FPrint( _L("CDunDownstream::Stop() complete" )));
return KErrNone;
@@ -273,13 +252,8 @@
iDirection = static_cast( EDunStreamTypeDownstream | iOperationType );
FTRACE(FPrint( _L("CDunDownstream::IssueRequest() (Dir=%d)" ), iDirection));
- if ( !iPushData.iDataPusher )
- {
- FTRACE(FPrint( _L("CDunDownstream::IssueRequest() (iPushData.iDataPusher not initialized!) complete" ) ));
- return KErrGeneral;
- }
- if ( iTransferState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunDownstream::IssueRequest() (not ready) complete" ) ));
return KErrNotReady;
@@ -298,14 +272,11 @@
switch ( iDirection )
{
case EDunReaderDownstream:
- iStatus = KRequestPending;
- iTransferState = EDunStateTransferring;
iNetwork->ReadOneOrMore( iStatus, *iBufferPtr );
SetActive();
FTRACE(FPrint( _L("CDunDownstream::IssueRequest() RComm ReadOneOrMore() requested" ) ));
break;
case EDunWriterDownstream:
- iTransferState = EDunStateTransferring;
AddToQueueAndSend( iBufferPtr, this );
break;
default:
@@ -325,7 +296,7 @@
void CDunDownstream::RunL()
{
FTRACE(FPrint( _L("CDunDownstream::RunL() (Dir=%d)" ), iDirection));
- iTransferState = EDunStateIdle;
+
if ( iOperationType != EDunOperationTypeRead )
{
FTRACE(FPrint( _L("CDunDownstream::RunL() (wrong operation type!) complete" )));
@@ -376,6 +347,7 @@
void CDunDownstream::DoCancel()
{
FTRACE(FPrint( _L("CDunDownstream::DoCancel()" )));
+ iNetwork->ReadCancel();
FTRACE(FPrint( _L("CDunDownstream::DoCancel() complete" )));
}
@@ -424,7 +396,6 @@
FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushComplete() (find event)" )));
if ( foundIndex >= 0 )
{
- iTransferState = EDunStateIdle;
iOperationType = EDunOperationTypeUndefined;
FTRACE(FPrint( _L("CDunDownstream::NotifyDataPushComplete() (issue request)" )));
if ( iPushData.iDataMode )
@@ -445,13 +416,8 @@
{
FTRACE(FPrint( _L("CDunDownstream::NotifyCommandModeStart()" )));
iPushData.iDataMode = EFalse;
- // Now the data mode has ended. If read operation then cancel it.
- // Check for iTransferState here to minimize logging
- if ( iTransferState==EDunStateTransferring &&
- iOperationType==EDunOperationTypeRead )
- {
- Stop( EFalse );
- }
+ // Now the data mode has ended. Stop read operation but not the multiplexer.
+ Stop( EFalse );
FTRACE(FPrint( _L("CDunDownstream::NotifyCommandModeStart() complete" )));
}
@@ -464,14 +430,7 @@
{
FTRACE(FPrint( _L("CDunDownstream::NotifyCommandModeEnd()" )));
iPushData.iDataMode = ETrue;
- // Command mode ends here so start reading from Dataport only if generic
- // transferring state is not EDunStateIdle. This is a reduced form of having
- // read pending -> reissue not needed OR write pending -> reissue not needed
- // (NotifyDataPushComplete() will reissue).
- if ( iTransferState == EDunStateIdle )
- {
- iOperationType = EDunOperationTypeRead; // just in case
- IssueRequest();
- }
+ iOperationType = EDunOperationTypeRead; // just in case
+ IssueRequest();
FTRACE(FPrint( _L("CDunDownstream::NotifyCommandModeEnd() complete" )));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/src/DunSignalCopy.cpp
--- a/localconnectivityservice/dun/utils/src/DunSignalCopy.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/src/DunSignalCopy.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -152,7 +152,7 @@
TInt CDunSignalCopy::IssueRequest()
{
FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest()" )));
- if ( iSignalCopyState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() (not ready) complete" ) ));
return KErrNotReady;
@@ -191,8 +191,6 @@
else
{
FTRACE(FPrint( _L("CDunSignalCopy::IssueRequest() start waiting for change..." ) ));
- iStatus = KRequestPending;
- iSignalCopyState = EDunStateSignalCopy;
comm->NotifySignalChange( iStatus, iSignals, iListenSignals );
SetActive();
}
@@ -204,31 +202,11 @@
// Stops monitoring the endpoint for line status change
// ---------------------------------------------------------------------------
//
-TInt CDunSignalCopy::Stop()
+void CDunSignalCopy::Stop()
{
FTRACE(FPrint( _L("CDunSignalCopy::Stop()" )));
- if ( iSignalCopyState != EDunStateSignalCopy )
- {
- FTRACE(FPrint( _L("CDunSignalCopy::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- if ( iStreamType == EDunStreamTypeUpstream )
- {
- iComm->NotifySignalChangeCancel();
- }
- else if ( iStreamType == EDunStreamTypeDownstream )
- {
- iNetwork->NotifySignalChangeCancel();
- }
- else
- {
- FTRACE(FPrint( _L("CDunSignalCopy::Stop() (ERROR) complete" )));
- return KErrGeneral;
- }
Cancel();
- iSignalCopyState = EDunStateIdle;
FTRACE(FPrint( _L("CDunSignalCopy::Stop() complete" )));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -261,7 +239,6 @@
FTRACE(FPrint( _L("CDunSignalCopy::Initialize()" ) ));
iContextInUse = EDunMediaContextUndefined;
iStreamType = EDunStreamTypeUndefined;
- iSignalCopyState = EDunStateIdle;
iListenSignals = 0;
iSignals = 0;
iNetwork = NULL;
@@ -439,7 +416,6 @@
void CDunSignalCopy::RunL()
{
FTRACE(FPrint( _L("CDunSignalCopy::RunL()" ) ));
- iSignalCopyState = EDunStateIdle;
TInt retTemp = iStatus.Int();
if ( retTemp != KErrNone )
{
@@ -472,4 +448,18 @@
//
void CDunSignalCopy::DoCancel()
{
+ FTRACE(FPrint( _L("CDunSignalCopy::DoCancel()" ) ));
+ if ( iStreamType == EDunStreamTypeUpstream )
+ {
+ iComm->NotifySignalChangeCancel();
+ }
+ else if ( iStreamType == EDunStreamTypeDownstream )
+ {
+ iNetwork->NotifySignalChangeCancel();
+ }
+ else
+ {
+ FTRACE(FPrint( _L("CDunSignalCopy::DoCancel() (ERROR) complete" )));
+ }
+ FTRACE(FPrint( _L("CDunSignalCopy::DoCancel() complete" ) ));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/src/DunSignalNotify.cpp
--- a/localconnectivityservice/dun/utils/src/DunSignalNotify.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/src/DunSignalNotify.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -136,7 +136,7 @@
TInt CDunSignalNotify::IssueRequest()
{
FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest()" )));
- if ( iSignalNotifyState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() (not ready) complete" )));
return KErrNotReady;
@@ -164,8 +164,6 @@
else
{
FTRACE(FPrint( _L("CDunSignalNotify::IssueRequest() start waiting for change..." ) ));
- iStatus = KRequestPending;
- iSignalNotifyState = EDunStateSignalNotify;
iNetwork->NotifySignalChange( iStatus, iSignals, iListenSignals );
SetActive();
}
@@ -177,24 +175,11 @@
// Stops monitoring the endpoint for line status change
// ---------------------------------------------------------------------------
//
-TInt CDunSignalNotify::Stop()
+void CDunSignalNotify::Stop()
{
FTRACE(FPrint( _L("CDunSignalNotify::Stop()" )));
- if ( iSignalNotifyState != EDunStateSignalNotify )
- {
- FTRACE(FPrint( _L("CDunSignalNotify::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- if ( !iNetwork )
- {
- FTRACE(FPrint( _L("CDunSignalNotify::Stop() (iNetwork) not initialized!" )));
- return KErrGeneral;
- }
- iNetwork->NotifySignalChangeCancel();
Cancel();
- iSignalNotifyState = EDunStateIdle;
FTRACE(FPrint( _L("CDunSignalNotify::Stop() complete" )));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -231,7 +216,6 @@
{
FTRACE(FPrint( _L("CDunSignalNotify::Initialize()" ) ));
// Don't initialize iUtility here (it is set through NewL)
- iSignalNotifyState = EDunStateIdle;
iListenSignals = 0;
iSignals = 0;
iNetwork = NULL;
@@ -349,7 +333,6 @@
void CDunSignalNotify::RunL()
{
FTRACE(FPrint( _L("CDunSignalNotify::RunL()" ) ));
- iSignalNotifyState = EDunStateIdle;
TInt retTemp = iStatus.Int();
if ( retTemp != KErrNone )
{
@@ -383,5 +366,6 @@
void CDunSignalNotify::DoCancel()
{
FTRACE(FPrint( _L("CDunSignalNotify::DoCancel()" ) ));
+ iNetwork->NotifySignalChangeCancel();
FTRACE(FPrint( _L("CDunSignalNotify::DoCancel() complete" ) ));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/src/DunSignalWaiter.cpp
--- a/localconnectivityservice/dun/utils/src/DunSignalWaiter.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/src/DunSignalWaiter.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -130,7 +130,7 @@
TInt CDunSignalWaiter::IssueRequest()
{
FTRACE(FPrint( _L("CDunSignalWaiter::IssueRequest()" )));
- if ( iSignalWaiterState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunSignalWaiter::IssueRequest() (not ready) complete" )));
return KErrNotReady;
@@ -140,8 +140,6 @@
FTRACE(FPrint( _L("CDunSignalWaiter::IssueRequest() (iComm) not initialized!" ) ));
return KErrGeneral;
}
- iStatus = KRequestPending;
- iSignalWaiterState = EDunStateSignalWaiting;
iComm->NotifySignalChange( iStatus, iSignals, KSignalDCEInputs );
SetActive();
FTRACE(FPrint( _L("CDunSignalWaiter::IssueRequest() complete" )));
@@ -152,24 +150,11 @@
// Stops monitoring for new data
// ---------------------------------------------------------------------------
//
-TInt CDunSignalWaiter::Stop()
+void CDunSignalWaiter::Stop()
{
FTRACE(FPrint( _L("CDunSignalWaiter::Stop()" )));
- if ( iSignalWaiterState != EDunStateSignalWaiting )
- {
- FTRACE(FPrint( _L("CDunSignalWaiter::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- if ( !iComm )
- {
- FTRACE(FPrint( _L("CDunSignalWaiter::Stop() (iComm) not initialized!" )));
- return KErrGeneral;
- }
- iComm->NotifySignalChangeCancel();
Cancel();
- iSignalWaiterState = EDunStateIdle;
FTRACE(FPrint( _L("CDunSignalWaiter::Stop() complete" )));
- return KErrNone;
}
// ---------------------------------------------------------------------------
@@ -206,7 +191,6 @@
{
FTRACE(FPrint( _L("CDunSignalWaiter::Initialize()" ) ));
// Don't initialize iChannelCallback here (it is set through NewL)
- iSignalWaiterState = EDunStateIdle;
iSignals = 0;
iComm = NULL;
FTRACE(FPrint( _L("CDunSignalWaiter::Initialize() complete" ) ));
@@ -220,7 +204,6 @@
void CDunSignalWaiter::RunL()
{
FTRACE(FPrint( _L("CDunSignalWaiter::RunL()" ) ));
- iSignalWaiterState = EDunStateIdle;
TInt retTemp = iStatus.Int();
if ( retTemp != KErrNone )
{
@@ -254,4 +237,7 @@
//
void CDunSignalWaiter::DoCancel()
{
+ FTRACE(FPrint( _L("CDunSignalWaiter::RunL()" ) ));
+ iComm->NotifySignalChangeCancel();
+ FTRACE(FPrint( _L("CDunSignalWaiter::RunL() complete" ) ));
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/src/DunStream.cpp
--- a/localconnectivityservice/dun/utils/src/DunStream.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/src/DunStream.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -312,7 +312,6 @@
iBufferPtr = NULL;
iReadLengthSocket = 0;
iOperationType = EDunOperationTypeUndefined;
- iTransferState = EDunStateIdle;
iDirection = EDunDirectionUndefined;
iNetwork = NULL;
iSocket = NULL;
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/dun/utils/src/DunUpstream.cpp
--- a/localconnectivityservice/dun/utils/src/DunUpstream.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/localconnectivityservice/dun/utils/src/DunUpstream.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -166,35 +166,7 @@
{
FTRACE(FPrint( _L("CDunUpstream::Stop() (Dir=%d)" ), iDirection));
// Don't stop CDunAtCmdHandler here as it is downstream related!
- if ( iTransferState != EDunStateTransferring )
- {
- FTRACE(FPrint( _L("CDunUpstream::Stop() (not ready) complete" )));
- return KErrNotReady;
- }
- // Stop only current operation
- if ( iOperationType == EDunOperationTypeRead )
- {
- if ( iComm )
- {
- iComm->ReadCancel();
- FTRACE(FPrint( _L("CDunUpstream::Stop() (RComm) cancelled" )));
- }
- else if ( iSocket )
- {
- iSocket->CancelRecv();
- FTRACE(FPrint( _L("CDunUpstream::Stop() (RSocket) cancelled" )));
- }
- }
- else if ( iOperationType == EDunOperationTypeWrite )
- {
- if ( iNetwork )
- {
- iNetwork->WriteCancel();
- FTRACE(FPrint( _L("CDunUpstream::Stop() (Network) cancelled" )));
- }
- }
Cancel();
- iTransferState = EDunStateIdle;
iOperationType = EDunOperationTypeUndefined;
// Notify parent about inactivity
if ( iActivityData.iActivityCallback && iActivityData.iNotified )
@@ -264,7 +236,7 @@
FTRACE(FPrint( _L("CDunUpstream::IssueRequest() (Dir=%d)" ), iDirection));
- if ( iTransferState != EDunStateIdle )
+ if ( IsActive() )
{
FTRACE(FPrint( _L("CDunUpstream::IssueRequest() (not ready) complete" ) ));
return KErrNotReady;
@@ -285,16 +257,12 @@
case EDunReaderUpstream:
if ( iComm )
{
- iStatus = KRequestPending;
- iTransferState = EDunStateTransferring;
iComm->ReadOneOrMore( iStatus, *iBufferPtr );
SetActive();
FTRACE(FPrint( _L("CDunUpstream::IssueRequest() RComm ReadOneOrMore() requested" ) ));
}
else if ( iSocket )
{
- iStatus = KRequestPending;
- iTransferState = EDunStateTransferring;
iSocket->RecvOneOrMore( *iBufferPtr, 0, iStatus, iReadLengthSocket );
SetActive();
FTRACE(FPrint( _L("CDunUpstream::IssueRequest() RSocket RecvOneOrMore() requested" ) ));
@@ -306,8 +274,6 @@
}
break;
case EDunWriterUpstream:
- iStatus = KRequestPending;
- iTransferState = EDunStateTransferring;
iNetwork->Write( iStatus, *iBufferPtr );
SetActive();
FTRACE(FPrint( _L("CDunUpstream::IssueRequest() RComm Write() requested" ) ));
@@ -386,7 +352,6 @@
void CDunUpstream::RunL()
{
FTRACE(FPrint( _L("CDunUpstream::RunL() (Dir=%d)" ), iDirection));
- iTransferState = EDunStateIdle;
TBool isError;
TInt retTemp = iStatus.Int();
@@ -451,6 +416,32 @@
void CDunUpstream::DoCancel()
{
FTRACE(FPrint( _L("CDunUpstream::DoCancel()" )));
+ // Stop only current operation
+ if ( iOperationType == EDunOperationTypeRead )
+ {
+ if ( iComm )
+ {
+ iComm->ReadCancel();
+ FTRACE(FPrint( _L("CDunUpstream::DoCancel() (RComm) cancelled" )));
+ }
+ else if ( iSocket )
+ {
+ iSocket->CancelRecv();
+ FTRACE(FPrint( _L("CDunUpstream::DoCancel() (RSocket) cancelled" )));
+ }
+ }
+ else if ( iOperationType == EDunOperationTypeWrite )
+ {
+ if ( iNetwork )
+ {
+ iNetwork->WriteCancel();
+ FTRACE(FPrint( _L("CDunUpstream::DoCancel() (Network) cancelled" )));
+ }
+ }
+ else
+ {
+ FTRACE(FPrint( _L("CDunUpstream::DoCancel() (ERROR) complete" )));
+ }
FTRACE(FPrint( _L("CDunUpstream::DoCancel() complete" )));
}
@@ -518,23 +509,15 @@
// Stops AT command handling downstream related activity (also URC)
// ---------------------------------------------------------------------------
//
-TInt CDunUpstream::StopAtCmdHandling()
+void CDunUpstream::StopAtCmdHandling()
{
FTRACE(FPrint( _L("CDunUpstream::StopAtCmdHandling()" )));
- TInt retVal = KErrNone;
if ( iParseData.iAtCmdHandler ) // optional
{
- retVal = iParseData.iAtCmdHandler->StopUrc();
- if ( retVal != KErrNone )
- {
- iParseData.iAtCmdHandler->Stop();
- FTRACE(FPrint( _L("CDunUpstream::StopAtCmdHandling() (iAtCmdHandler) complete" )));
- return retVal;
- }
- retVal = iParseData.iAtCmdHandler->Stop();
+ iParseData.iAtCmdHandler->StopUrc();
+ iParseData.iAtCmdHandler->Stop();
}
FTRACE(FPrint( _L("CDunUpstream::StopAtCmdHandling() complete" )));
- return retVal;
}
// ---------------------------------------------------------------------------
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/BWINS/locoddaemonmtU.def
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/BWINS/locoddaemonmtU.def Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,4 @@
+EXPORTS
+ ?LibEntryL@@YAPAVCTestModuleBase@@XZ @ 1 NONAME ; class CTestModuleBase * LibEntryL(void)
+ ?SetRequirements@@YAHAAPAVCTestModuleParam@@AAK@Z @ 2 NONAME ; int SetRequirements(class CTestModuleParam * &, unsigned long &)
+
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/eabi/locoddaemonmtu.def
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/eabi/locoddaemonmtu.def Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,4 @@
+EXPORTS
+ _Z9LibEntryLv @ 1 NONAME
+ _Z15SetRequirementsRP16CTestModuleParamRm @ 2 NONAME
+
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/group/bld.inf
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/group/bld.inf Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ?Description
+*
+*/
+
+
+
+PRJ_PLATFORMS
+DEFAULT
+
+
+PRJ_TESTMMPFILES
+locoddaemonmt.mmp
+
+
+// End of File
\ No newline at end of file
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/group/locoddaemonmt.mmp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/group/locoddaemonmt.mmp Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ?Description
+*
+*/
+
+#include
+#include
+
+TARGET locoddaemonmt.dll
+TARGETTYPE dll
+UID 0x1000008D 0x101FB3E7
+
+CAPABILITY ALL -TCB
+
+SOURCEPATH ../src
+SOURCE daemonmt.cpp
+SOURCE daemonmtCases.cpp
+SOURCE BtSettings.cpp
+
+
+USERINCLUDE ../inc
+
+MW_LAYER_SYSTEMINCLUDE
+
+LIBRARY euser.lib
+LIBRARY stiftestinterface.lib
+LIBRARY btengsettings.lib
+
+LANG SC
+
+// End of file
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/group/locoddaemonmt.pkg
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/group/locoddaemonmt.pkg Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,62 @@
+;
+; Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+; All rights reserved.
+; This component and the accompanying materials are made available
+; under the terms of "Eclipse Public License v1.0"
+; which accompanies this distribution, and is available
+; at the URL "http://www.eclipse.org/legal/epl-v10.html".
+;
+; Initial Contributors:
+; Nokia Corporation - initial contribution.
+;
+; Contributors:
+;
+; Description:
+;
+;
+; Installation file for STIF
+;
+
+; Languages
+&EN
+
+; Provide value for uid
+#{"locodDaemonMt"},(0x00000000),1,1,0,TYPE=SA, RU
+
+; Series60 product id for S60 5.0
+[0x1028315F], 0, 0, 0, {"Series60ProductID"}
+
+; Localised Vendor name
+%{"Nokia"}
+
+; Unique Vendor name
+:"Nokia"
+
+; Logo
+; None
+
+; Package signature - Optional
+; None
+
+; Start of Package body
+
+; Condition blocks
+; None
+
+; Options list
+; None
+
+; Install files
+"\epoc32\release\armv5\udeb\locoddaemonmt.dll"-"c:\Sys\Bin\locoddaemonmt.dll"
+"..\init\locoddaemonmt.ini"-"e:\testing\init\locoddaemonmt.ini"
+
+; Embedded SIS
+; None
+
+; End of Package body
+
+; PKG dependencies
+; None
+
+; PKG capabilities
+; None
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/inc/BtSettings.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/inc/BtSettings.h Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,86 @@
+/*
+* Copyright (c) 2002 - 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Class which is resposible for handling communication with
+* Bt settings API
+*
+*/
+
+
+#ifndef BTSETTINGS_H
+#define BTSETTINGS_H
+
+// INCLUDES
+#include
+#include
+#include
+// CLASS DECLARATION
+
+/**
+ * CBtSettings
+ */
+NONSHARABLE_CLASS( CBtSettings ) : public CBase,
+ public MBTEngSettingsObserver
+ {
+public:
+ // Constructors and destructor
+
+ /**
+ * Destructor.
+ */
+ ~CBtSettings();
+
+ /**
+ * Two-phased constructor.
+ */
+ static CBtSettings* NewL();
+
+ /**
+ * Two-phased constructor.
+ */
+ static CBtSettings* NewLC();
+
+ TInt GetPowerState( TBTPowerStateValue& aState );
+ TInt SetPowerState( TBTPowerStateValue aState );
+ TInt GetVisibilityMode( TBTVisibilityMode& aMode );
+ TInt SetVisibilityMode( TBTVisibilityMode aMode, TInt aTime = 0 );
+ TInt GetLocalName( TDes& aName );
+ TInt SetLocalName( const TDes& aName );
+
+
+private:
+
+ // From MBTEngSettingsObserver
+ void PowerStateChanged( TBTPowerStateValue aState );
+ void VisibilityModeChanged( TBTVisibilityMode aState );
+
+ /**
+ * Constructor for performing 1st stage construction
+ */
+ CBtSettings();
+
+ /**
+ * EPOC default constructor for performing 2nd stage construction
+ */
+ void ConstructL();
+
+
+private: //Data
+
+ CBTEngSettings* iSettings; // Own.
+ CActiveSchedulerWait* iWaiter; //Own.
+ TInt iError;
+
+ };
+
+#endif // BTSETTINGS_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/inc/daemonmt.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/inc/daemonmt.h Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,301 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: daemonmt test module.
+*
+*/
+
+
+
+#ifndef DAEMONMT_H
+#define DAEMONMT_H
+
+// INCLUDES
+#include "StifTestModule.h"
+#include
+#include
+#include "BtSettings.h"
+
+// CONSTANTS
+//const ?type ?constant_var = ?constant;
+
+// MACROS
+//#define ?macro ?macro_def
+
+// Logging path
+_LIT( KdaemonmtLogPath, "\\logs\\testframework\\daemonmt\\" );
+// Log file
+_LIT( KdaemonmtLogFile, "daemonmt.txt" );
+
+// Function pointer related internal definitions
+// Visual studio 6.0 (__VC32__) needs different type of handling
+#ifdef __VC32__
+#define GETPTR
+#else
+#define GETPTR &
+#endif
+#define ENTRY(str,func) {_S(str), GETPTR func,0,0,0}
+#define FUNCENTRY(func) {_S(#func), GETPTR func,0,0,0}
+#define OOM_ENTRY(str,func,a,b,c) {_S(str), GETPTR func,a,b,c}
+#define OOM_FUNCENTRY(func,a,b,c) {_S(#func), GETPTR func,a,b,c}
+
+// FUNCTION PROTOTYPES
+//?type ?function_name(?arg_list);
+
+// FORWARD DECLARATIONS
+//class ?FORWARD_CLASSNAME;
+class Cdaemonmt;
+
+// DATA TYPES
+//enum ?declaration
+//typedef ?declaration
+//extern ?data_type;
+// A typedef for function that does the actual testing,
+// function is a type
+// TInt Cdaemonmt:: ( TTestResult& aResult )
+typedef TInt (Cdaemonmt::* TestFunction)(TTestResult&);
+
+// CLASS DECLARATION
+
+/**
+* An internal structure containing a test case name and
+* the pointer to function doing the test
+*
+* @lib ?library
+* @since ?Series60_version
+*/
+class TCaseInfoInternal
+ {
+ public:
+ const TText* iCaseName;
+ TestFunction iMethod;
+ TBool iIsOOMTest;
+ TInt iFirstMemoryAllocation;
+ TInt iLastMemoryAllocation;
+ };
+
+// CLASS DECLARATION
+
+/**
+* A structure containing a test case name and
+* the pointer to function doing the test
+*
+* @lib ?library
+* @since ?Series60_version
+*/
+class TCaseInfo
+ {
+ public:
+ TPtrC iCaseName;
+ TestFunction iMethod;
+ TBool iIsOOMTest;
+ TInt iFirstMemoryAllocation;
+ TInt iLastMemoryAllocation;
+
+ TCaseInfo( const TText* a ) : iCaseName( (TText*) a )
+ {
+ };
+
+ };
+
+
+// CLASS DECLARATION
+
+/**
+* This a daemonmt class.
+* ?other_description_lines
+*
+* @lib ?library
+* @since ?Series60_version
+*/
+NONSHARABLE_CLASS(Cdaemonmt) : public CTestModuleBase
+ {
+ public: // Constructors and destructor
+
+
+ /**
+ * Two-phased constructor.
+ */
+ static Cdaemonmt* NewL();
+
+ /**
+ * Destructor.
+ */
+ virtual ~Cdaemonmt();
+
+ public: // New functions
+
+ /**
+ * ?member_description.
+ * @since ?Series60_version
+ * @param ?arg1 ?description
+ * @return ?description
+ */
+ //?type ?member_function( ?type ?arg1 );
+
+ public: // Functions from base classes
+
+ /**
+ * From CTestModuleBase InitL is used to initialize the
+ * daemonmt. It is called once for every instance of
+ * TestModuledaemonmt after its creation.
+ * @since ?Series60_version
+ * @param aIniFile Initialization file for the test module (optional)
+ * @param aFirstTime Flag is true when InitL is executed for first
+ * created instance of daemonmt.
+ * @return Symbian OS error code
+ */
+ TInt InitL( TFileName& aIniFile, TBool aFirstTime );
+
+ /**
+ * From CTestModuleBase GetTestCasesL is used to inquiry test cases
+ * from daemonmt.
+ * @since ?Series60_version
+ * @param aTestCaseFile Test case file (optional)
+ * @param aTestCases Array of TestCases returned to test framework
+ * @return Symbian OS error code
+ */
+ TInt GetTestCasesL( const TFileName& aTestCaseFile,
+ RPointerArray& aTestCases );
+
+ /**
+ * From CTestModuleBase RunTestCaseL is used to run an individual
+ * test case.
+ * @since ?Series60_version
+ * @param aCaseNumber Test case number
+ * @param aTestCaseFile Test case file (optional)
+ * @param aResult Test case result returned to test framework (PASS/FAIL)
+ * @return Symbian OS error code (test case execution error, which is
+ * not reported in aResult parameter as test case failure).
+ */
+ TInt RunTestCaseL( const TInt aCaseNumber,
+ const TFileName& aTestCaseFile,
+ TTestResult& aResult );
+
+ /**
+ * From CTestModuleBase; OOMTestQueryL is used to specify is particular
+ * test case going to be executed using OOM conditions
+ * @param aTestCaseFile Test case file (optional)
+ * @param aCaseNumber Test case number (optional)
+ * @param aFailureType OOM failure type (optional)
+ * @param aFirstMemFailure The first heap memory allocation failure value (optional)
+ * @param aLastMemFailure The last heap memory allocation failure value (optional)
+ * @return TBool
+ */
+ virtual TBool OOMTestQueryL( const TFileName& /* aTestCaseFile */,
+ const TInt /* aCaseNumber */,
+ TOOMFailureType& aFailureType,
+ TInt& /* aFirstMemFailure */,
+ TInt& /* aLastMemFailure */ );
+
+ /**
+ * From CTestModuleBase; OOMTestInitializeL may be used to initialize OOM
+ * test environment
+ * @param aTestCaseFile Test case file (optional)
+ * @param aCaseNumber Test case number (optional)
+ * @return None
+ */
+ virtual void OOMTestInitializeL( const TFileName& /* aTestCaseFile */,
+ const TInt /* aCaseNumber */ );
+
+ /**
+ * From CTestModuleBase; OOMHandleWarningL
+ * @param aTestCaseFile Test case file (optional)
+ * @param aCaseNumber Test case number (optional)
+ * @param aFailNextValue FailNextValue for OOM test execution (optional)
+ * @return None
+ *
+ * User may add implementation for OOM test warning handling. Usually no
+ * implementation is required.
+ */
+ virtual void OOMHandleWarningL( const TFileName& /* aTestCaseFile */,
+ const TInt /* aCaseNumber */,
+ TInt& /* aFailNextValue */);
+
+ /**
+ * From CTestModuleBase; OOMTestFinalizeL may be used to finalize OOM
+ * test environment
+ * @param aTestCaseFile Test case file (optional)
+ * @param aCaseNumber Test case number (optional)
+ * @return None
+ *
+ */
+ virtual void OOMTestFinalizeL( const TFileName& /* aTestCaseFile */,
+ const TInt /* aCaseNumber */ );
+
+ protected: // New functions
+
+ /**
+ * ?member_description.
+ * @since ?Series60_version
+ * @param ?arg1 ?description
+ * @return ?description
+ */
+ //?type ?member_function( ?type ?arg1 );
+
+ protected: // Functions from base classes
+
+ /**
+ * From ?base_class ?member_description
+ */
+ //?type ?member_function();
+
+ private:
+
+ /**
+ * C++ default constructor.
+ */
+ Cdaemonmt();
+
+ /**
+ * By default Symbian 2nd phase constructor is private.
+ */
+ void ConstructL();
+
+ /**
+ * Callback for CPeriodic.
+ */
+ static TInt PeriodicTimerCallBack(TAny* aAny);
+
+ /**
+ * Function returning test case name and pointer to test case function.
+ * @since ?Series60_version
+ * @param aCaseNumber test case number
+ * @return TCaseInfo
+ */
+ const TCaseInfo Case ( const TInt aCaseNumber ) const;
+
+ /**
+ * Actual Hardcoded test case functions are listed below.
+ */
+
+ TInt StartDaemon( TTestResult& aResult );
+
+
+ private: // Data
+ // Pointer to test (function) to be executed
+ TestFunction iMethod;
+
+ // Pointer to logger
+ CStifLogger * iLog;
+
+ CActiveScheduler* iScheduler;
+
+ RProperty iProperty;
+
+ CBtSettings* iBtSettings;
+ };
+
+#endif // DAEMONMT_H
+
+// End of File
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/init/locoddaemonmt.ini
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/init/locoddaemonmt.ini Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,196 @@
+#
+# This is STIF initialization file
+# Comment lines start with '#'-character.
+# See STIF TestFramework users guide.doc for instructions
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set following test engine settings:
+# - Set Test Reporting mode. TestReportMode's possible values are:
+# + 'Summary': Summary of the tested test cases.
+# + 'Environment': Hardware and software info.
+# + 'TestCases': Test case report.
+# + 'FullReport': Set of all above ones.
+# + Example 'TestReportMode= Summary TestCases'
+#
+# - CreateTestReport setting controls report creation mode
+# + YES, Test report will created.
+# + NO, No Test report.
+#
+# - File path indicates the base path of the test report.
+# - File name indicates the name of the test report.
+#
+# - File format indicates the type of the test report.
+# + TXT, Test report file will be txt type, for example 'TestReport.txt'.
+# + HTML, Test report will be html type, for example 'TestReport.html'.
+#
+# - File output indicates output source of the test report.
+# + FILE, Test report logging to file.
+# + RDEBUG, Test report logging to using rdebug.
+#
+# - File Creation Mode indicates test report overwriting if file exist.
+# + OVERWRITE, Overwrites if the Test report file exist.
+# + APPEND, Continue logging after the old Test report information if
+# report exist.
+# - Sets a device reset module's dll name(Reboot).
+# + If Nokia specific reset module is not available or it is not correct one
+# StifHWResetStub module may use as a template for user specific reset
+# module.
+# - Sets STIF test measurement disable options. e.g. pluging1 and pluging2 disablation
+# DisableMeasurement= stifmeasurementplugin01 stifmeasurementplugin02
+#
+
+[Engine_Defaults]
+
+TestReportMode= FullReport # Possible values are: 'Empty', 'Summary', 'Environment',
+ 'TestCases' or 'FullReport'
+
+CreateTestReport= YES # Possible values: YES or NO
+
+TestReportFilePath= E:\testing\logs\
+TestReportFileName= locodDaemonMt_TestReport
+
+TestReportFormat= TXT # Possible values: TXT or HTML
+TestReportOutput= FILE # Possible values: FILE or RDEBUG
+TestReportFileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
+
+DeviceResetDllName= StifResetForNokia.dll # e.g. 'StifHWResetStub.dll' for user specific reseting
+
+DisableMeasurement= stifmeasurementdisablenone # Possible values are:
+ # 'stifmeasurementdisablenone', 'stifmeasurementdisableall'
+ # 'stifmeasurementplugin01', 'stifmeasurementplugin02',
+ # 'stifmeasurementplugin03', 'stifmeasurementplugin04',
+ # 'stifmeasurementplugin05' or 'stifbappeaprofiler'
+
+Timeout= 0 # Default timeout value for each test case. In milliseconds
+
+[End_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Module configurations start
+# Modules are added between module tags
+# tags. Module name is specified after ModuleName= tag, like
+# ModuleName= XXXXXXXXX
+# Modules might have initialisation file, specified as
+# IniFile= c:\testframework\YYYYYY
+# Modules might have several configuration files, like
+# TestCaseFile= c:\testframework\NormalCases.txt
+# TestCaseFile= c:\testframework\SmokeCases.txt
+# TestCaseFile= c:\testframework\ManualCases.txt
+
+# (TestCaseFile is synonym for old term ConfigFile)
+
+# Following case specifies demo module settings. Demo module
+# does not read any settings from file, so tags
+# IniFile and TestCaseFile are not used.
+# In the simplest case it is enough to specify only the
+# name of the test module when adding new test module
+
+[New_Module]
+ModuleName= locoddaemonmt
+[End_Module]
+
+
+# Load testmoduleXXX, optionally with initialization file and/or test case files
+#[New_Module]
+#ModuleName= testmodulexxx
+
+#TestModuleXXX used initialization file
+#IniFile= c:\testframework\init.txt
+
+#TestModuleXXX used configuration file(s)
+#TestCaseFile= c:\testframework\testcases1.cfg
+#TestCaseFile= c:\testframework\testcases2.cfg
+#TestCaseFile= c:\testframework\manualtestcases.cfg
+
+#[End_Module]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+
+
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+# Set STIF logging overwrite parameters for Logger.
+# Hardware and emulator environment logging path and styles can
+# be configured from here to overwrite the Logger's implemented values.
+#
+# Settings description:
+# - Indicates option for creation log directory/directories. If log directory/directories
+# is/are not created by user they will make by software.
+# + YES, Create log directory/directories if not allready exist.
+# + NO, Log directory/directories not created. Only created one is used.
+#
+# - Overwrite emulator path setting.
+# + Example: If 'EmulatorBasePath= C:\LOGS\TestFramework\' and in code is defined
+# Logger's path 'D:\\LOGS\\Module\\' with those definition the path
+# will be 'C:\LOGS\TestFramework\LOGS\Module\'
+#
+# - Overwrite emulator's logging format.
+# + TXT, Log file(s) will be txt type(s), for example 'Module.txt'.
+# + HTML, Log file(s) will be html type(s), for example 'Module.html'.
+#
+# - Overwrited emulator logging output source.
+# + FILE, Logging to file(s).
+# + RDEBUG, Logging to using rdebug(s).
+#
+# - Overwrite hardware path setting (Same description as above in emulator path).
+# - Overwrite hardware's logging format(Same description as above in emulator format).
+# - Overwrite hardware's logging output source(Same description as above in emulator output).
+#
+# - File Creation Mode indicates file overwriting if file exist.
+# + OVERWRITE, Overwrites if file(s) exist.
+# + APPEND, Continue logging after the old logging information if file(s) exist.
+#
+# - Will thread id include to the log filename.
+# + YES, Thread id to log file(s) name, Example filename 'Module_b9.txt'.
+# + NO, No thread id to log file(s), Example filename 'Module.txt'.
+#
+# - Will time stamps include the to log file.
+# + YES, Time stamp added to each line in log file(s). Time stamp is
+# for example'12.Nov.2003 115958 LOGGING INFO'
+# + NO, No time stamp(s).
+#
+# - Will line breaks include to the log file.
+# + YES, Each logging event includes line break and next log event is in own line.
+# + NO, No line break(s).
+#
+# - Will event ranking include to the log file.
+# + YES, Event ranking number added to each line in log file(s). Ranking number
+# depends on environment's tics, for example(includes time stamp also)
+# '012 12.Nov.2003 115958 LOGGING INFO'
+# + NO, No event ranking.
+#
+# - Will write log file in unicode format.
+# + YES, Log file will be written in unicode format
+# + NO, Log will be written as normal, not unicode, file.
+#
+
+[Logger_Defaults]
+
+#NOTE: If you want to set Logger using next setting(s) remove comment(s)'#'
+#NOTE: TestEngine and TestServer logging settings cannot change here
+
+CreateLogDirectories= YES # Possible values: YES or NO
+
+#EmulatorBasePath= C:\LOGS\TestFramework\
+#EmulatorFormat= HTML # Possible values: TXT or HTML
+#EmulatorOutput= FILE # Possible values: FILE or RDEBUG
+
+#HardwareBasePath= D:\LOGS\TestFramework\
+#HardwareFormat= HTML # Possible values: TXT or HTML
+#HardwareOutput= FILE # Possible values: FILE or RDEBUG
+
+#FileCreationMode= OVERWRITE # Possible values: OVERWRITE or APPEND
+
+#ThreadIdToLogFile= YES # Possible values: YES or NO
+#WithTimeStamp= YES # Possible values: YES or NO
+#WithLineBreak= YES # Possible values: YES or NO
+#WithEventRanking= YES # Possible values: YES or NO
+
+#FileUnicode= YES # Possible values: YES or NO
+
+[End_Logger_Defaults]
+# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
+
+# End of file
\ No newline at end of file
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/src/BtSettings.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/src/BtSettings.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2002 - 2008 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Class which is resposible for handling communication with
+* Bt settings API
+*
+*/
+
+
+#include "BtSettings.h"
+
+CBtSettings::CBtSettings()
+ {
+ // No implementation required
+ }
+
+CBtSettings::~CBtSettings()
+ {
+ delete iSettings;
+ if( iWaiter->IsStarted() )
+ {
+ iWaiter->AsyncStop();
+ }
+ delete iWaiter;
+ }
+
+CBtSettings* CBtSettings::NewLC()
+ {
+ CBtSettings* self = new ( ELeave ) CBtSettings();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ return self;
+ }
+
+CBtSettings* CBtSettings::NewL()
+ {
+ CBtSettings* self = CBtSettings::NewLC();
+ CleanupStack::Pop(); // self;
+ return self;
+ }
+
+void CBtSettings::ConstructL()
+ {
+ iWaiter = new ( ELeave ) CActiveSchedulerWait();
+ iSettings = CBTEngSettings::NewL( this );
+ iError = KErrNone;
+ }
+
+void CBtSettings::PowerStateChanged( TBTPowerStateValue /*aState*/ )
+ {
+ if( iWaiter->IsStarted() )
+ {
+ iWaiter->AsyncStop();
+ }
+ }
+
+void CBtSettings::VisibilityModeChanged( TBTVisibilityMode /*aState*/ )
+ {
+ if( iWaiter->IsStarted() )
+ {
+ iWaiter->AsyncStop();
+ }
+ }
+
+TInt CBtSettings::GetPowerState( TBTPowerStateValue& aState )
+ {
+ iError = iSettings->GetPowerState( aState );
+ return iError;
+ }
+
+TInt CBtSettings::SetPowerState( TBTPowerStateValue aState )
+ {
+ TBTPowerStateValue state;
+
+ iError = iSettings->GetPowerState( state );
+ if( iError )
+ {
+ return iError;
+ }
+ else if( state != aState )
+ {
+ if( state == EBTPowerOff )
+ {
+ iError = iSettings->SetPowerState( EBTPowerOn );
+ }
+ else
+ {
+ iError = iSettings->SetPowerState( EBTPowerOff );
+ }
+
+ if( iError )
+ {
+ return iError;
+ }
+ else
+ {
+ if ( !iWaiter->IsStarted() )
+ {
+ iWaiter->Start();
+ }
+ }
+ }
+ return iError;
+ }
+
+TInt CBtSettings::GetVisibilityMode( TBTVisibilityMode& aMode )
+ {
+ return KErrNone;
+ }
+
+TInt SetVisibilityMode( TBTVisibilityMode aMode, TInt aTime )
+ {
+ return KErrNone;
+ }
+
+TInt GetLocalName( TDes& aName )
+ {
+ return KErrNone;
+ }
+
+TInt SetLocalName( const TDes& aName )
+ {
+ return KErrNone;
+ }
+
+// End of file
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/src/daemonmt.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/src/daemonmt.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,337 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: daemonmt class member functions
+*
+*/
+
+
+
+// INCLUDE FILES
+#include
+#include "daemonmt.h"
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::Cdaemonmt
+// C++ default constructor can NOT contain any code, that
+// might leave.
+// -----------------------------------------------------------------------------
+//
+Cdaemonmt::Cdaemonmt()
+ {
+
+ }
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::ConstructL
+// Symbian 2nd phase constructor can leave.
+//
+// Note: If OOM test case uses STIF Logger, then STIF Logger must be created
+// with static buffer size parameter (aStaticBufferSize). Otherwise Logger
+// allocates memory from heap and therefore causes error situations with OOM
+// testing. For more information about STIF Logger construction, see STIF Users
+// Guide.
+// -----------------------------------------------------------------------------
+//
+void Cdaemonmt::ConstructL()
+ {
+ iLog = CStifLogger::NewL( KdaemonmtLogPath,
+ KdaemonmtLogFile);
+
+ // Sample how to use logging
+ _LIT( KLogStart, "daemonmt logging starts!" );
+ iLog->Log( KLogStart );
+
+ iScheduler = new (ELeave) CActiveScheduler;
+ CActiveScheduler::Install( iScheduler );
+ }
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::NewL
+// Two-phased constructor.
+// -----------------------------------------------------------------------------
+//
+Cdaemonmt* Cdaemonmt::NewL()
+ {
+ Cdaemonmt* self = new (ELeave) Cdaemonmt;
+
+ CleanupStack::PushL( self );
+ self->ConstructL();
+ CleanupStack::Pop();
+
+ return self;
+
+ }
+
+// Destructor
+Cdaemonmt::~Cdaemonmt()
+ {
+ iProperty.Close();
+ delete iLog;
+ if( iBtSettings )
+ {
+ delete iBtSettings;
+ }
+ delete iScheduler;
+ }
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::InitL
+// InitL is used to initialize the Test Module.
+// -----------------------------------------------------------------------------
+//
+TInt Cdaemonmt::InitL(
+ TFileName& /*aIniFile*/,
+ TBool /*aFirstTime*/ )
+ {
+ return KErrNone;
+ // start LocalConnectivityDaemon.exe
+ //return StartDaemon();
+
+ }
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::GetTestCasesL
+// GetTestCases is used to inquire test cases from the Test Module. Test
+// cases are stored to array of test cases. The Test Framework will be
+// the owner of the data in the RPointerArray after GetTestCases return
+// and it does the memory deallocation.
+// -----------------------------------------------------------------------------
+//
+TInt Cdaemonmt::GetTestCasesL(
+ const TFileName& /*aConfig*/,
+ RPointerArray& aTestCases )
+ {
+
+ // Loop through all test cases and create new
+ // TTestCaseInfo items and append items to aTestCase array
+ for( TInt i = 0; Case(i).iMethod != NULL; i++ )
+ {
+
+ // Allocate new TTestCaseInfo from heap for a testcase definition.
+ TTestCaseInfo* newCase = new( ELeave ) TTestCaseInfo();
+
+ // PushL TTestCaseInfo to CleanupStack.
+ CleanupStack::PushL( newCase );
+
+ // Set number for the testcase.
+ // When the testcase is run, this comes as a parameter to RunTestCaseL.
+ newCase->iCaseNumber = i;
+
+ // Set title for the test case. This is shown in UI to user.
+ newCase->iTitle.Copy( Case(i).iCaseName );
+
+ // Append TTestCaseInfo to the testcase array. After appended
+ // successfully the TTestCaseInfo object is owned (and freed)
+ // by the TestServer.
+ User::LeaveIfError(aTestCases.Append ( newCase ) );
+
+ // Pop TTestCaseInfo from the CleanupStack.
+ CleanupStack::Pop( newCase );
+
+ }
+
+ return KErrNone;
+
+ }
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::RunTestCaseL
+// RunTestCaseL is used to run an individual test case specified
+// by aTestCase. Test cases that can be run may be requested from
+// Test Module by GetTestCases method before calling RunTestCase.
+// -----------------------------------------------------------------------------
+//
+TInt Cdaemonmt::RunTestCaseL(
+ const TInt aCaseNumber,
+ const TFileName& /*aConfig*/,
+ TTestResult& aResult )
+ {
+
+ // Return value
+ TInt execStatus = KErrNone;
+
+ // Get the pointer to test case function
+ TCaseInfo tmp = Case ( aCaseNumber );
+
+ _LIT( KLogStartTC, "Starting testcase [%S]" );
+ iLog->Log( KLogStartTC, &tmp.iCaseName);
+
+ // Check that case number was valid
+ if ( tmp.iMethod != NULL )
+ {
+ // Valid case was found, call it via function pointer
+ iMethod = tmp.iMethod;
+ execStatus = ( this->*iMethod )( aResult );
+ }
+ else
+ {
+ // Valid case was not found, return error.
+ execStatus = KErrNotFound;
+ }
+
+ // Return case execution status (not the result of the case execution)
+ return execStatus;
+
+ }
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::OOMTestQueryL
+// Used to check if a particular test case should be run in OOM conditions and
+// which memory allocations should fail.
+// -----------------------------------------------------------------------------
+//
+TBool Cdaemonmt::OOMTestQueryL(
+ const TFileName& /* aTestCaseFile */,
+ const TInt aCaseNumber,
+ TOOMFailureType& /* aFailureType */,
+ TInt& aFirstMemFailure,
+ TInt& aLastMemFailure )
+ {
+ _LIT( KLogOOMTestQueryL, "Cdaemonmt::OOMTestQueryL" );
+ iLog->Log( KLogOOMTestQueryL );
+
+ aFirstMemFailure = Case( aCaseNumber ).iFirstMemoryAllocation;
+ aLastMemFailure = Case( aCaseNumber ).iLastMemoryAllocation;
+
+ return Case( aCaseNumber ).iIsOOMTest;
+
+ }
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::OOMTestInitializeL
+// Used to perform the test environment setup for a particular OOM test case.
+// Test Modules may use the initialization file to read parameters for Test
+// Module initialization but they can also have their own configure file or
+// some other routine to initialize themselves.
+//
+// NOTE: User may add implementation for OOM test environment initialization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void Cdaemonmt::OOMTestInitializeL(
+ const TFileName& /* aTestCaseFile */,
+ const TInt /* aCaseNumber */ )
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::OOMHandleWarningL
+// In some cases the heap memory allocation should be skipped, either due to
+// problems in the OS code or components used by the code being tested, or even
+// inside the tested components which are implemented this way on purpose (by
+// design), so it is important to give the tester a way to bypass allocation
+// failures.
+//
+// NOTE: User may add implementation for OOM test warning handling. Usually no
+// implementation is required.
+// -----------------------------------------------------------------------------
+//
+void Cdaemonmt::OOMHandleWarningL(
+ const TFileName& /* aTestCaseFile */,
+ const TInt /* aCaseNumber */,
+ TInt& /* aFailNextValue */ )
+ {
+ }
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::OOMTestFinalizeL
+// Used to perform the test environment cleanup for a particular OOM test case.
+//
+// NOTE: User may add implementation for OOM test environment finalization.
+// Usually no implementation is required.
+// -----------------------------------------------------------------------------
+//
+void Cdaemonmt::OOMTestFinalizeL(
+ const TFileName& /* aTestCaseFile */,
+ const TInt /* aCaseNumber */ )
+ {
+ }
+
+// ========================== OTHER EXPORTED FUNCTIONS =========================
+
+// -----------------------------------------------------------------------------
+// LibEntryL is a polymorphic Dll entry point
+// Returns: CTestModuleBase*: Pointer to Test Module object
+// -----------------------------------------------------------------------------
+//
+EXPORT_C CTestModuleBase* LibEntryL()
+ {
+ return Cdaemonmt::NewL();
+
+ }
+
+// -----------------------------------------------------------------------------
+// SetRequirements handles test module parameters(implements evolution
+// version 1 for test module's heap and stack sizes configuring).
+// Returns: TInt: Symbian error code.
+// -----------------------------------------------------------------------------
+//
+EXPORT_C TInt SetRequirements( CTestModuleParam*& /*aTestModuleParam*/,
+ TUint32& /*aParameterValid*/ )
+ {
+
+ /* --------------------------------- NOTE ---------------------------------
+ USER PANICS occurs in test thread creation when:
+ 1) "The panic occurs when the value of the stack size is negative."
+ 2) "The panic occurs if the minimum heap size specified is less
+ than KMinHeapSize".
+ KMinHeapSize: "Functions that require a new heap to be allocated will
+ either panic, or will reset the required heap size to this value if
+ a smaller heap size is specified".
+ 3) "The panic occurs if the minimum heap size specified is greater than
+ the maximum size to which the heap can grow".
+ Other:
+ 1) Make sure that your hardware or Symbian OS is supporting given sizes.
+ e.g. Hardware might support only sizes that are divisible by four.
+ ------------------------------- NOTE end ------------------------------- */
+
+ // Normally STIF uses default heap and stack sizes for test thread, see:
+ // KTestThreadMinHeap, KTestThreadMinHeap and KStackSize.
+ // If needed heap and stack sizes can be configured here by user. Remove
+ // comments and define sizes.
+
+/*
+ aParameterValid = KStifTestModuleParameterChanged;
+
+ CTestModuleParamVer01* param = CTestModuleParamVer01::NewL();
+ // Stack size
+ param->iTestThreadStackSize= 16384; // 16K stack
+ // Heap sizes
+ param->iTestThreadMinHeap = 4096; // 4K heap min
+ param->iTestThreadMaxHeap = 1048576;// 1M heap max
+
+ aTestModuleParam = param;
+*/
+ return KErrNone;
+
+ }
+
+// -----------------------------------------------------------------------------
+// E32Dll is a DLL entry point function
+// Returns: KErrNone: No error
+// -----------------------------------------------------------------------------
+//
+#ifndef EKA2 // Hide Dll entry point to EKA2
+GLDEF_C TInt E32Dll(
+ TDllReason /*aReason*/) // Reason
+ {
+ return(KErrNone);
+
+ }
+#endif // EKA2
+
+// End of File
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 localconnectivityservice/locod/tsrc/locodTest/src/daemonmtCases.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/localconnectivityservice/locod/tsrc/locodTest/src/daemonmtCases.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -0,0 +1,224 @@
+/*
+* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: ?Description
+*
+*/
+
+
+
+// INCLUDE FILES
+#include
+#include
+#include "daemonmt.h"
+
+
+
+// ============================ MEMBER FUNCTIONS ===============================
+
+// -----------------------------------------------------------------------------
+// Cdaemonmt::Case
+// Returns a test case by number.
+//
+// This function contains an array of all available test cases
+// i.e pair of case name and test function. If case specified by parameter
+// aCaseNumber is found from array, then that item is returned.
+//
+// The reason for this rather complicated function is to specify all the
+// test cases only in one place. It is not necessary to understand how
+// function pointers to class member functions works when adding new test
+// cases. See function body for instructions how to add new test case.
+// -----------------------------------------------------------------------------
+//
+const TCaseInfo Cdaemonmt::Case (
+ const TInt aCaseNumber ) const
+ {
+
+ /**
+ * To add new test cases, implement new test case function and add new
+ * line to KCases array specify the name of the case and the function
+ * doing the test case
+ * In practice, do following
+ * 1) Make copy of existing test case function and change its name
+ * and functionality. Note that the function must be added to
+ * daemonmt.cpp file and to daemonmt.h
+ * header file.
+ *
+ * 2) Add entry to following KCases array either by using:
+ *
+ * 2.1: FUNCENTRY or ENTRY macro
+ * ENTRY macro takes two parameters: test case name and test case
+ * function name.
+ *
+ * FUNCENTRY macro takes only test case function name as a parameter and
+ * uses that as a test case name and test case function name.
+ *
+ * Or
+ *
+ * 2.2: OOM_FUNCENTRY or OOM_ENTRY macro. Note that these macros are used
+ * only with OOM (Out-Of-Memory) testing!
+ *
+ * OOM_ENTRY macro takes five parameters: test case name, test case
+ * function name, TBool which specifies is method supposed to be run using
+ * OOM conditions, TInt value for first heap memory allocation failure and
+ * TInt value for last heap memory allocation failure.
+ *
+ * OOM_FUNCENTRY macro takes test case function name as a parameter and uses
+ * that as a test case name, TBool which specifies is method supposed to be
+ * run using OOM conditions, TInt value for first heap memory allocation
+ * failure and TInt value for last heap memory allocation failure.
+ */
+
+ static TCaseInfoInternal const KCases[] =
+ {
+ // To add new test cases, add new items to this array
+ ENTRY( "StartDaemon test", Cdaemonmt::StartDaemon )
+ };
+
+ // Verify that case number is valid
+ if( (TUint) aCaseNumber >= sizeof( KCases ) /
+ sizeof( TCaseInfoInternal ) )
+ {
+ // Invalid case, construct empty object
+ TCaseInfo null( (const TText*) L"" );
+ null.iMethod = NULL;
+ null.iIsOOMTest = EFalse;
+ null.iFirstMemoryAllocation = 0;
+ null.iLastMemoryAllocation = 0;
+ return null;
+ }
+
+ // Construct TCaseInfo object and return it
+ TCaseInfo tmp ( KCases[ aCaseNumber ].iCaseName );
+ tmp.iMethod = KCases[ aCaseNumber ].iMethod;
+ tmp.iIsOOMTest = KCases[ aCaseNumber ].iIsOOMTest;
+ tmp.iFirstMemoryAllocation = KCases[ aCaseNumber ].iFirstMemoryAllocation;
+ tmp.iLastMemoryAllocation = KCases[ aCaseNumber ].iLastMemoryAllocation;
+ return tmp;
+ }
+
+
+TInt Cdaemonmt::StartDaemon( TTestResult& aResult )
+ {
+ iBtSettings = CBtSettings::NewL();
+ iLog->Log( _L( "Starting test and setting BT Power ON" ) );
+ TInt error = iBtSettings->SetPowerState( EBTPowerOn );
+ if( error )
+ {
+ iLog->Log( _L( "Error %d when setting BT power state" ), error );
+ aResult.SetResult( KErrGeneral, _L( "StartDaemon failed" ) );
+ return KErrNone;
+ }
+
+ TInt systemState = KErrNone;
+ error = iProperty.Get( KPSUidStartup, KPSGlobalSystemState, systemState );
+ if( error )
+ {
+ iLog->Log( _L( "Failed to get GlobalSystemState" ) );
+ }
+
+ // Switching GlobalSystemState to ESwStateShuttingDown causes locod
+ // not to load bearer plugins immediately after its starts.
+ iLog->Log( _L( "Changing GlobalSystemState to ESwStateShuttingDown" ) );
+ error = iProperty.Set( KPSUidStartup, KPSGlobalSystemState, ESwStateShuttingDown );
+ if( error )
+ {
+ iLog->Log( _L( "Failed to switch GlobalSystemState to ESwStateShuttingDown with error: %d" ), error );
+ aResult.SetResult( KErrGeneral, _L( "StartDaemon failed" ) );
+ return KErrNone;
+ }
+
+ _LIT(KDaemonExe, "locod.exe");
+ // Starts Daemon in a new process.
+ const TUidType exeUid(KNullUid, KNullUid, TUid::Uid(0x2000276D));
+ RProcess daemon;
+ TInt r = daemon.Create(KDaemonExe, KNullDesC, exeUid);
+ TBuf<256> err;
+ if (r != KErrNone)
+ {
+ _LIT( KDescription, "StartDaemon failed: daemon.Create() %d" );
+ aResult.SetResult( r, KDescription );
+ err.Format( KDescription, r);
+ iLog->Log( err );
+ return r;
+ }
+ daemon.Resume();
+
+ // Switching GlobalSystemState to ESwStateNormalRfOn causes locod
+ // to load bearer plugins.
+ iLog->Log( _L( "Changing GlobalSystemState to ESwStateNormalRfOn" ) );
+ error = iProperty.Set( KPSUidStartup, KPSGlobalSystemState, ESwStateNormalRfOn );
+ if( error )
+ {
+ iLog->Log( _L( "Failed to switch GlobalSystemState to ESwStateNormalRfOn with error: %d" ), error );
+ aResult.SetResult( KErrGeneral, _L( "StartDaemon failed" ) );
+ return KErrNone;
+ }
+
+ User::After( 2000000 );
+
+ // Switching GlobalSystemState to ESwStateShuttingDown causes locod
+ // to unload bearer plugins.
+ iLog->Log( _L( "Changing GlobalSystemState to ESwStateShuttingDown" ) );
+ error = iProperty.Set( KPSUidStartup, KPSGlobalSystemState, ESwStateShuttingDown );
+ if( error )
+ {
+ iLog->Log( _L( "Failed to switch GlobalSystemState to ESwStateShuttingDown with error: %d" ), error );
+ aResult.SetResult( KErrGeneral, _L( "StartDaemon failed" ) );
+ return KErrNone;
+ }
+
+ User::After( 2000000 );
+ daemon.Close();
+
+ // Switching GlobalSystemState to the state forom the start of the test to leave the LC stack
+ // working after the test.
+ if( systemState != KErrNone )
+ {
+ iLog->Log( _L( "Changing GlobalSystemState to %d" ), systemState );
+ error = iProperty.Set( KPSUidStartup, KPSGlobalSystemState, systemState );
+ }
+ else
+ {
+ iLog->Log( _L( "Changing GlobalSystemState to ESwStateNormalRfOn" ) );
+ error = iProperty.Set( KPSUidStartup, KPSGlobalSystemState, ESwStateNormalRfOn );
+ }
+
+ if( error )
+ {
+ iLog->Log( _L( "Failed to switch GlobalSystemState to ESwStateNormalRfOn with error: %d" ), error );
+ aResult.SetResult( KErrGeneral, _L( "StartDaemon failed" ) );
+ return KErrNone;
+ }
+
+ User::After( 2000000 );
+
+ iLog->Log( _L( "Ending test and setting BT Power ON" ) );
+ error = iBtSettings->SetPowerState( EBTPowerOn );
+ if( error )
+ {
+ iLog->Log( _L( "Error %d when setting BT power state" ), error );
+ aResult.SetResult( KErrGeneral, _L( "StartDaemon failed" ) );
+ return KErrNone;
+ }
+
+ User::After( 2000000 );
+
+ delete iBtSettings;
+ iBtSettings = NULL;
+
+ aResult.SetResult( KErrNone, _L( "StartDaemon passed" ) );
+ return KErrNone;
+ }
+
+// End of File
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtpdataproviders/mtpfileandfolderdp/src/cmtpfiledp.cpp
--- a/mtpdataproviders/mtpfileandfolderdp/src/cmtpfiledp.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/mtpdataproviders/mtpfileandfolderdp/src/cmtpfiledp.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -209,19 +209,24 @@
}
OstTraceFunctionExit0( CMTPFILEDATAPROVIDER_SUPPORTED_EXIT );
}
-
+
+#ifdef OST_TRACE_COMPILER_IN_USE
void CMTPFileDataProvider::NotifyEnumerationCompleteL(TUint32 aStorageId, TInt aError)
+#else
+void CMTPFileDataProvider::NotifyEnumerationCompleteL(TUint32 aStorageId, TInt /*aError*/)
+#endif
{
OstTraceFunctionEntry0( CMTPFILEDATAPROVIDER_NOTIFYENUMERATIONCOMPLETEL_ENTRY );
OstTraceExt2( TRACE_NORMAL, CMTPFILEDATAPROVIDER_NOTIFYENUMERATIONCOMPLETEL,
"Enumeration of storage 0x%08X completed with error status %d", aStorageId, (TInt32)aError);
+ aStorageId = aStorageId;
__ASSERT_DEBUG((aStorageId == iPendingEnumerations[KActiveEnumeration]), User::Invariant());
Framework().ObjectEnumerationCompleteL(iPendingEnumerations[KActiveEnumeration]);
iPendingEnumerations.Remove(KActiveEnumeration);
OstTraceFunctionExit0( CMTPFILEDATAPROVIDER_NOTIFYENUMERATIONCOMPLETEL_EXIT );
}
-
+
/**
Standard C++ constructor
*/
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtpdataproviders/mtpplaybackcontroldp/group/bld.inf
--- a/mtpdataproviders/mtpplaybackcontroldp/group/bld.inf Tue Sep 28 20:14:08 2010 +0800
+++ b/mtpdataproviders/mtpplaybackcontroldp/group/bld.inf Fri Oct 15 15:05:57 2010 +0800
@@ -22,7 +22,7 @@
DEFAULT
PRJ_EXPORTS
-mtp_playbackcontroldp.iby /epoc32/rom/include/mtp_playbackcontroldp.iby
+mtp_playbackcontroldp.iby CORE_MW_LAYER_IBY_EXPORT_PATH(mtp_playbackcontroldp.iby)
PRJ_MMPFILES
mtpplaybackcontroldp.mmp
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtpfws/mtpfw/src/cmtpconnectionmgr.cpp
--- a/mtpfws/mtpfw/src/cmtpconnectionmgr.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/mtpfws/mtpfw/src/cmtpconnectionmgr.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -511,8 +511,10 @@
TInt CMTPConnectionMgr::DoResumeSuspendedTransport( TAny* aSelf )
{
CMTPConnectionMgr* self = reinterpret_cast< CMTPConnectionMgr* >( aSelf );
- __ASSERT_DEBUG( ( self->iSuspendedTransports.Count() > 0 ), User::Invariant() );
- TRAP_IGNORE( self->StartTransportL( self->iSuspendedTransports[self->iSuspendedTransports.Count()-1] ) );
+ if(self->iSuspendedTransports.Count() > 0)
+ {
+ TRAP_IGNORE( self->StartTransportL( self->iSuspendedTransports[self->iSuspendedTransports.Count()-1] ) );
+ }
return KErrNone;
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtpfws/mtpfw/src/cmtpdataprovider.cpp
--- a/mtpfws/mtpfw/src/cmtpdataprovider.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/mtpfws/mtpfw/src/cmtpdataprovider.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -502,8 +502,11 @@
OstTraceFunctionExit0( CMTPDATAPROVIDER_ROUTEREQUESTUNREGISTERL_EXIT );
}
-
+#ifdef OST_TRACE_COMPILER_IN_USE
void CMTPDataProvider::ObjectEnumerationCompleteL(TUint32 aStorageId)
+#else
+void CMTPDataProvider::ObjectEnumerationCompleteL(TUint32 /*aStorageId*/)
+#endif
{
OstTraceFunctionEntry0( CMTPDATAPROVIDER_OBJECTENUMERATIONCOMPLETEL_ENTRY );
OstTrace1(TRACE_NORMAL, CMTPDATAPROVIDER_OBJECTENUMERATIONCOMPLETEL,
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtpfws/mtpfw/src/cmtpdataprovidercontroller.cpp
--- a/mtpfws/mtpfw/src/cmtpdataprovidercontroller.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/mtpfws/mtpfw/src/cmtpdataprovidercontroller.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -713,8 +713,11 @@
OstTraceFunctionExit0( CMTPDATAPROVIDERCONTROLLER_RUNL_EXIT );
}
-
+#ifdef OST_TRACE_COMPILER_IN_USE
TInt CMTPDataProviderController::RunError(TInt aError)
+#else
+TInt CMTPDataProviderController::RunError(TInt /*aError*/)
+#endif
{
OstTraceFunctionEntry0( CMTPDATAPROVIDERCONTROLLER_RUNERROR_ENTRY );
OstTrace1(TRACE_NORMAL, CMTPDATAPROVIDERCONTROLLER_RUNERROR, "Error = %d", aError);
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtpfws/mtpfw/src/cmtpdeltadatamgr.cpp
--- a/mtpfws/mtpfw/src/cmtpdeltadatamgr.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/mtpfws/mtpfw/src/cmtpdeltadatamgr.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -105,7 +105,7 @@
}
}
LEAVEIFERROR(iDeltaTableBatched.Open(iDatabase, KMTPDeltaDataTable, RDbRowSet::EUpdatable),
- OstTrace0( TRACE_ERROR, DUP1_CMTPDELTADATAMGR_CREATEDELTADATATABLEL, "MTPDeltaDataTable open error!" ));
+ OstTrace0( TRACE_ERROR, DUP2_CMTPDELTADATAMGR_CREATEDELTADATATABLEL, "MTPDeltaDataTable open error!" ));
OstTraceFunctionExit0( CMTPDELTADATAMGR_CREATEDELTADATATABLEL_EXIT );
}
@@ -134,7 +134,7 @@
}
}
LEAVEIFERROR(iAnchorTableBatched.Open(iDatabase, KAnchorIdTable, RDbRowSet::EUpdatable),
- OstTrace0( TRACE_ERROR, DUP1_CMTPDELTADATAMGR_CREATEANCHORIDTABLEL, "AnchorIdTable open error!" ));
+ OstTrace0( TRACE_ERROR, DUP2_CMTPDELTADATAMGR_CREATEANCHORIDTABLEL, "AnchorIdTable open error!" ));
OstTraceFunctionExit0( CMTPDELTADATAMGR_CREATEANCHORIDTABLEL_EXIT );
}
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtptransports/mtpcontroller/group/mtpcontroller.mmp
--- a/mtptransports/mtpcontroller/group/mtpcontroller.mmp Tue Sep 28 20:14:08 2010 +0800
+++ b/mtptransports/mtpcontroller/group/mtpcontroller.mmp Fri Oct 15 15:05:57 2010 +0800
@@ -30,8 +30,7 @@
CAPABILITY ALL -TCB
SYSTEMINCLUDE /epoc32/include/ecom
-SYSTEMINCLUDE ../locodinc
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
+MW_LAYER_SYSTEMINCLUDE
USERINCLUDE ../inc
USERINCLUDE ../../../mtpfws/mtpfw/common/inc
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtptransports/mtpcontroller/locodinc/locodbearer.h
--- a/mtptransports/mtpcontroller/locodinc/locodbearer.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Defines the LCD Bearer Plugin identifier.
-*
-*/
-
-
-#ifndef T_LOCODBEARER_H
-#define T_LOCODBEARER_H
-
-#include
-
-/** bearer value in LC */
-enum TLocodBearer
- {
- ELocodBearerBT = 0x0001,
- ELocodBearerIR = 0x0010,
- ELocodBearerUSB = 0x0100,
- };
-
-#endif // T_LOCODBEARER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtptransports/mtpcontroller/locodinc/locodplugin.hrh
--- a/mtptransports/mtpcontroller/locodinc/locodplugin.hrh Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: Definitions for plugin resource registration.
-*
-*/
-
-
-#ifndef LOCODPLUGIN_HRH
-#define LOCODPLUGIN_HRH
-
-/**
- * This file contains the defintions for plugin resource registration.
- *
- * All plugins should use version 2 registration resource file and set the
- * rom_only field to 1 to prevent it from being overridden by RAM-based plugins.
- *
- * All bearer plugins should use KLOCODBEARERINTERFACEUID as the interface UID.
- *
- * A bearer plugin should use its corresponding feature ID (from features.hrh) as the
- * implementation UID, that is,
- * Implementation UID of IR bearer is KFeatureIdIrda,
- * Implementation UID of BT bearer is KFeatureIdBt,
- * Implementation UID of USB bearer is KFeatureIdUsb.
- *
- * All service plugins should use KLOCODSERVICEINTERFACEUID as the interface UID.
- *
- * A service plugin should use its corresponding feature ID (from features.hrh) as the
- * implementation UID, that is,
- * Implementation UID of Dun is KFeatureIdDun, (not exist yet, CR created)
- * Implementation UID of Obex is KFeatureIdSrcs,
- *
- */
-
-// Interface UID of bearer plugins
-#define KLOCODBEARERINTERFACEUID 0x20002771
-
-// Interface UID of service plugins
-#define KLOCODSERVICEINTERFACEUID 0x20002772
-
-#endif // LOCODPLUGIN_HRH
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtptransports/mtpcontroller/locodinc/locodserviceplugin.h
--- a/mtptransports/mtpcontroller/locodinc/locodserviceplugin.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This is the LCD Service Plugin base class declaration.
-*
-*/
-
-
-#ifndef C_LOCODSERVICEPLUGIN_H
-#define C_LOCODSERVICEPLUGIN_H
-
-#include
-
-#include "locodservicepluginparams.h"
-#include "locodbearer.h"
-
-/**
- * Service Plugin base class
- *
- * This is the base class from which service plugins inherit.
- *
- * When a service plugin is constructed, it should not start any service by default.
- * A service is started on demand when the bearer is available.
- *
- * @euser.lib
- * @since S60 v3.2
- */
-class CLocodServicePlugin : public CBase
- {
-public:
-
- static CLocodServicePlugin* NewL(TLocodServicePluginParams& aParams);
-
- virtual ~CLocodServicePlugin();
-
- /**
- * Tell service plugin which service should be enabled or disabled according to
- * specified bearer and its status.
- *
- * On completion, the plugin should call
- * MLocodServicePluginObserver::ManageServiceCompleted() to inform the result.
- *
- * @since S60 v3.2
- * @param aBearer the bearer identification
- * @param aStatus the status of this bearer, ETrue if it is available;
- * EFalse otherwise.
- */
- virtual void ManageService(TLocodBearer aBearer, TBool aStatus) = 0;
-
- TUid ImplementationUid() const;
-
-protected:
-
- CLocodServicePlugin(TLocodServicePluginParams& aParams);
-
- /**
- * Gets the observer interface object associated with this plugin
- *
- * @since S60 v3.2
- * @return The observer object
- */
- MLocodServicePluginObserver& Observer() const;
-
-private: // data
-
- /**
- * UID set by ECOM when the instance is created. Used when the instance
- * is destroyed.
- */
- TUid iInstanceUid;
-
- /**
- * Implementation UID of the concrete instance.
- */
- const TUid iImplementationUid;
-
- /**
- * Holds the observer object which will be notified when the operations
- * complete
- * Not own.
- */
- MLocodServicePluginObserver& iObserver;
-
- };
-
-#include
-
-#endif // C_LOCODSERVICEPLUGIN_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtptransports/mtpcontroller/locodinc/locodserviceplugin.inl
--- a/mtptransports/mtpcontroller/locodinc/locodserviceplugin.inl Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This is the LCD Service Plugin construction parameters
-* declaration
-*
-*/
-
-
-#include
-
-// -----------------------------------------------------------------------------
-// Constructor method, just saves the arguments into member variables
-// -----------------------------------------------------------------------------
-//
-inline CLocodServicePlugin* CLocodServicePlugin::NewL(TLocodServicePluginParams& aParams)
- {
- CLocodServicePlugin* self = reinterpret_cast(
- REComSession::CreateImplementationL(
- aParams.ImplementationUid(),
- _FOFF(CLocodServicePlugin, iInstanceUid),
- (TAny*)&aParams)
- );
-
- return self;
- }
-
-
-// -----------------------------------------------------------------------------
-// Service plug ins destructor
-// -----------------------------------------------------------------------------
-//
-inline CLocodServicePlugin::~CLocodServicePlugin()
- {
- REComSession::DestroyedImplementation(iInstanceUid);
- }
-
-// -----------------------------------------------------------------------------
-// returns the implementation UID
-// -----------------------------------------------------------------------------
-//
-inline TUid CLocodServicePlugin::ImplementationUid() const
- {
- return iImplementationUid;
- }
-
-// -----------------------------------------------------------------------------
-// CLocodServicePlugin C++ constructor
-// -----------------------------------------------------------------------------
-//
-inline CLocodServicePlugin::CLocodServicePlugin(TLocodServicePluginParams& aParams)
- : iImplementationUid(aParams.ImplementationUid()),
- iObserver(aParams.Observer())
- {
- }
-
-// -----------------------------------------------------------------------------
-// return the observer class
-// -----------------------------------------------------------------------------
-//
-inline MLocodServicePluginObserver& CLocodServicePlugin::Observer() const
- {
- return iObserver;
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtptransports/mtpcontroller/locodinc/locodservicepluginobserver.h
--- a/mtptransports/mtpcontroller/locodinc/locodservicepluginobserver.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This is the LCD Service Plugin observer interface definition.
-*
-*/
-
-
-#ifndef M_LOCODSERVICEPLUGINOBSERVER_H
-#define M_LOCODSERVICEPLUGINOBSERVER_H
-
-#include "locodbearer.h"
-
-/**
- * LCD Service Plugin Observer interface class
- *
- * This is the service plugin observer interface definition used by LCD
- * Service Plugins to inform the daemon when an action is complete.
- *
- * @lib
- * @since S60 v3.2
- */
-class MLocodServicePluginObserver
- {
-public:
-
- /**
- * This is a callback function used by the plugins to inform when
- * managing the service have completed. The parameters passed should be
- * identical to the ones used when the plugin's ManageService() was called,
- * plus this service plugin's implemnetation UID and the completion status.
- *
- * @since S60 v3.2
- * @param aBearer the bearer identification passed in ManageService()
- * @param aStatus the status of this bearer passed in ManageService()
- * @param aServiceImplUid, the implementation UID of this service plugin.
- * @param err KErrNone if the operation succeeded; otherwise a Symbian
- * error code.
- */
- virtual void ManageServiceCompleted(
- TLocodBearer aBearer,
- TBool aStatus,
- TUid aServiceImplUid,
- TInt err) = 0;
- };
-
-#endif // M_LOCODSERVICEPLUGINOBSERVER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtptransports/mtpcontroller/locodinc/locodservicepluginparams.h
--- a/mtptransports/mtpcontroller/locodinc/locodservicepluginparams.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,79 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This is the LCD Service Plugin construction parameters
-* declaration
-*
-*/
-
-
-#ifndef T_LOCODSERVICEPLUGINPARAMS_H
-#define T_LOCODSERVICEPLUGINPARAMS_H
-
-class MLocodServicePluginObserver;
-
-/**
- * LCD Service Plugin Callback construction parameters
- *
- * This interface class is used to pass construction parameters to the
- * plugins. These parameters include the callback interface (usually
- * implemented by the LCD) and the ECOM plugin implementation UID
- *
- * @lib ?library
- * @since S60 v3.2
- */
-class TLocodServicePluginParams
- {
-public:
- /**
- * Constructor.
- *
- * @since S60 v3.2
- * @param aUid Implementation UID of the plugin being constructed
- * @param aObserver Callback interface object
- */
- TLocodServicePluginParams(TUid aUid, MLocodServicePluginObserver& aObserver);
-
- /**
- * Gets the implementation UID of the plugin
- *
- * @since S60 v3.2
- * @return Implementaion UID
- */
- TUid ImplementationUid() const;
-
- /**
- * Gets the observer interface object
- *
- * @since S60 v3.2
- * @return The observer object
- */
- MLocodServicePluginObserver& Observer() const;
-
-private: // data
-
- /**
- * The implementation UID
- */
- const TUid iImplementationUid;
-
- /**
- * Reference to the observer object
- */
- MLocodServicePluginObserver& iObserver;
-
- };
-
-#include "locodservicepluginparams.inl"
-
-#endif // T_LOCODSERVICEPLUGINPARAMS_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtptransports/mtpcontroller/locodinc/locodservicepluginparams.inl
--- a/mtptransports/mtpcontroller/locodinc/locodservicepluginparams.inl Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-/*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description: This is the LCD Service Plugin construction parameters
-* declaration
-*
-*/
-
-
-// -----------------------------------------------------------------------------
-// Constructor method, just saves the arguments into member variables
-// -----------------------------------------------------------------------------
-//
-inline TLocodServicePluginParams::TLocodServicePluginParams(TUid aUid, MLocodServicePluginObserver& aObserver)
- : iImplementationUid(aUid),
- iObserver(aObserver)
- {
- }
-
-// -----------------------------------------------------------------------------
-// Returns the implementation UID
-// -----------------------------------------------------------------------------
-//
-inline TUid TLocodServicePluginParams::ImplementationUid() const
- {
- return iImplementationUid;
- }
-
-// -----------------------------------------------------------------------------
-// return the observer class
-// -----------------------------------------------------------------------------
-//
-inline MLocodServicePluginObserver& TLocodServicePluginParams::Observer() const
- {
- return iObserver;
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 mtptransports/mtpptpiptransport/ptpipplugin/src/cptpipconnection.cpp
--- a/mtptransports/mtpptpiptransport/ptpipplugin/src/cptpipconnection.cpp Tue Sep 28 20:14:08 2010 +0800
+++ b/mtptransports/mtpptpiptransport/ptpipplugin/src/cptpipconnection.cpp Fri Oct 15 15:05:57 2010 +0800
@@ -288,13 +288,16 @@
/**
Called when an error occurs in the RunL
*/
+#ifdef OST_TRACE_COMPILER_IN_USE
TInt CPTPIPConnection::RunError(TInt aError )
+#else
+TInt CPTPIPConnection::RunError(TInt /*aError*/ )
+#endif
{
OstTraceFunctionEntry0( CPTPIPCONNECTION_RUNERROR_ENTRY );
OstTrace1( TRACE_NORMAL, CPTPIPCONNECTION_RUNERROR, "PTPIP ERROR: Error received is %d", aError );
-
// Cancel all the outstanding requests.
Cancel( );
@@ -1389,7 +1392,11 @@
/**
* Invoked by the SocketHandler when there is an error.
*/
+#ifdef OST_TRACE_COMPILER_IN_USE
void CPTPIPConnection::HandleError(TInt aError)
+#else
+void CPTPIPConnection::HandleError(TInt /*aError*/)
+#endif
{
OstTraceFunctionEntry0( CPTPIPCONNECTION_HANDLEERROR_ENTRY );
OstTrace1( TRACE_NORMAL, CPTPIPCONNECTION_HANDLEERROR, "SocketHandler received an error=%d, stopping connection.", aError );
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/bwins/obexextensionapisU.DEF
--- a/obex/obexextensionapi/bwins/obexextensionapisU.DEF Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-EXPORTS
- ?NewL@CObexServerPacketAccessExtension@@SAPAV1@AAVCObexServer@@AAVMObexServerRequestPacketNotify@@@Z @ 1 NONAME ; class CObexServerPacketAccessExtension * CObexServerPacketAccessExtension::NewL(class CObexServer &, class MObexServerRequestPacketNotify &)
- ?LastError@CObexClientErrorResolver@@QBEIXZ @ 2 NONAME ; unsigned int CObexClientErrorResolver::LastError(void) const
- ?NewL@CObexClientErrorResolver@@SAPAV1@AAVCObexClient@@@Z @ 3 NONAME ; class CObexClientErrorResolver * CObexClientErrorResolver::NewL(class CObexClient &)
- ?NewL@CObexClientErrorResolver@@SAPAV1@AAVCObexClient@@W4TObexClientErrorResolutionSetType@@@Z @ 4 NONAME ; class CObexClientErrorResolver * CObexClientErrorResolver::NewL(class CObexClient &, enum TObexClientErrorResolutionSetType)
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/eabi/obexextensionapisU.DEF
--- a/obex/obexextensionapi/eabi/obexextensionapisU.DEF Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,6 +0,0 @@
-EXPORTS
- _ZN32CObexServerPacketAccessExtension4NewLER11CObexServerR30MObexServerRequestPacketNotify @ 1 NONAME
- _ZN24CObexClientErrorResolver4NewLER11CObexClient @ 2 NONAME
- _ZN24CObexClientErrorResolver4NewLER11CObexClient33TObexClientErrorResolutionSetType @ 3 NONAME
- _ZNK24CObexClientErrorResolver9LastErrorEv @ 4 NONAME
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/group/bld.inf
--- a/obex/obexextensionapi/group/bld.inf Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Extension API provider for OBEX
-//
-//
-
-/**
- @file
-*/
-
-PRJ_EXPORTS
-// Extension API headers
-../public/obexserverpacketaccessextension.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(obex/extensionapis/obexserverpacketaccessextension.h)
-../public/mobexserverrequestpacketnotify.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(obex/extensionapis/mobexserverrequestpacketnotify.h)
-../public/obexclienterrorresolver.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(obex/extensionapis/obexclienterrorresolver.h)
-
-// Internal OBEX headers
-../public/mobexserverrequestpacketnotifyregister.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(obex/internal/mobexserverrequestpacketnotifyregister.h)
-../public/mobexclienterrorresolver.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(obex/internal/mobexclienterrorresolver.h)
-
-
-PRJ_MMPFILES
-obexextensionapis.mmp
-
-PRJ_TESTEXPORTS
-
-PRJ_TESTMMPFILES
-../test/headercheck/group/t_obexextensionapisheadercheck.mmp
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/group/obex_extensionapis.history.xml
--- a/obex/obexextensionapi/group/obex_extensionapis.history.xml Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,10 +0,0 @@
-
-
-
-
-
-
- Added copyright headers
-
-
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/group/obex_extensionapis.mrp
--- a/obex/obexextensionapi/group/obex_extensionapis.mrp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-component obex_extensionapis
-source \sf\mw\remoteconn\obex\obexextensionapi
-binary \sf\mw\remoteconn\obex\obexextensionapi\group all
-exports \sf\mw\remoteconn\obex\obexextensionapi\group
-notes_source \component_defs\release.src
-
-
-ipr E
-ipr T \sf\mw\remoteconn\obex\obexextensionapi\test
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/group/obexextensionapis.mmp
--- a/obex/obexextensionapi/group/obexextensionapis.mmp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// obexextension.mmp
-// ObexExtension DLL
-// obexextension.dll DLL providing extension APIs for OBEX
-//
-//
-
-/**
- @file
-*/
-
-
-TARGET obexextensionapis.dll //Recommended unpaged
-
-CAPABILITY All -Tcb
-TARGETTYPE dll
-
-UID 0x1000008d 0x10281917
-
-SOURCEPATH ../src
-SOURCE obexserverpacketaccessextension.cpp
-SOURCE obexerrorextension.cpp
-
-USERINCLUDE ../../obexprotocol/common
-USERINCLUDE ../inc
-
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-LIBRARY euser.lib
-LIBRARY obex.lib
-
-VENDORID 0x70000001
-
-SMPSAFE
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/inc/obexextensionapifaults.h
--- a/obex/obexextensionapi/inc/obexextensionapifaults.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __OBEXEXTENSIONAPIFAULTS_H
-#define __OBEXEXTENSIONAPIFAULTS_H
-/**
-@file
-@internalComponent
-*/
-
-enum TObexExtensionApiFaultCode
- {
- EInterfaceInstanceIsANullPointer = 0,
- };
-
-#endif // __OBEXEXTENSIONAPIFAULTS_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/public/mobexclienterrorresolver.h
--- a/obex/obexextensionapi/public/mobexclienterrorresolver.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#ifndef __MOBEXCLIENTERRORRESOLVER_H
-#define __MOBEXCLIENTERRORRESOLVER_H
-
-#include
-
-/**
-UID with which applications can request the MObexClientErrorResolver API
-through CObexClient::ExtensionInterface().
-*/
-const TUid KObexClientErrorResolverInterface = {0x10281918};
-
-/**
-Definition of the Obex client error extension API.
-*/
-class MObexClientErrorResolver
- {
-public:
- /**
- Function used to retreive an extended error code for the last completed client operation.
-
- @param aErrorSet The set of errors that the resolved error will lie within.
- @return An extended error code that lies within the error set specified.
- */
- virtual TUint LastError(TObexClientErrorResolutionSetType aErrorSet) const = 0;
- };
-
-#endif __MOBEXCLIENTERRORRESOLVER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/public/mobexserverrequestpacketnotify.h
--- a/obex/obexextensionapi/public/mobexserverrequestpacketnotify.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedPartner
- @released
-*/
-
-#ifndef OBEXSERVERREQUESTPACKETNOTIFY_H
-#define OBEXSERVERREQUESTPACKETNOTIFY_H
-
-#include
-#include
-
-class TObexConnectInfo;
-
-typedef TUint8 TObexRequestCode;
-
-const TObexRequestCode KObexRequestFinalConnect = 0x80;
-const TObexRequestCode KObexRequestFinalDisconnect = 0x81;
-const TObexRequestCode KObexRequestPut = 0x02;
-const TObexRequestCode KObexRequestFinalPut = 0x82;
-const TObexRequestCode KObexRequestGet = 0x03;
-const TObexRequestCode KObexRequestFinalGet = 0x83;
-const TObexRequestCode KObexFinalSetPath = 0x85;
-const TObexRequestCode KObexFinalAbort = 0xFF;
-
-/**
-A Mixin to provide a notification interface for the receipt of request
-packets by an OBEX server.
-
-@publishedPartner
-@released
-*/
-class MObexServerRequestPacketNotify
- {
-public:
-
- /**
- Receipt of a generic request packet.
-
- @param aRequest The opcode of the request packet received.
- @param aResponse The implementer should set this to the response they
- want to send to the client if they are abandoning
- processing.
- @return EFalse to abandon processing the packet, ETrue to process as normal
- */
- virtual TBool RequestPacket(TObexRequestCode aRequest, TObexResponse& aResponse) = 0;
-
- /**
- Receipt of a Connect Request packet. Overload of the generic case.
-
- @param aRequest The opcode of the Connect Request packet received.
- @param aConnectInfo The Connect Info of the Connect Request packet.
- @param aResponse The implementer should set this to the response they
- want to send to the client if they are abandoning
- processing.
- @return EFalse to abandon processing the packet, ETrue to process as normal
- */
- virtual TBool RequestPacket(TObexRequestCode aRequest, TObexConnectInfo& aConnectInfo, TObexResponse& aResponse) = 0;
-
- /**
- Receipt of a SetPath Request packet. Overload of the generic case.
-
- @param aRequest The opcode of the SetPath Request packet received.
- @param aSetPathInfo The SetPath Info of the SetPath Request packet.
- @param aResponse The implementer should set this to the response they
- want to send to the client if they are abandoning
- processing.
- @return EFalse to abandon processing the packet, ETrue to process as normal
- */
- virtual TBool RequestPacket(TObexRequestCode aRequest, CObex::TSetPathInfo& aSetPathInfo, TObexResponse& aResponse) = 0;
-
- };
-
-#endif // OBEXSERVERREQUESTPACKETNOTIFY_H
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/public/mobexserverrequestpacketnotifyregister.h
--- a/obex/obexextensionapi/public/mobexserverrequestpacketnotifyregister.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-#ifndef OBEXSERVERREQUESTPACKETNOTIFYREGISTER_H
-#define OBEXSERVERREQUESTPACKETNOTIFYREGISTER_H
-
-#include
-
-class MObexServerRequestPacketNotify;
-
-/**
- UID with which one can request the
- MObexServerRequestPacketNotifyRegister API through
- CObexServer::ExtensionInterface().
-
- Some implementations may use KObexRequestPacketNotifyInterfaceId
- which is considered deprecated.
-*/
-const TUid KObexServerRequestPacketNotifyRegisterInterface = {0x10274CB4};
-
-/**
-Mixin class to be implemented by instances providing a means to
-set an observer for the receipt of Obex request packets by a server.
-
-This provides part of the packet access API.
-*/
-class MObexServerRequestPacketNotifyRegister
- {
-public:
- /**
- Sets the notifier to be called when an Obex server receives a request packet.
-
- @param aRequestPacketNotify A pointer to the observer interface instance to receive the notifications.
- */
- virtual void SetObexServerRequestPacketObserver(MObexServerRequestPacketNotify& aRequestPacketNotify) = 0;
-
- /**
- Inform the Obex server that we have finished with this interface,
- and delete the engine to allow a new one to be created.
- */
- virtual void DeleteObexServerRequestPacketNotifyRegister() = 0;
- };
-
-#endif // OBEXSERVERREQUESTPACKETNOTIFYREGISTER_H
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/public/obexclienterrorresolver.h
--- a/obex/obexextensionapi/public/obexclienterrorresolver.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedPartner
- @released
-*/
-
-#ifndef __OBEXCLIENTERRORRESOLVER_H
-#define __OBEXCLIENTERRORRESOLVER_H
-
-#include
-
-class MObexClientErrorResolver;
-
-/**
-Types of error set that an Obex client error can be resolved to.
-*/
-enum TObexClientErrorResolutionSetType
- {
- /**
- The basic error set that errors can be resolved to.
- @see TObexClientBasicErrorResolutionSet
- */
- EObexClientBasicErrorResolutionSet = 0,
- };
-
-/**
-The basic error set that errors can be resolved to.
-*/
-enum TObexClientBasicErrorResolutionSet
- {
- /**
- The last client operation completed without error.
- This value is unused but remains here for compatibility.
- */
- EObexNoExtendedError = 0,
-
- /**
- The last client operation completed without error.
- */
- EObexRequestAccepted = 1,
-
- /**
- The last client operation was unauthorised or resulted in
- an error being returned from the server.
- */
- EObexRequestNotAccepted = 2,
-
- /**
- The last client operation timed out.
- */
- EObexRequestTimeout = 3,
-
- /**
- The last client operation was interrupted by an error
- detected on the client side, which includes the following:
- - Cancellation of the operation (Abort)
- - Obex protocol error
- - Out of memory condition
- */
- EObexRequestLocalInterruption = 4,
-
- /**
- The last client operation was interrupted due to the
- transport link going down. This may be caused by:
- - Failure to find a remote device capable of Obex
- - Blocking of the IrDA beam
- */
- EObexRequestLinkInterruption = 5,
- };
-
-/**
-Extension class for CObexClient that allows Obex client applications to
-retrieve an extended error code for the last completed client operation.
-*/
-NONSHARABLE_CLASS(CObexClientErrorResolver) : public CBase
- {
-public:
- IMPORT_C static CObexClientErrorResolver* NewL(CObexClient& aClient);
- IMPORT_C static CObexClientErrorResolver* NewL(CObexClient& aClient, TObexClientErrorResolutionSetType aErrorSet);
- IMPORT_C TUint LastError() const;
-
-private:
- // Private constructor - this class is not intended for derivation.
- CObexClientErrorResolver(CObexClient& aClient, TObexClientErrorResolutionSetType aErrorSet);
- void ConstructL();
-
-private:
- CObexClient& iObexClient;
- MObexClientErrorResolver* iClientErrorResolver;
- TObexClientErrorResolutionSetType iErrorSet;
- };
-
-#endif // __OBEXCLIENTERRORRESOLVER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/public/obexserverpacketaccessextension.h
--- a/obex/obexextensionapi/public/obexserverpacketaccessextension.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEXSERVERPACKETACCESSEXTENSION_H
-#define OBEXSERVERPACKETACCESSEXTENSION_H
-
-#include
-
-class CObexServer;
-class MObexServerRequestPacketNotify;
-class MObexServerRequestPacketNotifyRegister;
-
-/**
-This class provides the extension API to give an OBEX server application
-the option of registering a callback interface for being informed of
-packets the server receives before the server processes them.
-
-@publishedPartner
-@released
-*/
-NONSHARABLE_CLASS(CObexServerPacketAccessExtension) : public CBase
- {
-public:
- IMPORT_C static CObexServerPacketAccessExtension* NewL(CObexServer& aServer, MObexServerRequestPacketNotify& aRequestPacketNotify);
-
- ~CObexServerPacketAccessExtension();
-
-private:
- CObexServerPacketAccessExtension();
- void ConstructL(CObexServer& aServer, MObexServerRequestPacketNotify& aRequestPacketNotify);
-
-private:
- MObexServerRequestPacketNotifyRegister* iRequestPacketNotify;
-
- };
-
-#endif // OBEXSERVERPACKETACCESSEXTENSION_H
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/src/obexerrorextension.cpp
--- a/obex/obexextensionapi/src/obexerrorextension.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,72 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include
-#include
-
-/**
-Factory function for CObexClientErrorResolver. Will leave if the associated CObexClient
-does not support this extension type.
-
-@param aClient Reference to the instance of CObexClient being extended.
-@return A pointer to a new CObexClientErrorResolver object.
-*/
-EXPORT_C CObexClientErrorResolver* CObexClientErrorResolver::NewL(CObexClient& aClient)
- {
- return NewL(aClient, EObexClientBasicErrorResolutionSet);
- }
-
-/**
-Factory function for CObexClientErrorResolver. Will leave if the associated CObexClient
-does not support this extension type.
-
-@param aClient Reference to the instance of CObexClient being extended.
-@param aErrorSet The set of errors that the resolved error will lie within.
-@return A pointer to a new CObexClientErrorResolver object.
-*/
-EXPORT_C CObexClientErrorResolver* CObexClientErrorResolver::NewL(CObexClient& aClient, TObexClientErrorResolutionSetType aErrorSet)
- {
- CObexClientErrorResolver* self = new (ELeave)CObexClientErrorResolver(aClient, aErrorSet);
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop();
- return self;
- }
-
-/**
-Function used to retreive an extended error code for the last completed client operation.
-
-@return An extended error code that lies within the error set specified at construction time.
-*/
-EXPORT_C TUint CObexClientErrorResolver::LastError() const
- {
- return iClientErrorResolver->LastError(iErrorSet);
- }
-
-CObexClientErrorResolver::CObexClientErrorResolver(CObexClient& aClient, TObexClientErrorResolutionSetType aErrorSet)
- : iObexClient(aClient), iErrorSet(aErrorSet)
- {
- }
-
-void CObexClientErrorResolver::ConstructL()
- {
- iClientErrorResolver = static_cast(iObexClient.ExtensionInterface(KObexClientErrorResolverInterface));
- User::LeaveIfNull(iClientErrorResolver);
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/src/obexserverpacketaccessextension.cpp
--- a/obex/obexextensionapi/src/obexserverpacketaccessextension.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,84 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include
-#include
-#include "obexextensionapifaults.h"
-
-//Category used for internal panics
-_LIT(KPanicCat, "ObexExtApis");
-
-/**
-Factory function for CObexServerPacketAccessExtension. Will leave if the associated CObexServer
-does not support this extension type.
-
-Note that this object needs to be deleted before the CObexServer object it is registered to is
-deleted.
-
-@param aServer Reference to the instance of CObexServer being extended.
-@param aPacketNotify Reference to the instance of MObexRequestPacketNotify to be notified of
-incoming packets. Notifications will stop when this CObexServerPacketAccessExtension object is
-deleted.
-@return A pointer to a new CObexServerPacketAccessExtension object.
-*/
-EXPORT_C CObexServerPacketAccessExtension* CObexServerPacketAccessExtension::NewL(CObexServer& aServer, MObexServerRequestPacketNotify& aRequestPacketNotify)
- {
- CObexServerPacketAccessExtension* self = new (ELeave) CObexServerPacketAccessExtension();
- CleanupStack::PushL(self);
- self->ConstructL(aServer, aRequestPacketNotify);
- CleanupStack::Pop(self);
- return self;
- }
-
-/**
-The destructor will not delete the instance of the MObexServerRequestPacketNotify
-it holds. It will signal to the CObexServer instance that packet notification is
-no longer required, and so re-allow another CObexServerPacketAccessExtension to bind
-to the CObexServer instance.
-
-This should be called before the CObexServer instance the object is registered to
-is deleted.
-*/
-CObexServerPacketAccessExtension::~CObexServerPacketAccessExtension()
- {
- if (iRequestPacketNotify)
- {
- iRequestPacketNotify->DeleteObexServerRequestPacketNotifyRegister();
- }
- }
-
-/**
-Constructor.
-*/
-CObexServerPacketAccessExtension::CObexServerPacketAccessExtension()
- {
-
- }
-
-/**
-Performs the main construction of the CObexServerPacketAccessExtension.
-
-@param aServer The CObexServer instance to register request packet notification callbacks.
-@param aRequestPacketNotify The mixin instance that will receive notification of request packets.
-*/
-void CObexServerPacketAccessExtension::ConstructL(CObexServer& aServer, MObexServerRequestPacketNotify& aRequestPacketNotify)
- {
- iRequestPacketNotify = static_cast(aServer.ExtensionInterfaceL(KObexServerRequestPacketNotifyRegisterInterface));
- // by here we should have a correctly cast instance, as otherwise we should have already left.
- __ASSERT_ALWAYS(iRequestPacketNotify, User::Panic(KPanicCat, EInterfaceInstanceIsANullPointer));
- iRequestPacketNotify->SetObexServerRequestPacketObserver(aRequestPacketNotify);
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/test/headercheck/group/t_obexextensionapisheadercheck.mmp
--- a/obex/obexextensionapi/test/headercheck/group/t_obexextensionapisheadercheck.mmp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Pointless file produced by test project; the test is that it
-// compiles at all.
-//
-//
-
-/**
- @file
- @internalComponent
-*/
-
-target t_obexextensionheadercheck.exe
-targettype exe
-uid 0
-VENDORID 0x70000001
-
-sourcepath ../src
-source main.cpp
-
-source t_obexserverpacketaccessextension.cpp
-source t_mobexserverrequestpacketnotify.cpp
-source t_mobexserverrequestpacketnotifyregister.cpp
-
-source t_obexclienterrorresolver.cpp
-source t_mobexclienterrorresolver.cpp
-
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-library euser.lib
-
-SMPSAFE
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/test/headercheck/src/main.cpp
--- a/obex/obexextensionapi/test/headercheck/src/main.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +0,0 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-
-GLDEF_C TInt E32Main()
- {
- return KErrNone;
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/test/headercheck/src/t_mobexclienterrorresolver.cpp
--- a/obex/obexextensionapi/test/headercheck/src/t_mobexclienterrorresolver.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/test/headercheck/src/t_mobexserverrequestpacketnotify.cpp
--- a/obex/obexextensionapi/test/headercheck/src/t_mobexserverrequestpacketnotify.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/test/headercheck/src/t_mobexserverrequestpacketnotifyregister.cpp
--- a/obex/obexextensionapi/test/headercheck/src/t_mobexserverrequestpacketnotifyregister.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/test/headercheck/src/t_obexclienterrorresolver.cpp
--- a/obex/obexextensionapi/test/headercheck/src/t_obexclienterrorresolver.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexextensionapi/test/headercheck/src/t_obexserverpacketaccessextension.cpp
--- a/obex/obexextensionapi/test/headercheck/src/t_obexserverpacketaccessextension.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,16 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/bld.inf
--- a/obex/obexprotocol/bld.inf Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// OBject EXchange Protocol
-//
-//
-
-/**
- @file
-*/
-
-// Main
-#include "group/bld.inf"
-
-// Extension APIs
-#include "../obexextensionapi/group/bld.inf"
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/common/logger.h
--- a/obex/obexprotocol/common/logger.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,163 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// All rights reserved.
-//
-//
-
-/**
- @file
- @internalTechnology
-*/
-
-
-#ifndef LOGGER_H
-#define LOGGER_H
-
-#include
-
-// Control function entry and exit logging using a compile-time switch.
-//#define __LOG_FUNCTIONS__
-
-// Dump contents of packets using a compile-time switch.
-//#define __LOG_PACKET_DUMP__
-
-class TFunctionLogger;
-
-#ifndef __COMMSDEBUGUTILITY_H__ // comms-infras/commsdebugutility.h not included
-#ifdef _DEBUG // If this is a debug build...
-// Set flogging active.
-#define __FLOG_ACTIVE
-#endif
-#endif
-
-#ifdef __FLOG_ACTIVE
-#define IF_FLOGGING(a) a
-#else
-#define IF_FLOGGING(a)
-#endif
-
-_LIT8(KDefaultLogFile, "obex");
-
-#ifdef __FLOG_ACTIVE
-#define LEAVEIFERRORL(a) VerboseLeaveIfErrorL(KLogComponent, __FILE__, __LINE__, a)
-#define PANIC(CAT, CODE) VerbosePanic(KLogComponent, __FILE__, __LINE__, CODE, (TText8*)#CODE, CAT)
-#define FLOG(a) CObexLog::Write(KDefaultLogFile, a);
-
-#define FTRACE(a) {a;}
-#define LOG(text) CObexLog::Write(KLogComponent, text);
-#define LOG1(text, a) CObexLog::WriteFormat(KLogComponent, text, a);
-#define LOG2(text, a, b) CObexLog::WriteFormat(KLogComponent, text, a, b);
-#define LOG3(text, a, b, c) CObexLog::WriteFormat(KLogComponent, text, a, b, c);
-#define LOGHEXDESC(desc) CObexLog::HexDump(KLogComponent, 0, 0, desc.Ptr() , desc.Length());
-#define LOGHEXRAW(data, len) CObexLog::HexDump(KLogComponent, 0, 0, data, len);
-#else
-#define LEAVEIFERRORL(a) static_cast(User::LeaveIfError(a))
-#define PANIC(CAT, CODE) User::Panic(CAT, CODE)
-#define FLOG(a)
-#define FTRACE(a)
-#define LOG(text)
-#define LOG1(text, a)
-#define LOG2(text, a, b)
-#define LOG3(text, a, b, c)
-#define LOGHEXDESC(desc)
-#define LOGHEXRAW(data, len)
-#endif // __FLOG_ACTIVE
-
-#define FORCED_LOG_FUNC TFunctionLogger __instrument(KLogComponent, TPtrC8((TUint8*)__PRETTY_FUNCTION__), (TAny*)this);
-#define FORCED_LOG_STATIC_FUNC_ENTRY TFunctionLogger __instrument(KLogComponent, TPtrC8((TUint8*)__PRETTY_FUNCTION__), (TAny*)NULL);
-
-#if ( defined __FLOG_ACTIVE && defined __LOG_FUNCTIONS__ )
-#define LOG_LINE CObexLog::Write(KLogComponent, KNullDesC8());
-#define LOG_FUNC FORCED_LOG_FUNC
-#define LOG_STATIC_FUNC_ENTRY FORCED_LOG_STATIC_FUNC_ENTRY
-#else
-#define LOG_LINE
-#define LOG_FUNC
-#define LOG_STATIC_FUNC_ENTRY
-#endif
-
-
-
-NONSHARABLE_CLASS(CObexLog) : public CBase
- {
-public:
- IMPORT_C static TInt Connect();
- IMPORT_C static void Close();
-
- IMPORT_C static void Write(const TDesC8& aCmpt, const TDesC8& aText);
- IMPORT_C static void WriteFormat(const TDesC8& aCmpt, TRefByValue aFmt, ...);
- IMPORT_C static void WriteFormat(const TDesC8& aCmpt, TRefByValue aFmt, VA_LIST& aList);
- IMPORT_C static void Write(const TDesC8& aCmpt, const TDesC16& aText);
- IMPORT_C static void WriteFormat(const TDesC8& aCmpt, TRefByValue aFmt, ...);
- IMPORT_C static void WriteFormat(const TDesC8& aCmpt, TRefByValue aFmt, VA_LIST& aList);
- IMPORT_C static void HexDump(const TDesC8& aCmpt, const TText* aHeader, const TText* aMargin, const TUint8* aPtr, TInt aLen);
- };
-
-
-#ifndef NO_FPRINT
-inline void FPrint(const TRefByValue IF_FLOGGING(aFmt), ...)
- {
-#ifdef __FLOG_ACTIVE
- VA_LIST list;
- VA_START(list,aFmt);
- CObexLog::WriteFormat(KDefaultLogFile, aFmt, list);
-#endif
- }
-#endif
-
-
-#ifndef NO_FHEX_PTR
-inline void FHex(const TUint8* IF_FLOGGING(aPtr), TInt IF_FLOGGING(aLen))
- {
-#ifdef __FLOG_ACTIVE
- CObexLog::HexDump(KDefaultLogFile, 0, 0, aPtr, aLen);
-#endif
- }
-#endif
-
-
-#ifndef NO_FHEX_DESC
-inline void FHex(const TDesC8& IF_FLOGGING(aDes))
- {
-#ifdef __FLOG_ACTIVE
- FHex(aDes.Ptr(), aDes.Length());
-#endif
- }
-#endif
-
-
-IMPORT_C void VerboseLeaveIfErrorL(const TDesC8& aCpt,
- char* aFile,
- TInt aLine,
- TInt aReason);
-
-IMPORT_C void VerbosePanic(const TDesC8& aCpt,
- char* aFile,
- TInt aLine,
- TInt aPanicCode,
- TText8* aPanicName,
- const TDesC& aPanicCategory);
-
-NONSHARABLE_CLASS(TFunctionLogger)
- {
-public:
- IMPORT_C TFunctionLogger(const TDesC8& aCpt, const TDesC8& aString, TAny* aThis);
- IMPORT_C ~TFunctionLogger();
-
-private:
- TPtrC8 iCpt;
- TPtrC8 iString;
- };
-
-#endif // LOGGER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/group/bld.inf
--- a/obex/obexprotocol/group/bld.inf Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include "../obextransport/group/BLD.INF"
-#include "../obex/group/BLD.INF"
-#include "../obexbttransport/group/BLD.INF"
-#include "../obexusbtransport/group/BLD.INF"
-
-
-PRJ_EXPORTS
-obexprotocol.iby /epoc32/rom/include/obexprotocol.iby
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/group/obex.history.xml
--- a/obex/obexprotocol/group/obex.history.xml Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-
-
-
- OBEX session protocol over IrDA, Bluetooth, and USB transports, supporting connections from simple beaming all the way to full-fledged synchronisation technologies such as SyncML and IrMC (note: Obex can support IrMC, but it is not actually supported in the OS at the moment).
-
-
-
- Added source \sf\mw\remoteconn\obex\obexprotocol in obex.mrp file
-
-
-
- Added copyright headers
-
-
-
-
-
-
-
-
- Remove IMPORT_C from CObexServer::~CObexServer and the entry in mark bwins def file absent.
-
-
-
- Static analysis failures corrected.
-
-
-
- Static analysis failures corrected.
-
-
-
- Static analysis failures corrected.
-
-
-
- Correct the IM tagging.
-
-
-
- Invoke RFile::Flush() when final file write is finished.
-
-
-
- 'CObex::' removed from member function CancelObexConnection declaration.
-
-
-
- If GetHVText returns an error, the number of bytes actually written by WriteOut is 0.
-
-
-
- Check returned value from InsertData and leave if not enough space to insert data.
-
-
-
- The "if is null" statements were not necessary. replaced with debug assertions.
-
-
-
- Added two assertions to avoid calling the methods on an invalid pointer.
-
-
-
- put some assertions to be sure that this pointer is not null (it must be valid)
-
-
-
- Add indication that no control transfers are expected on either obex interface.
-
-
-
- Changes to accomodate MTU size changes.
-
-
-
- OBEX logger's LEAVEIFERRORL did not leave from User::LeaveIfError if you pass it a positive value.
-
-
-
- Changed methods names according to coding standard due to avoid LeaveScan error.
-
-
-
- Changed code to avoid LeaveScan reporting error.
-
-
-
- Initialise max send/recv packet sizes to the maximum size of an IrDA packet before GetOpt is called.
-
-
-
- Modified function CObexBaseObject::ParseNextReceivePacket so that, instead of interrupting the parsing and returning an error when there are problems with the TIME header, it ignores the header and continues parsing the packet.
-
-
-
- TObex will now truncate filename of an object that is PUT on the server if its complete path is too long to fit within the OS limit (256 chars).
-
-
-
- Rename error code to EUnexpectedChallengeResponse.
-
-
-
- ERespUnauthorized will be treated as a valid response to connect request, because this can be originated from obex packet access extension.
-
-
-
- Alter Obex response to Put, Get and SetPath requests that contain an authentication challenge. These now respond with the "Unauthorized" opcode.
-
-
-
- PDEF106501: Correctly set final bit flag on EOB header response for empty objects.
-
-
-
- Corrected filenames to enable building of Symbian OS in Linux
-
-
-
- Workaround for interop with P903i and others whose servers return opcode success (instead of continue) in response to a Put request.
-
-
-
- Upgrade the Obex server so that if an Abort command is received whilst an Obex Session his being Connected or when it is not Connected then, instead of bringing the underlying transport down, the Obex server replies with success.
-
-
-
- Renamed test files and menu items in the manual test Tobex so that they are based on the functionality being tested rather than using the numerical code for the defect that they were produced for.
-
-
-
- Fix to Obex to bring transport down if clean disconnection fails.
-
-
-
- Authentication loophole removed
-
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/group/obex.mrp
--- a/obex/obexprotocol/group/obex.mrp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-# Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-# All rights reserved.
-# This component and the accompanying materials are made available
-# under the terms of "Eclipse Public License v1.0"
-# which accompanies this distribution, and is available
-# at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
-# Initial Contributors:
-# Nokia Corporation - initial contribution.
-#
-# Contributors:
-#
-# Description:
-#
-
-component obex
-source \sf\mw\remoteconn\obex\obexprotocol
-
-binary \sf\mw\remoteconn\obex\obexprotocol\group all
-exports \sf\mw\remoteconn\obex\obexprotocol\group
-notes_source \component_defs\release.src
-
-
-ipr E
-ipr T \sf\mw\remoteconn\obex\obexprotocol\obex\test
-ipr T \sf\mw\remoteconn\obex\obexprotocol\obextransport\test
-
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/group/obexprotocol.iby
--- a/obex/obexprotocol/group/obexprotocol.iby Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Obex
-// obexprotocol.iby
-//
-//
-
-#ifndef __OBEXPROTOCOL_IBY__
-#define __OBEXPROTOCOL_IBY__
-
-REM If __OBEX_DEBUG__ is defined pull in debug versions of the
-REM OBEX DLLs and transport controllers regardless of the ROM type
-#ifdef __OBEX_DEBUG__
-define OBEX_DIR UDEB
-#define OBEX_PLUGIN ECOM_PLUGIN_UDEB
-#else
-define OBEX_DIR BUILD_DIR
-#define OBEX_PLUGIN ECOM_PLUGIN
-#endif
-
-REM *** The following iby files are always included, whether obex is
-REM *** supported by the device or not.
-
-#include
-
-#if defined(_DEBUG) || defined (__OBEX_DEBUG__)
-#include
-#endif
-
-REM *** The following dlls are client side dlls. They are always included
-REM *** in the ROM, whether obex is supported by the device or not, so
-REM *** that client applications can link against them regardless.
-
-file=ABI_DIR\OBEX_DIR\obex.dll sys\bin\OBEX.dll
-REM Alias new obex.dll to also appear as irobex.dll to support legacy apps
-alias sys\bin\obex.dll sys\bin\irobex.dll
-
-file=ABI_DIR\OBEX_DIR\obexcommontransport.dll System\Libs\obexcommontransport.dll
-
-#ifdef SYMBIAN_INCLUDE_OBEX_EXTENSIONAPIS
-file=ABI_DIR\OBEX_DIR\obexextensionapis.dll sys\bin\obexextensionapis.dll
-#endif
-
-REM *** Now for things which should only be included if the device
-REM *** supports OBEX, to save ROM space...
-
-#ifdef SYMBIAN_EXCLUDE_OBEX
-REM Feature OBEX is not in this ROM
-#else
-
-
-REM *** Now for things which should only be included if the device
-REM *** supports USB, to save ROM space...
-
-#ifndef __USB
-REM OBEX USB transport is not included in this ROM as it depends on USB
-#else
-OBEX_PLUGIN(obexusbtransportcontroller.dll,1020de87.rsc)
-#endif
-
-REM *** Now for things which should only be included if the device
-REM *** supports bluetooth, to save ROM space...
-
-#ifndef __BT
-REM OBEX Bluetooth transport is not included in this ROM as it depends on BLUETOOTH
-#else
-OBEX_PLUGIN(obexbtrfcommtransportcontroller.dll,1020e043.rsc)
-#endif
-
-#endif // SYMBIAN_EXCLUDE_OBEX
-
-#endif // __OBEXPROTOCOL_IBY__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/bwins/IROBEX2U.DEF
--- a/obex/obexprotocol/obex/bwins/IROBEX2U.DEF Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,149 +0,0 @@
-EXPORTS
- ??0TObexBufferingDetails@@QAE@AAVCBufBase@@@Z @ 1 NONAME ; TObexBufferingDetails::TObexBufferingDetails(class CBufBase &)
- ??0TObexConnectInfo@@QAE@XZ @ 2 NONAME ; TObexConnectInfo::TObexConnectInfo(void)
- ??0TObexFilenameBackedBuffer@@QAE@AAVCBufBase@@ABVTPtrC16@@W4TFileBuffering@CObexBufObject@@@Z @ 3 NONAME ; TObexFilenameBackedBuffer::TObexFilenameBackedBuffer(class CBufBase &, class TPtrC16 const &, enum CObexBufObject::TFileBuffering)
- ??0TObexProtocolPolicy@@QAE@XZ @ 4 NONAME ; TObexProtocolPolicy::TObexProtocolPolicy(void)
- ??0TObexPureFileBuffer@@QAE@ABVTPtrC16@@@Z @ 5 NONAME ; TObexPureFileBuffer::TObexPureFileBuffer(class TPtrC16 const &)
- ??0TObexRFileBackedBuffer@@QAE@AAVCBufBase@@VRFile@@W4TFileBuffering@CObexBufObject@@@Z @ 6 NONAME ; TObexRFileBackedBuffer::TObexRFileBackedBuffer(class CBufBase &, class RFile, enum CObexBufObject::TFileBuffering)
- ??0TSetPathInfo@CObex@@QAE@XZ @ 7 NONAME ; CObex::TSetPathInfo::TSetPathInfo(void)
- ??1CObexBufObject@@UAE@XZ @ 8 NONAME ; CObexBufObject::~CObexBufObject(void)
- ??1CObexClient@@UAE@XZ @ 9 NONAME ; CObexClient::~CObexClient(void)
- ??1CObexFileObject@@UAE@XZ @ 10 NONAME ; CObexFileObject::~CObexFileObject(void)
- ??1CObexServer@@UAE@XZ @ 11 NONAME ABSENT ; CObexServer::~CObexServer(void)
- ?Abort@CObexClient@@QAEXXZ @ 12 NONAME ; void CObexClient::Abort(void)
- ?AddHeader@CObexHeaderSet@@QAEHPAVCObexHeader@@@Z @ 13 NONAME ; int CObexHeaderSet::AddHeader(class CObexHeader *)
- ?AddHeaderL@CObexBaseObject@@QAEXAAVCObexHeader@@@Z @ 14 NONAME ; void CObexBaseObject::AddHeaderL(class CObexHeader &)
- ?AddHttpL@CObexBaseObject@@QAEXABVTDesC8@@@Z @ 15 NONAME ; void CObexBaseObject::AddHttpL(class TDesC8 const &)
- ?AppParam@CObexBaseObject@@QBEABVTDesC8@@XZ @ 16 NONAME ; class TDesC8 const & CObexBaseObject::AppParam(void) const
- ?AsByte@CObexHeader@@QBEEXZ @ 17 NONAME ; unsigned char CObexHeader::AsByte(void) const
- ?AsByteSeq@CObexHeader@@QBEABVTDesC8@@XZ @ 18 NONAME ; class TDesC8 const & CObexHeader::AsByteSeq(void) const
- ?AsFourByte@CObexHeader@@QBEKXZ @ 19 NONAME ; unsigned long CObexHeader::AsFourByte(void) const
- ?AsUnicode@CObexHeader@@QBEABVTDesC16@@XZ @ 20 NONAME ; class TDesC16 const & CObexHeader::AsUnicode(void) const
- ?Attributes@CObexHeader@@QBEGXZ @ 21 NONAME ; unsigned short CObexHeader::Attributes(void) const
- ?BytesReceived@CObexBaseObject@@QAEHXZ @ 22 NONAME ; int CObexBaseObject::BytesReceived(void)
- ?BytesSent@CObexBaseObject@@QAEHXZ @ 23 NONAME ; int CObexBaseObject::BytesSent(void)
- ?Connect@CObexClient@@QAEXAAVCObexBaseObject@@AAVTRequestStatus@@@Z @ 24 NONAME ; void CObexClient::Connect(class CObexBaseObject &, class TRequestStatus &)
- ?Connect@CObexClient@@QAEXAAVTRequestStatus@@@Z @ 25 NONAME ; void CObexClient::Connect(class TRequestStatus &)
- ?ConnectL@CObexClient@@QAEXAAVCObexBaseObject@@ABVTDesC16@@AAVTRequestStatus@@@Z @ 26 NONAME ; void CObexClient::ConnectL(class CObexBaseObject &, class TDesC16 const &, class TRequestStatus &)
- ?ConnectL@CObexClient@@QAEXABVTDesC16@@AAVTRequestStatus@@@Z @ 27 NONAME ; void CObexClient::ConnectL(class TDesC16 const &, class TRequestStatus &)
- ?ConnectState@CObex@@IBE?AW4TConnectState@1@XZ @ 28 NONAME ; enum CObex::TConnectState CObex::ConnectState(void) const
- ?CopyL@CObexHeader@@QBEPAV1@XZ @ 29 NONAME ; class CObexHeader * CObexHeader::CopyL(void) const
- ?CopyL@CObexHeaderSet@@QAEPAV1@AAVMObexHeaderCheck@@@Z @ 30 NONAME ; class CObexHeaderSet * CObexHeaderSet::CopyL(class MObexHeaderCheck &)
- ?CopyL@CObexHeaderSet@@QAEPAV1@XZ @ 31 NONAME ; class CObexHeaderSet * CObexHeaderSet::CopyL(void)
- ?Count@CObexHeaderSet@@QBEHXZ @ 32 NONAME ; int CObexHeaderSet::Count(void) const
- ?CurrentOperation@CObexServer@@QBE?AW4TOperation@CObex@@XZ @ 33 NONAME ; enum CObex::TOperation CObexServer::CurrentOperation(void) const
- ?DataBuf@CObexBufObject@@QAEPAVCBufBase@@XZ @ 34 NONAME ; class CBufBase * CObexBufObject::DataBuf(void)
- ?DeleteCurrentHeader@CObexHeaderSet@@QAEXXZ @ 35 NONAME ; void CObexHeaderSet::DeleteCurrentHeader(void)
- ?DeleteMasked@CObexHeaderSet@@QAEXXZ @ 36 NONAME ; void CObexHeaderSet::DeleteMasked(void)
- ?Description@CObexBaseObject@@QAEABVTDesC16@@XZ @ 37 NONAME ; class TDesC16 const & CObexBaseObject::Description(void)
- ?Disconnect@CObexClient@@QAEXAAVTRequestStatus@@@Z @ 38 NONAME ; void CObexClient::Disconnect(class TRequestStatus &)
- ?EncodedSize@CObexHeader@@QBEHXZ @ 39 NONAME ; int CObexHeader::EncodedSize(void) const
- ?Find@CObexHeaderSet@@QBEHEAAVCObexHeader@@@Z @ 40 NONAME ; int CObexHeaderSet::Find(unsigned char, class CObexHeader &) const
- ?First@CObexHeaderSet@@QBEXXZ @ 41 NONAME ; void CObexHeaderSet::First(void) const
- ?Get@CObexClient@@QAEXAAVCObexBaseObject@@AAVTRequestStatus@@@Z @ 42 NONAME ; void CObexClient::Get(class CObexBaseObject &, class TRequestStatus &)
- ?GetPutFinalResponseHeaders@CObexClient@@QAEABVCObexHeaderSet@@XZ @ 43 NONAME ; class CObexHeaderSet const & CObexClient::GetPutFinalResponseHeaders(void)
- ?HI@CObexHeader@@QBEEXZ @ 44 NONAME ; unsigned char CObexHeader::HI(void) const
- ?HeaderMask@CObexBaseObject@@QAEGXZ @ 45 NONAME ; unsigned short CObexBaseObject::HeaderMask(void)
- ?HeaderSet@CObexBaseObject@@QAEAAVCObexHeaderSet@@XZ @ 46 NONAME ; class CObexHeaderSet & CObexBaseObject::HeaderSet(void)
- ?HeaderSet@CObexBaseObject@@QBEABVCObexHeaderSet@@XZ @ 47 NONAME ; class CObexHeaderSet const & CObexBaseObject::HeaderSet(void) const
- ?Http@CObexBaseObject@@QBEPBV?$RPointerArray@VHBufC8@@@@XZ @ 48 NONAME ; class RPointerArray const * CObexBaseObject::Http(void) const
- ?InitFromFileL@CObexFileObject@@QAEXABVTDesC16@@@Z @ 49 NONAME ; void CObexFileObject::InitFromFileL(class TDesC16 const &)
- ?Interested@TObexMatchHeader@@UAEHE@Z @ 50 NONAME ; int TObexMatchHeader::Interested(unsigned char)
- ?Interested@TObexMatchHeaderType@@UAEHE@Z @ 51 NONAME ; int TObexMatchHeaderType::Interested(unsigned char)
- ?IsConnected@CObex@@QBEHXZ @ 52 NONAME ; int CObex::IsConnected(void) const
- ?IsStarted@CObexServer@@QAEHXZ @ 53 NONAME ; int CObexServer::IsStarted(void)
- ?IsStrictPeer@CObex@@QBEHXZ @ 54 NONAME ; int CObex::IsStrictPeer(void) const
- ?Length@CObexBaseObject@@QAEKXZ @ 55 NONAME ; unsigned long CObexBaseObject::Length(void)
- ?LocalInfo@CObex@@QBEABVTObexConnectInfo@@XZ @ 56 NONAME ; class TObexConnectInfo const & CObex::LocalInfo(void) const
- ?Name@CObexBaseObject@@QAEABVTDesC16@@XZ @ 57 NONAME ; class TDesC16 const & CObexBaseObject::Name(void)
- ?NewL@CObexBufObject@@SAPAV1@PAVCBufBase@@@Z @ 58 NONAME ; class CObexBufObject * CObexBufObject::NewL(class CBufBase *)
- ?NewL@CObexClient@@SAPAV1@AAVTObexProtocolInfo@@@Z @ 59 NONAME ; class CObexClient * CObexClient::NewL(class TObexProtocolInfo &)
- ?NewL@CObexClient@@SAPAV1@AAVTObexProtocolInfo@@AAVTObexProtocolPolicy@@@Z @ 60 NONAME ; class CObexClient * CObexClient::NewL(class TObexProtocolInfo &, class TObexProtocolPolicy &)
- ?NewL@CObexFileObject@@SAPAV1@ABVTDesC16@@@Z @ 61 NONAME ; class CObexFileObject * CObexFileObject::NewL(class TDesC16 const &)
- ?NewL@CObexHeader@@SAPAV1@XZ @ 62 NONAME ; class CObexHeader * CObexHeader::NewL(void)
- ?NewL@CObexHeaderSet@@SAPAV1@XZ @ 63 NONAME ; class CObexHeaderSet * CObexHeaderSet::NewL(void)
- ?NewL@CObexNullObject@@SAPAV1@XZ @ 64 NONAME ; class CObexNullObject * CObexNullObject::NewL(void)
- ?NewL@CObexServer@@SAPAV1@AAVTObexProtocolInfo@@@Z @ 65 NONAME ; class CObexServer * CObexServer::NewL(class TObexProtocolInfo &)
- ?NewL@CObexServer@@SAPAV1@AAVTObexProtocolInfo@@AAVTObexProtocolPolicy@@@Z @ 66 NONAME ; class CObexServer * CObexServer::NewL(class TObexProtocolInfo &, class TObexProtocolPolicy &)
- ?Next@CObexHeaderSet@@QBEHH@Z @ 67 NONAME ; int CObexHeaderSet::Next(int) const
- ?Parent@TSetPathInfo@CObex@@QBEHXZ @ 68 NONAME ; int CObex::TSetPathInfo::Parent(void) const
- ?Put@CObexClient@@QAEXAAVCObexBaseObject@@AAVTRequestStatus@@@Z @ 69 NONAME ; void CObexClient::Put(class CObexBaseObject &, class TRequestStatus &)
- ?ReceiveMtu@TObexProtocolPolicy@@QBEGXZ @ 70 NONAME ; unsigned short TObexProtocolPolicy::ReceiveMtu(void) const
- ?RemoteAddr@CObex@@QAEXAAVTSockAddr@@@Z @ 71 NONAME ; void CObex::RemoteAddr(class TSockAddr &)
- ?RemoteInfo@CObex@@QBEABVTObexConnectInfo@@XZ @ 72 NONAME ; class TObexConnectInfo const & CObex::RemoteInfo(void) const
- ?Reset@CObexBaseObject@@QAEXXZ @ 73 NONAME ; void CObexBaseObject::Reset(void)
- ?Reset@CObexHeader@@QAEXXZ @ 74 NONAME ; void CObexHeader::Reset(void)
- ?Reset@MObexHeaderCheck@@UAEXXZ @ 75 NONAME ; void MObexHeaderCheck::Reset(void)
- ?ResetChallenge@CObexServer@@QAEXXZ @ 76 NONAME ; void CObexServer::ResetChallenge(void)
- ?ResetContents@CObexHeader@@QAEXXZ @ 77 NONAME ; void CObexHeader::ResetContents(void)
- ?Set@CObexHeader@@QAEXPAV1@@Z @ 78 NONAME ; void CObexHeader::Set(class CObexHeader *)
- ?SetAppParamL@CObexBaseObject@@QAEXABVTDesC8@@@Z @ 79 NONAME ; void CObexBaseObject::SetAppParamL(class TDesC8 const &)
- ?SetAttributes@CObexHeader@@QAEXG@Z @ 80 NONAME ; void CObexHeader::SetAttributes(unsigned short)
- ?SetByte@CObexHeader@@QAEXEE@Z @ 81 NONAME ; void CObexHeader::SetByte(unsigned char, unsigned char)
- ?SetByteSeqL@CObexHeader@@QAEXEABVTDesC8@@@Z @ 82 NONAME ; void CObexHeader::SetByteSeqL(unsigned char, class TDesC8 const &)
- ?SetCallBack@CObex@@QAEXAAVMObexAuthChallengeHandler@@@Z @ 83 NONAME ; void CObex::SetCallBack(class MObexAuthChallengeHandler &)
- ?SetChallengeL@CObexServer@@QAEXABVTDesC16@@@Z @ 84 NONAME ; void CObexServer::SetChallengeL(class TDesC16 const &)
- ?SetDataBufL@CObexBufObject@@QAEXAAVTObexBufferingDetails@@@Z @ 85 NONAME ; void CObexBufObject::SetDataBufL(class TObexBufferingDetails &)
- ?SetDataBufL@CObexBufObject@@QAEXABVTPtrC16@@@Z @ 86 NONAME ; void CObexBufObject::SetDataBufL(class TPtrC16 const &)
- ?SetDataBufL@CObexBufObject@@QAEXABVTPtrC16@@AAVCBufBase@@W4TFileBuffering@1@@Z @ 87 NONAME ; void CObexBufObject::SetDataBufL(class TPtrC16 const &, class CBufBase &, enum CObexBufObject::TFileBuffering)
- ?SetDataBufL@CObexBufObject@@QAEXABVTPtrC16@@PAVCBufBase@@@Z @ 88 NONAME ; void CObexBufObject::SetDataBufL(class TPtrC16 const &, class CBufBase *)
- ?SetDataBufL@CObexBufObject@@QAEXPAVCBufBase@@@Z @ 89 NONAME ; void CObexBufObject::SetDataBufL(class CBufBase *)
- ?SetDescriptionL@CObexBaseObject@@QAEXABVTDesC16@@@Z @ 90 NONAME ; void CObexBaseObject::SetDescriptionL(class TDesC16 const &)
- ?SetFourByte@CObexHeader@@QAEXEK@Z @ 91 NONAME ; void CObexHeader::SetFourByte(unsigned char, unsigned long)
- ?SetHeader@TObexMatchHeader@@QAEXE@Z @ 92 NONAME ; void TObexMatchHeader::SetHeader(unsigned char)
- ?SetHeaderMask@CObexBaseObject@@QAEXG@Z @ 93 NONAME ; void CObexBaseObject::SetHeaderMask(unsigned short)
- ?SetLengthL@CObexBaseObject@@QAEXK@Z @ 94 NONAME ; void CObexBaseObject::SetLengthL(unsigned long)
- ?SetLocalWho@CObex@@QAEHABVTDesC8@@@Z @ 95 NONAME ; int CObex::SetLocalWho(class TDesC8 const &)
- ?SetMask@CObexHeaderSet@@QAEXPAVMObexHeaderCheck@@@Z @ 96 NONAME ; void CObexHeaderSet::SetMask(class MObexHeaderCheck *)
- ?SetNameL@CObexBaseObject@@QAEXABVTDesC16@@@Z @ 97 NONAME ; void CObexBaseObject::SetNameL(class TDesC16 const &)
- ?SetPath@CObexClient@@QAEXAAVTSetPathInfo@CObex@@AAVTRequestStatus@@@Z @ 98 NONAME ; void CObexClient::SetPath(class CObex::TSetPathInfo &, class TRequestStatus &)
- ?SetPutFinalResponseHeaders@CObexServer@@QAEHPAVCObexHeaderSet@@@Z @ 99 NONAME ; int CObexServer::SetPutFinalResponseHeaders(class CObexHeaderSet *)
- ?SetReceiveMtu@TObexProtocolPolicy@@QAEHG@Z @ 100 NONAME ; int TObexProtocolPolicy::SetReceiveMtu(unsigned short)
- ?SetTargetChecking@CObexServer@@QAEXW4TTargetChecking@1@@Z @ 101 NONAME ; void CObexServer::SetTargetChecking(enum CObexServer::TTargetChecking)
- ?SetTargetL@CObexBaseObject@@QAEXABVTDesC8@@@Z @ 102 NONAME ; void CObexBaseObject::SetTargetL(class TDesC8 const &)
- ?SetTimeL@CObexBaseObject@@QAEXVTTime@@@Z @ 103 NONAME ; void CObexBaseObject::SetTimeL(class TTime)
- ?SetTransmitMtu@TObexProtocolPolicy@@QAEHG@Z @ 104 NONAME ; int TObexProtocolPolicy::SetTransmitMtu(unsigned short)
- ?SetType@TObexMatchHeaderType@@QAEXW4THeaderType@CObexHeader@@@Z @ 105 NONAME ; void TObexMatchHeaderType::SetType(enum CObexHeader::THeaderType)
- ?SetTypeL@CObexBaseObject@@QAEXABVTDesC8@@@Z @ 106 NONAME ; void CObexBaseObject::SetTypeL(class TDesC8 const &)
- ?SetUnicodeL@CObexHeader@@QAEXEABVTDesC16@@@Z @ 107 NONAME ; void CObexHeader::SetUnicodeL(unsigned char, class TDesC16 const &)
- ?Start@CObexServer@@QAEHPAVMObexServerNotify@@@Z @ 108 NONAME ; int CObexServer::Start(class MObexServerNotify *)
- ?Stop@CObexServer@@QAEXXZ @ 109 NONAME ; void CObexServer::Stop(void)
- ?Target@CObexBaseObject@@QAEABVTDesC8@@XZ @ 110 NONAME ; class TDesC8 const & CObexBaseObject::Target(void)
- ?This@CObexHeaderSet@@QBEHPAVCObexHeader@@@Z @ 111 NONAME ; int CObexHeaderSet::This(class CObexHeader *) const
- ?Time@CObexBaseObject@@QAE?BVTTime@@XZ @ 112 NONAME ; class TTime const CObexBaseObject::Time(void)
- ?TransmitMtu@TObexProtocolPolicy@@QBEGXZ @ 113 NONAME ; unsigned short TObexProtocolPolicy::TransmitMtu(void) const
- ?Type@CObexBaseObject@@QAEABVTDesC8@@XZ @ 114 NONAME ; class TDesC8 const & CObexBaseObject::Type(void)
- ?Type@CObexHeader@@QBE?AW4THeaderType@1@XZ @ 115 NONAME ; enum CObexHeader::THeaderType CObexHeader::Type(void) const
- ?UserPasswordL@CObexClient@@UAEXABVTDesC16@@@Z @ 116 NONAME ; void CObexClient::UserPasswordL(class TDesC16 const &)
- ?UserPasswordL@CObexServer@@UAEXABVTDesC16@@@Z @ 117 NONAME ; void CObexServer::UserPasswordL(class TDesC16 const &)
- ?ValidHeaders@CObexBaseObject@@QAEGXZ @ 118 NONAME ; unsigned short CObexBaseObject::ValidHeaders(void)
- ?Version@TObexProtocolPolicy@@QBEGXZ @ 119 NONAME ; unsigned short TObexProtocolPolicy::Version(void) const
- ?VersionMajor@TObexConnectInfo@@QBEEXZ @ 120 NONAME ; unsigned char TObexConnectInfo::VersionMajor(void) const
- ?VersionMinor@TObexConnectInfo@@QBEEXZ @ 121 NONAME ; unsigned char TObexConnectInfo::VersionMinor(void) const
- ?WriteToFile@CObexBufObject@@QAEHABVTPtrC16@@@Z @ 122 NONAME ; int CObexBufObject::WriteToFile(class TPtrC16 const &)
- ?MOACH_ExtensionInterfaceL@MObexAuthChallengeHandler@@UAEXVTUid@@AAPAX@Z @ 123 NONAME ; void MObexAuthChallengeHandler::MOACH_ExtensionInterfaceL(class TUid, void * &)
- ?MOHC_ExtensionInterfaceL@MObexHeaderCheck@@UAEXVTUid@@AAPAX@Z @ 124 NONAME ; void MObexHeaderCheck::MOHC_ExtensionInterfaceL(class TUid, void * &)
- ?MOSN_ExtensionInterfaceL@MObexServerNotify@@UAEXVTUid@@AAPAX@Z @ 125 NONAME ; void MObexServerNotify::MOSN_ExtensionInterfaceL(class TUid, void * &)
- ?NewL@CObexFileObject@@SAPAV1@XZ @ 126 NONAME ; class CObexFileObject * CObexFileObject::NewL(void)
- ?Next@CObexHeaderSet@@QBEHXZ @ 127 NONAME ; int CObexHeaderSet::Next(void) const
- ?NewL@CObexClient@@SAPAV1@AAVTObexTransportInfo@@@Z @ 128 NONAME ; class CObexClient * CObexClient::NewL(class TObexTransportInfo &)
- ?NewL@CObexServer@@SAPAV1@AAVTObexTransportInfo@@@Z @ 129 NONAME ; class CObexServer * CObexServer::NewL(class TObexTransportInfo &)
- ?SetFinalPacketObserver@CObexClient@@QAEXPAVMObexFinalPacketObserver@@@Z @ 130 NONAME ; void CObexClient::SetFinalPacketObserver(class MObexFinalPacketObserver *)
- ?Start@CObexServer@@QAEHPAVMObexServerNotifyAsync@@@Z @ 131 NONAME ; int CObexServer::Start(class MObexServerNotifyAsync *)
- ?MOSNA_ExtensionInterfaceL@MObexServerNotifyAsync@@UAEXVTUid@@AAPAX@Z @ 132 NONAME ; void MObexServerNotifyAsync::MOSNA_ExtensionInterfaceL(class TUid, void * &)
- ?RequestIndicationCallback@CObexServer@@QAEHPAVCObexBaseObject@@@Z @ 133 NONAME ; int CObexServer::RequestIndicationCallback(class CObexBaseObject *)
- ?RequestCompleteIndicationCallback@CObexServer@@QAEHH@Z @ 134 NONAME ; int CObexServer::RequestCompleteIndicationCallback(int)
- ?RequestCompleteIndicationCallback@CObexServer@@QAEHW4TObexResponse@@@Z @ 135 NONAME ; int CObexServer::RequestCompleteIndicationCallback(enum TObexResponse)
- ?RequestIndicationCallbackWithError@CObexServer@@QAEHH@Z @ 136 NONAME ; int CObexServer::RequestIndicationCallbackWithError(int)
- ?RequestIndicationCallbackWithError@CObexServer@@QAEHW4TObexResponse@@@Z @ 137 NONAME ; int CObexServer::RequestIndicationCallbackWithError(enum TObexResponse)
- ?IsAuthenticating@CObex@@QBEHXZ @ 138 NONAME ; int CObex::IsAuthenticating(void) const
- ?LastServerResponseCode@CObexClient@@QBE?AW4TObexResponse@@XZ @ 139 NONAME ; enum TObexResponse CObexClient::LastServerResponseCode(void) const
- ?ExtensionInterface@CObexClient@@QAEPAXVTUid@@@Z @ 140 NONAME ; void * CObexClient::ExtensionInterface(class TUid)
- ?ExtensionInterfaceL@CObexServer@@QAEPAXVTUid@@@Z @ 141 NONAME ; void * CObexServer::ExtensionInterfaceL(class TUid)
- ?PacketHeaders@CObexServer@@QAEHAAPAVCObexHeaderSet@@@Z @ 142 NONAME ; int CObexServer::PacketHeaders(class CObexHeaderSet * &)
- ?PacketHeaders@CObexServer@@QAEHAAPAVCObexHeaderSet@@AAVMObexHeaderCheck@@@Z @ 143 NONAME ; int CObexServer::PacketHeaders(class CObexHeaderSet * &, class MObexHeaderCheck &)
- ?SetCommandTimeOut@CObexClient@@QAEXVTTimeIntervalMicroSeconds32@@@Z @ 144 NONAME ; void CObexClient::SetCommandTimeOut(class TTimeIntervalMicroSeconds32)
- ?SuppressAuthenticationHeaderElements@CObex@@QAEXW4TObexSuppressedAuthElements@1@@Z @ 145 NONAME ; void CObex::SuppressAuthenticationHeaderElements(enum CObex::TObexSuppressedAuthElements)
- ?TransportInfo@CObexServer@@QBEPBVTObexTransportInfo@@XZ @ 146 NONAME ; class TObexTransportInfo const * CObexServer::TransportInfo(void) const
- ?SetReadActivityObserver@CObexServer@@QAEXPAVMObexReadActivityObserver@@@Z @ 147 NONAME ; void CObexServer::SetReadActivityObserver(class MObexReadActivityObserver *)
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/eabi/irobex2U.def
--- a/obex/obexprotocol/obex/eabi/irobex2U.def Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-EXPORTS
- _ZN11CObexClient10DisconnectER14TRequestStatus @ 1 NONAME
- _ZN11CObexClient13UserPasswordLERK7TDesC16 @ 2 NONAME
- _ZN11CObexClient26GetPutFinalResponseHeadersEv @ 3 NONAME
- _ZN11CObexClient3GetER15CObexBaseObjectR14TRequestStatus @ 4 NONAME
- _ZN11CObexClient3PutER15CObexBaseObjectR14TRequestStatus @ 5 NONAME
- _ZN11CObexClient4NewLER17TObexProtocolInfo @ 6 NONAME
- _ZN11CObexClient4NewLER17TObexProtocolInfoR19TObexProtocolPolicy @ 7 NONAME
- _ZN11CObexClient5AbortEv @ 8 NONAME
- _ZN11CObexClient7ConnectER14TRequestStatus @ 9 NONAME
- _ZN11CObexClient7ConnectER15CObexBaseObjectR14TRequestStatus @ 10 NONAME
- _ZN11CObexClient7SetPathERN5CObex12TSetPathInfoER14TRequestStatus @ 11 NONAME
- _ZN11CObexClient8ConnectLER15CObexBaseObjectRK7TDesC16R14TRequestStatus @ 12 NONAME
- _ZN11CObexClient8ConnectLERK7TDesC16R14TRequestStatus @ 13 NONAME
- _ZN11CObexClientD0Ev @ 14 NONAME
- _ZN11CObexClientD1Ev @ 15 NONAME
- _ZN11CObexClientD2Ev @ 16 NONAME
- _ZN11CObexHeader11SetByteSeqLEhRK6TDesC8 @ 17 NONAME
- _ZN11CObexHeader11SetFourByteEhm @ 18 NONAME
- _ZN11CObexHeader11SetUnicodeLEhRK7TDesC16 @ 19 NONAME
- _ZN11CObexHeader13ResetContentsEv @ 20 NONAME
- _ZN11CObexHeader13SetAttributesEt @ 21 NONAME
- _ZN11CObexHeader3SetEPS_ @ 22 NONAME
- _ZN11CObexHeader4NewLEv @ 23 NONAME
- _ZN11CObexHeader5ResetEv @ 24 NONAME
- _ZN11CObexHeader7SetByteEhh @ 25 NONAME
- _ZN11CObexServer13SetChallengeLERK7TDesC16 @ 26 NONAME
- _ZN11CObexServer13UserPasswordLERK7TDesC16 @ 27 NONAME
- _ZN11CObexServer14ResetChallengeEv @ 28 NONAME
- _ZN11CObexServer17SetTargetCheckingENS_15TTargetCheckingE @ 29 NONAME
- _ZN11CObexServer26SetPutFinalResponseHeadersEP14CObexHeaderSet @ 30 NONAME
- _ZN11CObexServer4NewLER17TObexProtocolInfo @ 31 NONAME
- _ZN11CObexServer4NewLER17TObexProtocolInfoR19TObexProtocolPolicy @ 32 NONAME
- _ZN11CObexServer4StopEv @ 33 NONAME
- _ZN11CObexServer5StartEP17MObexServerNotify @ 34 NONAME
- _ZN11CObexServer9IsStartedEv @ 35 NONAME
- _ZN14CObexBufObject11SetDataBufLEP8CBufBase @ 36 NONAME
- _ZN14CObexBufObject11SetDataBufLER21TObexBufferingDetails @ 37 NONAME
- _ZN14CObexBufObject11SetDataBufLERK7TPtrC16 @ 38 NONAME
- _ZN14CObexBufObject11SetDataBufLERK7TPtrC16P8CBufBase @ 39 NONAME
- _ZN14CObexBufObject11SetDataBufLERK7TPtrC16R8CBufBaseNS_14TFileBufferingE @ 40 NONAME
- _ZN14CObexBufObject11WriteToFileERK7TPtrC16 @ 41 NONAME
- _ZN14CObexBufObject4NewLEP8CBufBase @ 42 NONAME
- _ZN14CObexBufObject7DataBufEv @ 43 NONAME
- _ZN14CObexBufObjectD0Ev @ 44 NONAME
- _ZN14CObexBufObjectD1Ev @ 45 NONAME
- _ZN14CObexBufObjectD2Ev @ 46 NONAME
- _ZN14CObexHeaderSet12DeleteMaskedEv @ 47 NONAME
- _ZN14CObexHeaderSet19DeleteCurrentHeaderEv @ 48 NONAME
- _ZN14CObexHeaderSet4NewLEv @ 49 NONAME
- _ZN14CObexHeaderSet5CopyLER16MObexHeaderCheck @ 50 NONAME
- _ZN14CObexHeaderSet5CopyLEv @ 51 NONAME
- _ZN14CObexHeaderSet7SetMaskEP16MObexHeaderCheck @ 52 NONAME
- _ZN14CObexHeaderSet9AddHeaderEP11CObexHeader @ 53 NONAME
- _ZN15CObexBaseObject10AddHeaderLER11CObexHeader @ 54 NONAME
- _ZN15CObexBaseObject10HeaderMaskEv @ 55 NONAME
- _ZN15CObexBaseObject10SetLengthLEm @ 56 NONAME
- _ZN15CObexBaseObject10SetTargetLERK6TDesC8 @ 57 NONAME
- _ZN15CObexBaseObject11DescriptionEv @ 58 NONAME
- _ZN15CObexBaseObject12SetAppParamLERK6TDesC8 @ 59 NONAME
- _ZN15CObexBaseObject12ValidHeadersEv @ 60 NONAME
- _ZN15CObexBaseObject13BytesReceivedEv @ 61 NONAME
- _ZN15CObexBaseObject13SetHeaderMaskEt @ 62 NONAME
- _ZN15CObexBaseObject15SetDescriptionLERK7TDesC16 @ 63 NONAME
- _ZN15CObexBaseObject4NameEv @ 64 NONAME
- _ZN15CObexBaseObject4TimeEv @ 65 NONAME
- _ZN15CObexBaseObject4TypeEv @ 66 NONAME
- _ZN15CObexBaseObject5ResetEv @ 67 NONAME
- _ZN15CObexBaseObject6LengthEv @ 68 NONAME
- _ZN15CObexBaseObject6TargetEv @ 69 NONAME
- _ZN15CObexBaseObject8AddHttpLERK6TDesC8 @ 70 NONAME
- _ZN15CObexBaseObject8SetNameLERK7TDesC16 @ 71 NONAME
- _ZN15CObexBaseObject8SetTimeLE5TTime @ 72 NONAME
- _ZN15CObexBaseObject8SetTypeLERK6TDesC8 @ 73 NONAME
- _ZN15CObexBaseObject9BytesSentEv @ 74 NONAME
- _ZN15CObexBaseObject9HeaderSetEv @ 75 NONAME
- _ZN15CObexFileObject13InitFromFileLERK7TDesC16 @ 76 NONAME
- _ZN15CObexFileObject4NewLERK7TDesC16 @ 77 NONAME
- _ZN15CObexFileObject4NewLEv @ 78 NONAME
- _ZN15CObexFileObjectD0Ev @ 79 NONAME
- _ZN15CObexFileObjectD1Ev @ 80 NONAME
- _ZN15CObexFileObjectD2Ev @ 81 NONAME
- _ZN15CObexNullObject4NewLEv @ 82 NONAME
- _ZN16MObexHeaderCheck24MOHC_ExtensionInterfaceLE4TUidRPv @ 83 NONAME
- _ZN16MObexHeaderCheck5ResetEv @ 84 NONAME
- _ZN16TObexConnectInfoC1Ev @ 85 NONAME
- _ZN16TObexConnectInfoC2Ev @ 86 NONAME
- _ZN16TObexMatchHeader10InterestedEh @ 87 NONAME
- _ZN16TObexMatchHeader9SetHeaderEh @ 88 NONAME
- _ZN17MObexServerNotify24MOSN_ExtensionInterfaceLE4TUidRPv @ 89 NONAME
- _ZN19TObexProtocolPolicy13SetReceiveMtuEt @ 90 NONAME
- _ZN19TObexProtocolPolicy14SetTransmitMtuEt @ 91 NONAME
- _ZN19TObexProtocolPolicyC1Ev @ 92 NONAME
- _ZN19TObexProtocolPolicyC2Ev @ 93 NONAME
- _ZN19TObexPureFileBufferC1ERK7TPtrC16 @ 94 NONAME
- _ZN19TObexPureFileBufferC2ERK7TPtrC16 @ 95 NONAME
- _ZN20TObexMatchHeaderType10InterestedEh @ 96 NONAME
- _ZN20TObexMatchHeaderType7SetTypeEN11CObexHeader11THeaderTypeE @ 97 NONAME
- _ZN21TObexBufferingDetailsC1ER8CBufBase @ 98 NONAME
- _ZN21TObexBufferingDetailsC2ER8CBufBase @ 99 NONAME
- _ZN22TObexRFileBackedBufferC1ER8CBufBase5RFileN14CObexBufObject14TFileBufferingE @ 100 NONAME
- _ZN22TObexRFileBackedBufferC2ER8CBufBase5RFileN14CObexBufObject14TFileBufferingE @ 101 NONAME
- _ZN25MObexAuthChallengeHandler25MOACH_ExtensionInterfaceLE4TUidRPv @ 102 NONAME
- _ZN25TObexFilenameBackedBufferC1ER8CBufBaseRK7TPtrC16N14CObexBufObject14TFileBufferingE @ 103 NONAME
- _ZN25TObexFilenameBackedBufferC2ER8CBufBaseRK7TPtrC16N14CObexBufObject14TFileBufferingE @ 104 NONAME
- _ZN5CObex10RemoteAddrER9TSockAddr @ 105 NONAME
- _ZN5CObex11SetCallBackER25MObexAuthChallengeHandler @ 106 NONAME
- _ZN5CObex11SetLocalWhoERK6TDesC8 @ 107 NONAME
- _ZN5CObex12TSetPathInfoC1Ev @ 108 NONAME
- _ZN5CObex12TSetPathInfoC2Ev @ 109 NONAME
- _ZNK11CObexHeader10AsFourByteEv @ 110 NONAME
- _ZNK11CObexHeader10AttributesEv @ 111 NONAME
- _ZNK11CObexHeader11EncodedSizeEv @ 112 NONAME
- _ZNK11CObexHeader2HIEv @ 113 NONAME
- _ZNK11CObexHeader4TypeEv @ 114 NONAME
- _ZNK11CObexHeader5CopyLEv @ 115 NONAME
- _ZNK11CObexHeader6AsByteEv @ 116 NONAME
- _ZNK11CObexHeader9AsByteSeqEv @ 117 NONAME
- _ZNK11CObexHeader9AsUnicodeEv @ 118 NONAME
- _ZNK11CObexServer16CurrentOperationEv @ 119 NONAME
- _ZNK14CObexHeaderSet4FindEhR11CObexHeader @ 120 NONAME
- _ZNK14CObexHeaderSet4NextEi @ 121 NONAME
- _ZNK14CObexHeaderSet4NextEv @ 122 NONAME
- _ZNK14CObexHeaderSet4ThisEP11CObexHeader @ 123 NONAME
- _ZNK14CObexHeaderSet5CountEv @ 124 NONAME
- _ZNK14CObexHeaderSet5FirstEv @ 125 NONAME
- _ZNK15CObexBaseObject4HttpEv @ 126 NONAME
- _ZNK15CObexBaseObject8AppParamEv @ 127 NONAME
- _ZNK15CObexBaseObject9HeaderSetEv @ 128 NONAME
- _ZNK16TObexConnectInfo12VersionMajorEv @ 129 NONAME
- _ZNK16TObexConnectInfo12VersionMinorEv @ 130 NONAME
- _ZNK19TObexProtocolPolicy10ReceiveMtuEv @ 131 NONAME
- _ZNK19TObexProtocolPolicy11TransmitMtuEv @ 132 NONAME
- _ZNK19TObexProtocolPolicy7VersionEv @ 133 NONAME
- _ZNK5CObex10RemoteInfoEv @ 134 NONAME
- _ZNK5CObex11IsConnectedEv @ 135 NONAME
- _ZNK5CObex12ConnectStateEv @ 136 NONAME
- _ZNK5CObex12IsStrictPeerEv @ 137 NONAME
- _ZNK5CObex12TSetPathInfo6ParentEv @ 138 NONAME
- _ZNK5CObex9LocalInfoEv @ 139 NONAME
- _ZTI16MObexHeaderCheck @ 140 NONAME ; ##
- _ZTI17MObexServerNotify @ 141 NONAME ; ##
- _ZTI25MObexAuthChallengeHandler @ 142 NONAME ; ##
- _ZTV16MObexHeaderCheck @ 143 NONAME ; ##
- _ZTV17MObexServerNotify @ 144 NONAME ; ##
- _ZTV25MObexAuthChallengeHandler @ 145 NONAME ; ##
- _ZN11CObexClient4NewLER18TObexTransportInfo @ 146 NONAME
- _ZN11CObexServer4NewLER18TObexTransportInfo @ 147 NONAME
- _ZN11CObexClient22SetFinalPacketObserverEP24MObexFinalPacketObserver @ 148 NONAME
- _ZN11CObexServer5StartEP22MObexServerNotifyAsync @ 149 NONAME
- _ZN22MObexServerNotifyAsync25MOSNA_ExtensionInterfaceLE4TUidRPv @ 150 NONAME
- _ZTI22MObexServerNotifyAsync @ 151 NONAME ; ##
- _ZTV22MObexServerNotifyAsync @ 152 NONAME ; ##
- _ZN11CObexServer25RequestIndicationCallbackEP15CObexBaseObject @ 153 NONAME
- _ZN11CObexServer33RequestCompleteIndicationCallbackE13TObexResponse @ 154 NONAME
- _ZN11CObexServer33RequestCompleteIndicationCallbackEi @ 155 NONAME
- _ZN11CObexServer34RequestIndicationCallbackWithErrorE13TObexResponse @ 156 NONAME
- _ZN11CObexServer34RequestIndicationCallbackWithErrorEi @ 157 NONAME
- _ZNK11CObexClient22LastServerResponseCodeEv @ 158 NONAME
- _ZNK5CObex16IsAuthenticatingEv @ 159 NONAME
- _ZN11CObexClient17SetCommandTimeOutE27TTimeIntervalMicroSeconds32 @ 160 NONAME
- _ZN11CObexClient18ExtensionInterfaceE4TUid @ 161 NONAME
- _ZN11CObexServer13PacketHeadersERP14CObexHeaderSet @ 162 NONAME
- _ZN11CObexServer13PacketHeadersERP14CObexHeaderSetR16MObexHeaderCheck @ 163 NONAME
- _ZN11CObexServer19ExtensionInterfaceLE4TUid @ 164 NONAME
- _ZN5CObex36SuppressAuthenticationHeaderElementsENS_27TObexSuppressedAuthElementsE @ 165 NONAME
- _ZNK11CObexServer13TransportInfoEv @ 166 NONAME
- _ZN11CObexServer23SetReadActivityObserverEP25MObexReadActivityObserver @ 167 NONAME
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/group/bld.inf
--- a/obex/obexprotocol/obex/group/bld.inf Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Implementation of Object Exchange Protocol
-//
-//
-
-/**
- @file
-*/
-
-PRJ_EXPORTS
-
-../public/OBEX.H SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obex.h)
-../public/obexbase.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexbase.h)
-../public/obexbaseobject.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexbaseobject.h)
-../public/obexclient.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexclient.h)
-../public/obexconstants.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexconstants.h)
-../public/obexpanics.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexpanics.h)
-../public/obexheaders.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexheaders.h)
-../public/obexobjects.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexobjects.h)
-../public/obexserver.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexserver.h)
-../public/obextypes.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obextypes.h)
-../public/obexfinalpacketobserver.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexfinalpacketobserver.h)
-../public/obexreadactivityobserver.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(obexreadactivityobserver.h)
-../inc/obexconstantsinternal.h SYMBIAN_MW_LAYER_PLATFORM_EXPORT_PATH(obexconstantsinternal.h)
-// NB obexcommontransport depends on these files to compile, but obex depends
-// on obexcommontransport to link. This is a circular dependency. Due to how
-// our build system works (export all the headers before trying to build
-// anything) it doesn't cause a build break.
-../public/ObexBtTransportInfo.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexbttransportinfo.h)
-../public/ObexUsbTransportInfo.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexusbtransportinfo.h)
-../public/ObexTransportInfo.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obextransportinfo.h)
-../public/ObexIrTransportInfo.h SYMBIAN_MW_LAYER_PUBLIC_EXPORT_PATH(obexirtransportinfo.h)
-
-PRJ_MMPFILES
-obex.mmp
-irobex.mmp // Build irobex.lib to allow legacy components to continue linking without source changes
-
-
-PRJ_TESTEXPORTS
-../test/tobex/Contactsbak.vcf /epoc32/wins/c/contactsbak.vcf
-../test/tobex/Contactsbak2.vcf /epoc32/wins/c/contactsbak2.vcf
-../test/tobex/Contactsbak3.vcf /epoc32/wins/c/contactsbak3.vcf
-
-PRJ_TESTMMPFILES
-
-../test/tobex/TOBEX.MMP
-../test/testobexerrorcodes/TestObexErrorCodes.mmp
-../test/headercheck/group/t_obexheadercheck.mmp
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/group/irobex.mmp
--- a/obex/obexprotocol/obex/group/irobex.mmp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Obex
-// irobex.lib Build irobex.lib to allow legacy apps to effectively link to obex.dll
-//
-//
-
-/**
- @file
-*/
-
-TARGET irobex.lib
-TARGETTYPE IMPLIB
-#ifdef WINSCW
-DEFFILE IROBEX2.DEF
-#else
-DEFFILE irobex2.def
-#endif
-UID 0x1000008d 0x10201EF5
-LINKAS obex.dll
-
-SMPSAFE
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/group/obex.mmp
--- a/obex/obexprotocol/obex/group/obex.mmp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// Obex
-// irobex.dll Implementation of Object Exchange Protocol
-//
-//
-
-/**
- @file
-*/
-
-
-TARGET obex.dll //Recommended unpaged
-
-CAPABILITY All -Tcb
-TARGETTYPE dll
-
-uid 0x1000008d 0x10201EF5
-
-#ifdef WINSCW
-DEFFILE IROBEX2.DEF
-#else
-DEFFILE irobex2.def
-#endif
-
-SOURCEPATH ../src
-SOURCE OBEX.CPP
-SOURCE obexobjectexpandedbaseobject.cpp
-SOURCE obexheader.cpp
-SOURCE obexheaderset.cpp
-SOURCE obexconstants.cpp
-SOURCE obexheaderutil.cpp
-SOURCE obexobjects.cpp
-SOURCE obexclient.cpp
-SOURCE obexserver.cpp
-SOURCE obexserverstatemachine.cpp
-SOURCE obexfilewriter.cpp
-SOURCE obexasyncfilewriter.cpp
-SOURCE obexsyncfilewriter.cpp
-SOURCE obexsetpathdata.cpp
-SOURCE OBEXUTIL.CPP
-SOURCE authentication.cpp
-SOURCE obexservernotify.cpp
-SOURCE obexauthchallengehandler.cpp
-SOURCE obexpacketsignaller.cpp
-SOURCE obexpackettimer.cpp
-SOURCE obexnotifyhandlerbase.cpp
-SOURCE obexnotifyhandlerclient.cpp
-SOURCE obexnotifyhandlerserver.cpp
-SOURCE obexservernotifysyncwrapper.cpp
-SOURCE obexserverrequestpacketengine.cpp
-SOURCE obexerrorengine.cpp
-SOURCE TObexServerOperationState.cpp
-SOURCE TObexServerStateDisconnected.cpp
-SOURCE TObexServerStateTransportConnected.cpp
-SOURCE TObexServerStateObexConnecting.cpp
-SOURCE TObexServerStateWaitForUserPassword.cpp
-SOURCE TObexServerStateReady.cpp
-SOURCE TObexServerStatePutOpWaitForUser.cpp
-SOURCE TObexServerStatePutOpReceiveObject.cpp
-SOURCE TObexServerStateGetOpReceiveSpecification.cpp
-SOURCE TObexServerStateGetOpWaitForUser.cpp
-SOURCE TObexServerStateGetOpSendObject.cpp
-SOURCE TObexServerStateSetPathOp.cpp
-SOURCE TObexServerStatePutOpFinal.cpp
-SOURCE TObexServerStateGetOpFinal.cpp
-SOURCE TObexServerStateDisconnecting.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../common
-
-MW_LAYER_SYSTEMINCLUDE_SYMBIAN
-
-LIBRARY euser.lib
-LIBRARY efsrv.lib
-LIBRARY esock.lib
-LIBRARY hash.lib
-LIBRARY charconv.lib
-LIBRARY obexcommontransport.lib
-LIBRARY irda.lib // Needed by IrOBEXUtil::CreateTransportInfoL
-LIBRARY bluetooth.lib // Needed by IrOBEXUtil::CreateTransportInfoL
-LIBRARY ecom.lib
-
-START WINS
- BASEADDRESS 0x73900000
-END
-
-VENDORID 0x70000001
-
-SMPSAFE
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/OBEXUTIL.H
--- a/obex/obexprotocol/obex/inc/OBEXUTIL.H Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-//defined for testing purposes only
-//#define TEST_CLIENT_CHANGES_ITS_MIND_ABOUT_CHALLENGE
-
-#ifndef __OBEXUTIL_H
-#define __OBEXUTIL_H
-
-#include
-#include "obexconstantsinternal.h"
-#include "obexfaults.h"
-
-class TObexTransportInfo;
-
-//this macro traps the leave and if an error has occured it calls the function defined by _trap
-#define OBEX_TRAP(_trap, _stmt) TRAPD(_code, _stmt);if(_code != KErrNone) _trap (_code)
-
-inline TInt ObexHeaderType(TUint8 aHI)
- {
- return ((aHI & KObexHeaderTypeMask) >> KObexHeaderTypeOffset);
- }
-
-NONSHARABLE_CLASS(IrOBEXUtil)
- {
-public:
- static void Panic(TObexPanicCode aCode);
- static void Fault(TObexFaultCode aCode);
- static TInt EpocError(TUint8 aResp);
- static TObexResponse ObexResponse(TInt aErr,TObexResponse aDefault);
- static TObexTransportInfo* CreateTransportInfoL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy);
- };
-
-#endif // __OBEXUTIL_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/authentication.h
--- a/obex/obexprotocol/obex/inc/authentication.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef AUTHENTICATION_H
-#define AUTHENTICATION_H
-
-#include
-#include
-#include
-#include
-
-const TUid KObexAuthenticationNotifierUid = {0x12341234}; //fixme
-
-class CMD5;
-
-NONSHARABLE_CLASS(CObexAuthenticator) : public CBase
- {
-public:
- static CObexAuthenticator* NewL();
- ~CObexAuthenticator();
- TInt GenerateNonce(TDes8& aNonce);
- void GenerateResponseL(const TDesC8& aPasswd, const TNonce& aNonce, TRequestDigest& aRequestDigest);
- void ChallengeResponseL(const TDesC8& aPasswd, const TNonce& aNonce, const TRequestDigest& aRequestDigest);
-private:
- void ConstructL();
- CObexAuthenticator();
-private:
- CMD5* iMD5;
- TInt64 iSeed;
- };
-
-#endif // AUTHENTICATION_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexasyncfilewriter.h
--- a/obex/obexprotocol/obex/inc/obexasyncfilewriter.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,71 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __OBEXASYNCFILEWRITER_H__
-#define __OBEXASYNCFILEWRITER_H__
-
-#include
-#include "obexfilewriter.h"
-
-class RFile;
-
-/**
-Obex Asynchronous File Writer.
-
-This active object writes data from Obex objects to disk asynchronously.
-
-Not intended for derivation.
-
-@internalComponent
-@released
-*/
-NONSHARABLE_CLASS(CObexAsyncFileWriter) : public CActive, public MObexFileWriter
- {
-public:
- // Construction / destruction
- static MObexFileWriter* NewL(RFile& aFile);
- ~CObexAsyncFileWriter();
-
-private:
- // From MObexFileWriter
- TInt Write(TInt aPos, CBufBase*& aBuf);
- TInt FinalWrite(TInt aPos, CBufBase*& aBuf, TInt aLength);
-
-private:
- // From CActive
- void DoCancel();
- void RunL();
-
-private:
- // Construction
- void ConstructL();
- CObexAsyncFileWriter(RFile& aFile);
-
-// Unowned
-private:
- /** Reference to the file which this object is used to write to */
- RFile& iFile;
- /** Pointer to the buffer this object is currently writing to file */
- CBufBase* iBuffer;
- /** Descriptor for the buffer this object is currently writing to file */
- TPtr8 iBufPtr;
- };
-
-#endif // __OBEXASYNCFILEWRITER_H__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexcommon.h
--- a/obex/obexprotocol/obex/inc/obexcommon.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __OBEXCOMMON_H__
-#define __OBEXCOMMON_H__
-
-#include
-#include
-#include
-#include
-
-#endif // __OBEXCOMMON_H__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexconstantsinternal.h
--- a/obex/obexprotocol/obex/inc/obexconstantsinternal.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,125 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
-@file
-@internalComponent
-*/
-
-#ifndef __OBEXCONSTANTSINTERNAL_H
-#define __OBEXCONSTANTSINTERNAL_H
-
-#include
-
-//common to request & resp digests
-
-/** @internalComponent */
-const TInt KMinChallResponseSize = 18; //Nonce(16) + tag(1) + size(1)
-/** @internalComponent */
-const TInt KObexNonceSize = 16;
-/** @internalComponent */
-const TUint8 KObexRequireUID = 0x01;
-
-//request or chall
-/** @internalComponent */
-const TUint KObexChallNonceTag = 0;
-/** @internalComponent */
-const TUint8 KObexChallOptionsTag = 0x01;
-/** @internalComponent */
-const TUint8 KObexChallRealmTag = 0x02;
-/** @internalComponent */
-const TInt KObexChallOptionSize = 1; //this can't be changed from one without making
-/** @internalComponent */
-const TUint KObexChallHeaderSize = 23; //assuming no Realm data
-
-//response
-/** @internalComponent */
-const TUint KObexRespTag = 0;
-/** @internalComponent */
-const TUint8 KObexRespUserIDTag = 0x01;
-/** @internalComponent */
-const TUint8 KObexRespNonceTag = 0x02;
-
-/** @internalComponent */
-const TUint8 KObexHeaderTypeMask = 0xc0;
-/** @internalComponent */
-const TUint8 KObexHeaderTypeOffset = 6;
-
-
-#ifdef _UNICODE
-/** @internalComponent */
-const TInt KUidOBEXTransportModule = 0x10003d56;
-#else
-/** @internalComponent */
-const TInt KUidOBEXTransportModule = 0x1000169c;
-#endif
-
-/** @internalComponent */
-const TUint8 KFourByteTimeHeaderAddress = 0xc4;
-
-// Header mask definitions.
-// Old style accessor for which headers are present or
-// should be sent by an object. Now deprecated, use the
-// header iterator instead.
-/** @internalComponent */
-const TUint16 KObexHdrName = 0x0001;
-/** @internalComponent */
-const TUint16 KObexHdrType = 0x0002;
-/** @internalComponent */
-const TUint16 KObexHdrLength = 0x0004;
-/** @internalComponent */
-const TUint16 KObexHdrTime = 0x0008;
-/** @internalComponent */
-const TUint16 KObexHdrDescription = 0x0010;
-/** @internalComponent */
-const TUint16 KObexHdrTarget = 0x0020;
-/** @internalComponent */
-const TUint16 KObexHdrConnectionID = 0x0040;
-/** @internalComponent */
-const TUint16 KObexHdrBody = 0x0080;
-/** @internalComponent */
-const TUint16 KObexHdrEndOfBody = 0x0100;
-/** @internalComponent */
-const TUint16 KObexHdrHttp = 0x0200;
-/** @internalComponent */
-const TUint16 KObexHdrAppParam = 0x0400;
-/** @internalComponent */
-const TUint16 KObexHdrUserDefined = 0x0800;
-/** @internalComponent */
-const TUint16 KObexHdrCount = 0x1000;
-/** @internalComponent */
-const TUint16 KObexHdrCreatorID = 0x2000;
-/** @internalComponent */
-const TUint16 KObexHdrWanUUID = 0x4000;
-/** @internalComponent */
-const TUint16 KObexHdrObjectClass = 0x8000;
-
-
-/** @internalComponent */
-const TUint8 KObexUserDefinedHdrAddrMin = 0x30; //start of user defined header address range
-/** @internalComponent */
-const TUint8 KObexUserDefinedHdrAddrMax = 0x3F; //end of user defined header address range
-
-/** @internalComponent */
-const TUint8 KObexVersion = 0x10; //< Version 1.0 (still correct for Obex spec v 1.2)
-
-/** @internalComponent */
-const TUint8 KObexObjectFieldSize = 127;
-
-// Flags used by SetPath
-/** @internalComponent */
-const TUint8 KObexSetPathParent = 0x01;
-
-#endif // __OBEXCONSTANTSINTERNAL_H
\ No newline at end of file
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexerrorengine.h
--- a/obex/obexprotocol/obex/inc/obexerrorengine.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,219 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __OBEXERRORENGINE_H
-#define __OBEXERRORENGINE_H
-
-#include
-
-/**
-Implements the Obex client error resolver extension functionality.
-Keeps a record of the last underlying client error that occurred.
-Resolves the underlying error to an error set specified by the user.
-*/
-NONSHARABLE_CLASS(CObexErrorEngine) : public CBase, public MObexClientErrorResolver
- {
-public:
- /**
- The Obex client sets a detailed "underlying" error on the error
- engine for resolving to a specific error set later on. This
- mechanism adds extensibility to different error sets.
- */
- enum TObexClientUnderlyingError
- {
- /**
- No error in the last operation.
- @see CObexClient::OnPacketReceive()
- */
- ENoError = 0,
-
- /**
- The last operation failed to bring the transport up.
- @see CObexClient::ClientCommandL()
- @see CObexClient::CompleteRequest()
- */
- ETransportUpFailed = 1,
-
- /**
- Tried to connect but already connected.
- @see CObexClient::ClientCommandL()
- */
- EAlreadyConnected = 2,
-
- /**
- Failed to insert local connection info into connect packet.
- @see CObexClient::PrepareConnectPacket()
- */
- ECannotInsertConnectInfo = 3,
-
- /**
- Connection challenge received but unable to ask the user for a password.
- @see CObexClient::PrepareConnectPacket()
- */
- EChallengeRejected = 4,
-
- /**
- The client's connect state was set to an erroneous value.
- @see CObexClient::PrepareConnectPacket()
- */
- EPrepareConnectPacketIncorrectState = 5,
-
- /**
- A packet was received while the client was sending.
- @see CObexClient::OnPacketReceive()
- */
- EResponseWhileWriting = 6,
-
- /**
- Failed to extract remote connection info from server connect packet.
- @see CObexClient::ParseConnectPacket()
- */
- ECannotExtractConnectInfo = 7,
-
- /**
- Cannot process the challenge/challenge response from the server.
- @see CObexClient::ParseConnectPacket()
- */
- ECannotProcessChallenge = 8,
-
- /**
- Challenge response received but the client did not request one.
- @see CObexClient::ParseConnectPacket()
- */
- EUnexpectedChallengeResponse = 9,
-
- /**
- Unauthorised opcode in server connect packet and there is no challenge header.
- This means that the server failed to authenticate the client.
- @see CObexClient::ParseConnectPacket()
- */
- EChallengeAbsent = 10,
-
- /**
- The server connect packet contained an unknown opcode.
- @see CObexClient::ParseConnectPacket()
- */
- EBadOpcodeInConnectPacket = 11,
-
- /**
- The client operation timed out.
- @see CObexClient::TimeoutCompletion()
- */
- EResponseTimeout = 12,
-
- /**
- The client operation was aborted by the user.
- @see CObexClient::OnPacketReceive()
- */
- EAborted = 13,
-
- /**
- The transport went down while an operation was outstanding.
- @see CObexClient::OnTransportDown()
- @see CObexClient::CompleteRequest()
- */
- EOpOutstandingOnTransportDown = 14,
-
- /**
- The server refused the disconnection request
- because it did not recognise the connection ID.
- @see CObexClient::OnPacketReceive()
- */
- EBadConnectionId = 15,
-
- /**
- The client attempted an operation other than connect while disconnected.
- @see CObexClient::ClientCommandL()
- */
- EDisconnected = 16,
-
- /**
- Could not initialise the object to be sent in the Put/Get request.
- @see CObexClient::ClientCommandL()
- */
- ECannotInitialiseObject = 17,
-
- /**
- Could not set the connection ID on the
- object to be sent in the Put/Get request.
- @see CObexClient::ClientCommandL()
- */
- ECannotSetConnectionId = 18,
-
- /**
- Could not prepare the next send packet in the Put/Get request.
- @see CObexClient::ClientCommandL()
- */
- ECannotPreparePacket = 19,
-
- /**
- Multipacket response from server to Put/Get (not GetResponse) request.
- @see CObexClient::OnPacketReceive()
- */
- EMultipacketResponse = 20,
-
- /**
- The response from the server contained an error code.
- @see CObexClient::OnPacketReceive()
- */
- EErrorResponseFromServer = 21,
-
- /**
- Could not extract the header from the final Put response packet.
- @see CObexClient::OnPacketReceive()
- */
- ECannotExtractFinalPutHeader = 22,
-
- /**
- The opcode of the Put response packet from the server is
- not consistent with the progress of the Put operation.
- @see CObexClient::OnPacketReceive()
- */
- EPutOutOfSync = 23,
-
- /**
- The opcode of the Get response packet from the server is Success
- but the client hasn't finished sending all the Get request packets.
- @see CObexClient::OnPacketReceive()
- */
- EGetPrematureSuccess = 24,
-
- /**
- Could not parse a GetResponse packet from the server.
- @see CObexClient::OnPacketReceive()
- */
- EGetResponseParseError = 25,
- };
-
- static CObexErrorEngine* NewL();
-
- // Implements MObexClientErrorResolver::LastError().
- virtual TUint LastError(TObexClientErrorResolutionSetType aErrorSet) const;
-
- void SetLastError(TObexClientUnderlyingError aError);
-
-private:
- CObexErrorEngine();
-
-private:
- TObexClientUnderlyingError iLastError;
- };
-
-#endif
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexfaults.h
--- a/obex/obexprotocol/obex/inc/obexfaults.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,208 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEX_FAULTS_H
-#define OBEX_FAULTS_H
-
-/**
-@file
-@internalComponent
-
-This file contains details of all Obex panics which may be raised as a result
-of an internal programming error.
-*/
-
-
-/**
-Category for Obex faults
-*/
-_LIT(KObexFaultCategory, "ObexFault");
-
-
-/**
-Obex fault codes
-*/
-enum TObexFaultCode
- {
- /** USB has entered an unknown state. This probably means TUsbcDeviceState
- has changed without Obex being updated accordingly.
- @see TUsbcDeviceState
- @see CObexUsbHandler
- */
- EUnknownUsbState = 0,
-
-
- /** The object still has references to it on destruction.
- @see CRefCounted
- */
- ERefCountNonZero = 1,
-
-
- /** An attempt has been made to construct an unknown buffering details
- object.
- @see TObexBufferingDetails
- */
- EBadBufferDetailsVersion = 2,
-
-
- /** No receive packet is available to return.
- @see CObexServerStateMachine
- */
- ENoReceivePacketAvailable = 3,
-
-
- /** No notifier has been set to notify of an event.
- Server should not be started without a notifier, so event handling is
- not expected to occur.
- @see CObexServerStateMachine
- */
- ENoNotifierAvailable = 4,
-
-
- /** Synchronous state wrapper has been errored when calling
- CObexServer::RequestIndicationCallback().
- @see CObexServerSyncWrapper
- */
- ESyncWrapperCallbackError = 5,
-
-
- /** An unexpected event has been sent to the state machine
- @see CObexServer
- @see CObexServerStateMachine
- */
- EServerStateMachineBadEvent = 6,
-
- /** CreateTransportInfoL has been given an unrecognised
- TObexProtocolInfo::iTransport, and has therefore been unable to create a
- TObexTransportInfo.
- @see IrOBEXUtil
- */
- EUtilNoTransportInfo = 7,
-
- /** CObex::TransportDown() has been called
- This is a legacy function that is retained for backwards compatibility.
- It does not do anything and should not be called
- @see CObex::TransportDown()
- */
- ETransportDownCalled = 8,
-
- /** RespondAndEndOperation has been called, but the authentication
- state machine does not think there is an OBEX connection
- @see TObexServerOperationState::RespondAndEndOperation
- */
- ERespondAndEndOpWithoutObexConnection = 9,
-
- /** CObexClient::ClientCommandL() does not recognise the operation
- code value it is supplied.
- @see CObexClient::ClientCommandL()
- */
- EClientCommandOpUnrecognised = 10,
-
- /** CObexErrorEngine::LastError() does not recognise the error set
- argument it is supplied.
- @see CObexErrorEngine::LastError()
- */
- EErrorSetUnrecognised = 11,
-
- /** CObexErrorEngine::LastError() does not recognise the underlying
- error value that has been set.
- @see CObexErrorEngine::LastError()
- */
- EUnderlyingErrorUnrecognised = 12,
-
- /** The last underlying error is set twice during the lifetime
- of a client operation.
- @see CObexClient
- */
- ELastErrorSetTwice = 13,
-
- /** The last underlying error was not set during the lifetime
- of a client operation.
- @see CObexClient
- */
- ELastErrorNotSet = 14,
-
- /** OnPacketReceive has been called but the state machine does not
- believe the server to have been started.
- @see CObexServerStateMachine::OnPacketReceive
- */
- EPacketReceivedWhenServerNotStarted = 15,
-
- /** ConnectionComplete has been called but the state machine does
- not believe the server to have been started.
- @see CObexServerStateMachine::ConnectionComplete
- */
- EConnectionCompleteWhenServerStopped = 16,
-
- /** Put received in bad state. Note that all states where a put
- is expected to be possible (even if due to invalid remote
- behaviour) override the base implementation.
- @see TObexServerOperationState::Put
- */
- EPutInBadState = 17,
-
- /** Get received in bad state. Note that all states where a get
- is expected to be possible (even if due to invalid remote
- behaviour) override the base implementation.
- @see TObexServerOperationState::Get
- */
- EGetInBadState = 18,
-
- /** SetPath received in bad state. Note that all states where a
- setpath is expected to be possible (even if due to invalid remote
- behaviour) override the base implementation.
- @see TObexServerOperationState::SetPath
- */
- ESetPathInBadState = 19,
-
- /** Abort received in bad state. Note that all states where an
- abort is expected to be possible (even if due to invalid remote
- behaviour) override the base implementation.
- @see TObexServerOperationState::Abort
- */
- EAbortInBadState = 20,
-
- /** ConnectionComplete received in bad state. Note that all states where
- this is expected to be possible (even if due to invalid remote
- behaviour) override the base implementation.
- @see TObexServerOperationState::ConnectionComplete
- */
- EConnectionCompleteInBadState = 21,
-
- /** TransportUp received in bad state. Note that all states where
- this is expected to be possible override the base implementation.
- @see TObexServerOperationState::TransportUp
- */
- ETransportUpInBadState = 22,
-
- /** Connect received in bad state. Note that all states where
- this is expected to be possible override the base implementation.
- @see TObexServerOperationState::Connect
- */
- EConnectInBadState = 23,
-
- /** Disconnect received in bad state. Note that all states where
- this is expected to be possible override the base implementation.
- @see TObexServerOperationState::Disconnect
- */
- EDisconnectInBadState = 24,
-
- /** In the current implementation, the transport controller should be
- created at CObex::ConstructL time and persist until ~CObex.
- */
- ETransportControllerNotCreated = 25,
- };
-
-#endif
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexfilewriter.h
--- a/obex/obexprotocol/obex/inc/obexfilewriter.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __OBEXFILEWRITER_H__
-#define __OBEXFILEWRITER_H__
-
-#include
-
-/**
-Obex File Writer Interface
-
-This interface is used by Obex objects to write to disk.
-
-Note that this class is the interface to the strategies used as part of
-a Strategy pattern. CObexAsyncFileWriter and CObexSyncFileWriter provide
-the alternative strategy implementations, with CObexBufObject as the context
-for these strategies.
-
-@see CObexAsyncFileWriter
-@see CObexSyncFileWriter
-@see CObexBufObject
-
-@internalComponent
-@released
-*/
-NONSHARABLE_CLASS(MObexFileWriter)
-
- {
-public:
- /**
- Write the buffer.
-
- @param aPos The file position to write at
- @param aBuf The buffer to write. This object will use the buffer
- specified by the pointer and may return another buffer
- to the caller by updating the pointer. If an error
- occurs, the pointer will not be updated. Note that
- this class never owns any buffers and that passing
- a buffer to this function does not imply a transfer
- of ownership
- @return Symbian OS error code
-
- @internalComponent
- @released
- */
- virtual TInt Write(TInt aPos, CBufBase*& aBuf) =0;
-
- /**
- Write the final buffer of the file.
-
- This method should synchronously write the
- buffer, in order to complete writing a file.
-
- @param aPos The file position to write at
- @param aBuf The buffer to write. This object will use the buffer
- specified by the pointer and may return another buffer
- to the caller by updating the pointer. If an error
- occurs, the pointer will not be updated. Note that
- this class never owns any buffers and that passing
- a buffer to this function does not imply a transfer
- of ownership
- @param aLength The amount of the buffer to write
- @return Symbian OS error code
-
- @internalComponent
- @released
- */
- virtual TInt FinalWrite(TInt aPos, CBufBase*& aBuf, TInt aLength) =0;
-
- /**
- Destructor.
-
- The usage pattern of MObexFileWriter is such that implementors' NewL
- functions return pointers to MObexFileWriter, and clients use them only
- via pointers to MObexFileWriter. Therefore a virtual destructor is
- required for complete cleanup of implementor objects.
-
- @internalComponent
- @released
- */
- virtual ~MObexFileWriter();
- };
-
-#endif // __OBEXFILEWRITER_H__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexheaderutil.h
--- a/obex/obexprotocol/obex/inc/obexheaderutil.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,38 +0,0 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __OBEXHEADERUTIL_H__
-#define __OBEXHEADERUTIL_H__
-
-class TObexInternalHeader;
-class CObexHeaderSet;
-class CObexHeader;
-
-NONSHARABLE_CLASS(IrOBEXHeaderUtil)
- {
-public:
- static TInt ParseHeader(TObexInternalHeader& aHeader, CObexHeaderSet& aHeaderSet);
- static CObexHeader* CreateAndSetUnicodeHeader(const TUint8 aHI, const TDesC16& aUnicode);
- static CObexHeader* CreateAndSetByteSeqHeader(const TUint8 aHI, const TDesC8& aByteSeq);
- static CObexHeader* CreateAndSetUnicodeHeaderL(const TUint8 aHI, const TDesC16& aUnicode);
- static CObexHeader* CreateAndSetByteSeqHeaderL(const TUint8 aHI, const TDesC8& aByteSeq);
- };
-
-#endif // __OBEXHEADERUTIL_H__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexnotifyhandlerbase.h
--- a/obex/obexprotocol/obex/inc/obexnotifyhandlerbase.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEXNOTIFYHANDLERBASE_H
-#define OBEXNOTIFYHANDLERBASE_H
-
-/**
-@file
-@released
-@internalComponent
-*/
-
-#include
-#include
-
-class CObexPacket;
-struct TObexConnectionInfo;
-/** Receives notifications from transport.
-
-This is provided as a way of retaining BC for the CObexClient and
-CObexServer classes.
-
-This class implements the MObexNotifyExtend interface which is provided
-to the transport. Functions can safely be added to MObexNotifyExtend to
-allow the transport to provide additional notifications in future without
-altering the vtable for the published classes.
-
-A CObex owns a CObexNotifyHandlerBase. The CObexNotifyHandler base
-should not be instantiated directly, instead one of the derived classes
-should be used. The derived class then knows the type of the CObex
-object created it, as the constructor will require an appropriately
-derived type. This allows the non-virtual functions in the appropriate
-class to be called to handle notifications.
-
-Functions that are generic CObex functions, rather than functions that
-are handled differently by CObexClient and CObexServer, may be implemented
-in the base class.
-*/
-NONSHARABLE_CLASS(CObexNotifyHandlerBase) : public CBase, public MObexNotifyExtend
- {
-public:
- virtual void Process(CObexPacket& aPacket);
- virtual void Error(TInt aError);
- virtual void TransportUp();
- virtual void TransportDown(TBool aForceTransportDeletion);
-
-protected:
- CObexNotifyHandlerBase(CObex& aObex);
-
-protected:
- CObex& iObex;
- };
-
-#endif // OBEXNOTIFYHANDLERBASE_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexnotifyhandlerclient.h
--- a/obex/obexprotocol/obex/inc/obexnotifyhandlerclient.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEXNOTIFYHANDLERCLIENT_H
-#define OBEXNOTIFYHANDLERCLIENT_H
-
-/**
-@file
-@released
-@internalComponent
-*/
-
-#include "obexnotifyhandlerbase.h"
-
-class CObexClient;
-/** Recieves notifications from transport.
-
-This handles MObexNotifyExtend functions that require knowledge
-that the CObex that owns this class is a CObexClient.
-*/
-NONSHARABLE_CLASS(CObexNotifyHandlerClient) : public CObexNotifyHandlerBase
- {
-public:
- CObexNotifyHandlerClient(CObexClient& aObex);
-
-private:
- virtual void SignalPacketProcessEvent(TObexPacketProcessEvent aEvent);
- };
-
-#endif // OBEXNOTIFYHANDLERCLIENT_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexnotifyhandlerserver.h
--- a/obex/obexprotocol/obex/inc/obexnotifyhandlerserver.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEXNOTIFYHANDLERSERVER_H
-#define OBEXNOTIFYHANDLERSERVER_H
-
-/**
-@file
-@released
-@internalComponent
-*/
-
-#include "obexnotifyhandlerbase.h"
-
-class CObexServer;
-/** Recieves notifications from transport.
-
-This handles MObexNotifyExtend functions that require knowledge
-that the CObex that owns this class is a CObexServer.
-*/
-NONSHARABLE_CLASS(CObexNotifyHandlerServer) : public CObexNotifyHandlerBase
- {
-public:
- CObexNotifyHandlerServer(CObexServer& aObex);
-
-private:
- virtual void SignalPacketProcessEvent(TObexPacketProcessEvent aEvent);
- };
-
-#endif // OBEXNOTIFYHANDLERSERVER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexpacketsignaller.h
--- a/obex/obexprotocol/obex/inc/obexpacketsignaller.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEXPACKETSIGNALLER_H
-#define OBEXPACKETSIGNALLER_H
-
-/**
-@file
-@internalComponent
-@released
-*/
-
-#include
-#include
-#include
-#include
-
-const TUint KObexPacketSignallerInterestingEvents = EObexFinalPacketStarted | EObexFinalPacketFinished | EObexReadActivityDetected;
-const TUint KObexPacketSignallerInterestingClientEvents = EObexFinalPacketStarted | EObexFinalPacketFinished;
-
-/** This class handles packet process events.
-
-Currently the only events handled are those for final packet
-notification and read activity.
-*/
-NONSHARABLE_CLASS(CObexPacketSignaller) : public CActive
- {
-public:
- static CObexPacketSignaller* NewL();
- virtual ~CObexPacketSignaller();
-
- void SetFinalPacketObserver(MObexFinalPacketObserver* aObserver);
- void SetReadActivityObserver(MObexReadActivityObserver* aObserver);
- void Signal(TObexPacketProcessEvent aEvent);
-
-private:
- CObexPacketSignaller();
-
- void RunL();
- void DoCancel();
-
- void NotifyObserver(TObexPacketProcessEvent aEvent);
-
-private:
- MObexFinalPacketObserver* iFinalPacketObserver;
- MObexReadActivityObserver* iReadActivityObserver;
- TObexPacketProcessEvents iOutstandingEvents;
- };
-
-#endif // OBEXPACKETSIGNALLER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexpackettimer.h
--- a/obex/obexprotocol/obex/inc/obexpackettimer.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEXPACKETTIMER_H
-#define OBEXPACKETTIMER_H
-
-/**
-@file
-@internalComponent
-@released
-*/
-
-#include
-
-const TInt KLowestPossibleTimerValue = 0;
-
-/** This class handles the timing of Obex reponse packets
- from the server
-*/
-class CObexClient;
-
-NONSHARABLE_CLASS(CObexPacketTimer) : public CTimer
- {
-public:
- static CObexPacketTimer* NewL(CObexClient& aObexClient);
- virtual ~CObexPacketTimer();
-
- void SetTimer(TTimeIntervalMicroSeconds32 anInterval);
-
-private:
- CObexPacketTimer(CObexClient& aObexClient);
- virtual void RunL();
-
-private:
- CObexClient& iObexClient;
- };
-
-#endif // OBEXPACKETTIMER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexservernotifysyncwrapper.h
--- a/obex/obexprotocol/obex/inc/obexservernotifysyncwrapper.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// All rights reserved.
-//
-//
-
-#ifndef OBEXSERVERNOTIFYSYNCWRAPPER_H
-#define OBEXSERVERNOTIFYSYNCWRAPPER_H
-
-
-/**
-@file
-@internalComponent
-*/
-
-#include
-
-#ifdef __FLOG_ACTIVE
-_LIT8(KSyncWrapper, "syncwrapper");
-
-#define WRAPPER_LOG(str) CObexLog::Write(KSyncWrapper, str)
-#else
-#define WRAPPER_LOG(str)
-#endif
-
-/**
-Implements a synchronous wrapper around the asynchronous notification API
-now used by the Obex server. It therefore provides an SC and BC migration
-path for existing code.
-@see MObexServerNotify
-@see MObexServerNotifyAsync
-*/
-NONSHARABLE_CLASS(CObexServerNotifySyncWrapper) : public CBase, public MObexServerNotifyAsync
- {
-public:
- static CObexServerNotifySyncWrapper* NewL(CObexServer& aOwner, CObexServerStateMachine& aStateMachine);
- ~CObexServerNotifySyncWrapper();
- void SetNotifier(MObexServerNotify* aNotify);
-
-private:
- CObexServerNotifySyncWrapper(CObexServer& aOwner, CObexServerStateMachine& aStateMachine);
-
-private:
- // From MObexServerNotifyAsync
- void ErrorIndication(TInt aError);
- void TransportUpIndication();
- void TransportDownIndication();
- void ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo);
- void ObexDisconnectIndication(const TDesC8& aInfo);
- void PutRequestIndication();
- TInt PutPacketIndication();
- void PutCompleteIndication();
- void GetRequestIndication(CObexBaseObject* aRequiredObject);
- TInt GetPacketIndication();
- void GetCompleteIndication();
- void SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo);
- void AbortIndication();
- void CancelIndicationCallback();
-
-private:
- CObexServer& iOwner;
- MObexServerNotify* iNotify;
- TBool iCallbackOutstanding;
- CObexServerStateMachine& iStateMachine;
- };
-
-#endif // OBEXSERVERNOTIFYSYNCWRAPPER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexserveroperationstates.h
--- a/obex/obexprotocol/obex/inc/obexserveroperationstates.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,425 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEX_SERVER_OPERATION_STATES_H
-#define OBEX_SERVER_OPERATION_STATES_H
-
-/**
-@file
-@internalComponent
-
-Defines base state class and derived state classes for each operation
-*/
-
-#include
-#include "logger.h"
-
-static const TInt KMaxStatenameLength = 32;
-
-/**
-Defines the state class interface and default operations for events
-Also provides utility functions for common actions
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerOperationState)
- {
-public:
- // Default implementation of events
- virtual void Entry(CObexServerStateMachine& aContext);
-
- virtual void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
-
- virtual void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
-
- virtual void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
-
- virtual void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
-
- virtual void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
-
- virtual void Abort(CObexServerStateMachine& aContext);
-
- virtual void TransportUp(CObexServerStateMachine& aContext);
-
- virtual void Start(CObexServerStateMachine& aContext);
-
- virtual void Reset(CObexServerStateMachine& aContext);
-
- virtual void RequestNotificationCompleted(CObexServerStateMachine& aContext, CObexBaseObject* aObject);
-
- virtual void RequestNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse);
-
- virtual void RequestCompleteNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse);
-
- virtual void ConnectionComplete(CObexServerStateMachine& aContext);
-
- virtual void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
-
- virtual TBool ValidResponse(TObexResponse aResponseCode);
-
- virtual void WriteComplete(CObexServerStateMachine& aContext);
-
- virtual void ReadActivityDetected(CObexServerStateMachine& aContext);
-
-
-protected:
- // Utility functions
- static void PerformDisconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- static void RespondAndEndOperation(CObexServerStateMachine& aContext, TObexResponse aResponseCode);
-
-#ifdef __FLOG_ACTIVE
-public:
- TBuf8 iName;
-#endif
- };
-
-
-// State class definitions - defines methods for all the non-default events
-// default events are provided by TObexServerOperationState
-
-/**
-Initial unconnected state
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateDisconnected) : public TObexServerOperationState
- {
-public:
- TObexServerStateDisconnected();
- void Entry(CObexServerStateMachine& aContext);
- void TransportUp(CObexServerStateMachine& aContext);
- void Reset(CObexServerStateMachine& aContext);
- };
-
-/**
-Idle transport connected state (no OBEX connection)
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateTransportConnected) : public TObexServerOperationState
- {
-public:
- TObexServerStateTransportConnected();
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
- };
-
-/**
-Processes an OBEX connection attempt
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateObexConnecting) : public TObexServerOperationState
- {
-public:
- //Failure cases
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
-
- //Functional
- TObexServerStateObexConnecting();
- void Entry(CObexServerStateMachine& aContext);
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- };
-
-/**
-Waits for a password from the Application as part of connection attempt
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateWaitForUserPassword) : public TObexServerOperationState
- {
-public:
- //Failure
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void Start(CObexServerStateMachine& aContext);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
- //Functional
- TObexServerStateWaitForUserPassword();
- void ConnectionComplete(CObexServerStateMachine& aContext);
- };
-
-/**
-Idle OBEX connected state
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateReady) : public TObexServerOperationState
- {
-public:
- TObexServerStateReady();
- void Entry(CObexServerStateMachine& aContext);
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
- void ReadActivityDetected(CObexServerStateMachine& aContext);
- };
-
-/**
-Waits for object to return to Client as part of PUT operation
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStatePutOpWaitForUser) : public TObexServerOperationState
- {
-public:
- //Failure cases
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void Start(CObexServerStateMachine& aContext);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
-
- //Functional
- TObexServerStatePutOpWaitForUser();
- void Entry(CObexServerStateMachine& aContext);
- void Reset(CObexServerStateMachine& aContext);
- void RequestNotificationCompleted(CObexServerStateMachine& aContext, CObexBaseObject* aObject);
- void RequestNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse);
- TBool ValidResponse(TObexResponse aResponseCode);
-
- // Call-back function used by asynchronous one-shot
- static TInt ProcessNotification(TAny* aPtr);
- static TInt ProcessErrorNotification(TAny* aPtr);
- };
-
-/**
-Receives object from Client as part of PUT operation
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStatePutOpReceiveObject) : public TObexServerOperationState
- {
-public:
- //Failure cases
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
- //Functional
- TObexServerStatePutOpReceiveObject();
- void Entry(CObexServerStateMachine& aContext);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- };
-
-/**
-Recevies from Client specification of object to GET
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateGetOpReceiveSpecification) : public TObexServerOperationState
- {
-public:
- //Failure cases
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
- //Functional
- TObexServerStateGetOpReceiveSpecification();
- void Entry(CObexServerStateMachine& aContext);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- };
-
-/**
-Waits for object to return to Client as part of GET operation
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateGetOpWaitForUser) : public TObexServerOperationState
- {
-public:
- //Failure cases
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void Start(CObexServerStateMachine& aContext);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
-
- //Functional
- TObexServerStateGetOpWaitForUser();
- void Entry(CObexServerStateMachine& aContext);
- void Reset(CObexServerStateMachine& aContext);
- void RequestNotificationCompleted(CObexServerStateMachine& aContext, CObexBaseObject* aObject);
- void RequestNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse);
- TBool ValidResponse(TObexResponse aResponseCode);
-
- // Call-back function used by asynchronous one-shot
- static TInt ProcessNotification(TAny* aPtr);
- static TInt ProcessErrorNotification(TAny* aPtr);
- };
-
-/**
-Returns requested object to Client as part of GET operation
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateGetOpSendObject) : public TObexServerOperationState
- {
-public:
- //Failure cases
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
-
- //Functional
- TObexServerStateGetOpSendObject();
- void Entry(CObexServerStateMachine& aContext);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- };
-
-/**
-Performs SETPATH operation and waits for user interaction
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateSetPathOp) : public TObexServerOperationState
- {
-public:
- //Failure cases
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void Start(CObexServerStateMachine& aContext);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
-
- //Functional
- TObexServerStateSetPathOp();
- void Entry(CObexServerStateMachine& aContext);
- void Reset(CObexServerStateMachine& aContext);
- void RequestCompleteNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse);
- TBool ValidResponse(TObexResponse aResponseCode);
-
- static TInt ProcessNotification(TAny* aPtr);
- };
-
-/**
-Waits for user interaction after receiving the final PUT
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStatePutOpFinal) : public TObexServerOperationState
- {
-public:
- //Failure cases
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void Start(CObexServerStateMachine& aContext);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
-
- //Functional
- TObexServerStatePutOpFinal();
- void Entry(CObexServerStateMachine& aContext);
- void Reset(CObexServerStateMachine& aContext);
- void RequestCompleteNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse);
- TBool ValidResponse(TObexResponse aResponseCode);
-
- static TInt ProcessNotification(TAny* aPtr);
-private:
- static void PrepareFinalResponseHeaderSet(CObexHeader* aHeader, CObexHeaderSet& aHeaderSet, CObexPacket& aPacket);
- };
-
-/**
-Waits for user interaction after receiving the final Get
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateGetOpFinal) : public TObexServerOperationState
- {
-public:
-
- //Failure cases
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void Start(CObexServerStateMachine& aContext);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
-
- //Fucntional
- TObexServerStateGetOpFinal();
- void Reset(CObexServerStateMachine& aContext);
- void Entry(CObexServerStateMachine& aContext);
- void RequestCompleteNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse);
- TBool ValidResponse(TObexResponse aResponseCode);
-
- static TInt ProcessNotification(TAny* aPtr);
- };
-
-/**
-Disconnecting state
-@see TObexServerOperationState
-@see CObexServerStateMachine
-*/
-NONSHARABLE_CLASS(TObexServerStateDisconnecting) : public TObexServerOperationState
- {
-public:
- TObexServerStateDisconnecting();
-
- //Failure cases
- void Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Put(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Get(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void SetPath(CObexServerStateMachine& aContext, CObexPacket& aPacket);
- void Abort(CObexServerStateMachine& aContext);
- void OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse);
-
- //Functional
- void WriteComplete(CObexServerStateMachine& aContext);
- };
-
-#endif // OBEX_SERVER_OPERATION_STATES_H
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexserverrequestpacketengine.h
--- a/obex/obexprotocol/obex/inc/obexserverrequestpacketengine.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-// NOTE: This class provides inline functions - DO NOT EXPORT THIS HEADER.
-//
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef OBEXSERVERREQUESTPACKETENGINE_H
-#define OBEXSERVERREQUESTPACKETENGINE_H
-
-#include
-#include
-
-class CObexServer;
-class MObexServerRequestPacketNotify;
-
-/**
-Utility class for CObexServer - to allow the OBEX Server extension API for
-packet access.
-*/
-NONSHARABLE_CLASS(CObexServerRequestPacketEngine) : public CBase, public MObexServerRequestPacketNotifyRegister
- {
-public:
- static CObexServerRequestPacketEngine* NewL(CObexServer& aServer);
- ~CObexServerRequestPacketEngine();
-
- virtual void SetObexServerRequestPacketObserver(MObexServerRequestPacketNotify& aPacketNotify);
- virtual void DeleteObexServerRequestPacketNotifyRegister();
-
- inline MObexServerRequestPacketNotify* RequestPacketNotify() const;
-
-private:
- CObexServerRequestPacketEngine(CObexServer& aServer);
-
-private:
- CObexServer& iServer;
- MObexServerRequestPacketNotify* iRequestPacketNotify;
- };
-
-inline MObexServerRequestPacketNotify* CObexServerRequestPacketEngine::RequestPacketNotify() const
- {
- return iRequestPacketNotify;
- }
-
-#endif // OBEXSERVERREQUESTPACKETENGINE_H
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexserverstatemachine.h
--- a/obex/obexprotocol/obex/inc/obexserverstatemachine.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-
-#ifndef OBEX_SERVER_STATE_MACHINE_H
-#define OBEX_SERVER_STATE_MACHINE_H
-
-#include
-#include
-#include
-#include "obexserveroperationstates.h"
-#include "OBEXUTIL.H"
-#include "logger.h"
-
-#ifdef __FLOG_ACTIVE
-_LIT8(KStateMachineCmpt, "statemachine");
-
-#define STATE_LOG(str) CObexLog::Write(KStateMachineCmpt, str)
-#define STATE_LOG_2(str, a, b) CObexLog::WriteFormat(KStateMachineCmpt, str, a, b)
-#else
-#define STATE_LOG(str)
-#define STATE_LOG_2(str, a, b)
-#endif
-
-/**
-The OBEX Server state machine's context.
-This class holds all the state context information and acts
-as the interface between CObexServer and the current state
-@see TObexServerOperationState
-*/
-NONSHARABLE_CLASS(CObexServerStateMachine) : public CBase
- {
-public:
- enum TObexServerOperationStateEnum
- {
- EDisconnected,
- ETransportConnected,
- EObexConnecting,
- EWaitForUserPassword,
- EReady,
- EPutOpWaitForUser,
- EPutOpReceiveObject,
- EGetOpReceiveSpecification,
- EGetOpWaitForUser,
- EGetOpSendObject,
- ESetPathOp,
- EPutOpFinal,
- EGetOpFinal,
- EDisconnecting,
- EEndOfStates
- };
-
- static CObexServerStateMachine* NewL(CObexServer& aOwner, CObexTransportControllerBase& aTransport);
- ~CObexServerStateMachine();
-
-
- // Events
- void ChangeState(TObexServerOperationStateEnum aState);
- void OnPacketReceive(CObexPacket& aPacket);
- void TransportUp();
- void TransportDown();
- void Error();
- TInt RequestNotificationCompleted(CObexBaseObject* aObject);
- TInt RequestNotificationCompleted(TObexResponse aAppResponse);
- TInt RequestCompleteNotificationCompleted(TObexResponse aAppResponse);
- void ConnectionComplete();
- void Start(MObexServerNotifyAsync& aNotify);
- void Stop();
- void OverrideRequestHandling(TObexResponse aResponse);
- void WriteComplete();
- void ReadActivityDetected();
-
- // Getter/setter functions
- CObexPacket& LastReceivedPacket() const; // no setter needed as is only ever set in OnPacketReceive()
-
- // Object specifiying object to GET
- CObexBaseObject* SpecObject() const; // Don't need a setter as we own
-
- // Object returned from Application for GET/PUT
- CObexBaseObject* TransObject() const;
- void SetTransObject(CObexBaseObject* aTransObject);
-
- // Access to CObexServer members
- CObexTransportControllerBase& Transport() const;
- CObexServer& Owner() const;
- MObexServerNotifyAsync& Notification() const;
-
- // Header set for final Put response
- CObexHeaderSet* PutFinalResponseHeaderSet();
- void SetPutFinalResponseHeaderSet(CObexHeaderSet* aHeaderSet);
- CObexHeader* GetHeader(); // don't need setter as we own
-
- // Call-back used to wrap NotificationComplete event
- void CallBack(TInt (*aFunction)(TAny* aPtr));
- void CancelCallBack();
- TBool IsCallBackActive() const;
- TObexResponse AppResponse() const;
- void SetAppResponse(TObexResponse aAppResponse);
-
- void ControlledTransportDown();
-
-private:
- CObexServerStateMachine(CObexServer& aOwner, CObexTransportControllerBase& aTransport);
- void ConstructL();
-
-private:
- TFixedArray iStates;
- TObexServerOperationState* iCurrentState;
-
- CObexPacket* iLastReceivedPacket;
- CObexBaseObject* iSpecObject;
- CObexBaseObject* iTransObject;
- CObexTransportControllerBase& iTransport;
-
- CObexServer& iOwner;
- MObexServerNotifyAsync* iNotification;
-
- CObexHeaderSet* iPutFinalResponseHeaderSet;
- CObexHeader* iHeader;
-
- TBool iServerStarted;
-
- CAsyncCallBack* iCallBack;
- TObexResponse iAppResponse;
- TObexServerOperationStateEnum iCurrentStateEnum;
- };
-
-#endif // OBEX_SERVER_STATE_MACHINE_H
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexsetpathdata.h
--- a/obex/obexprotocol/obex/inc/obexsetpathdata.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __OBEXSETPATHDATA_H__
-#define __OBEXSETPATHDATA_H__
-
-#include
-#include
-
-/**
-Contains the non-standard set-path information in set-path request packets
-@internalComponent
-*/
-NONSHARABLE_CLASS(TObexSetPathData) : public TObexData
- {
-public:
- TObexSetPathData ();
-protected:
- // Implementation of TObexData functions
- virtual TUint16 DoTotalSize () const; //< Total size of this data element
- virtual TUint16 ParseIn (TUint8* aSource, const TUint16 aMaxSize);
- virtual TUint16 WriteOut (TUint8* aDest, const TUint16 aMaxSize) const;
-public:
- TUint8 iFlags;
- TUint8 iConstants;
- };
-
-#endif // __OBEXSETPATHDATA_H__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexsyncfilewriter.h
--- a/obex/obexprotocol/obex/inc/obexsyncfilewriter.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,61 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __OBEXSYNCFILEWRITER_H__
-#define __OBEXSYNCFILEWRITER_H__
-
-#include
-#include "obexfilewriter.h"
-
-class RFile;
-/**
-Obex Synchronous File Writer
-
-This object writes data from Obex objects to disk synchronously.
-
-Not intended for derivation.
-
-@internalComponent
-@released
-*/
-NONSHARABLE_CLASS(CObexSyncFileWriter) : public CBase, public MObexFileWriter
- {
-public:
- // Construction / destruction
- static MObexFileWriter* NewL(RFile& aFile);
- ~CObexSyncFileWriter();
-
-private:
- // From MObexFileWriter
- TInt Write(TInt aPos, CBufBase*& aBuf);
- TInt FinalWrite(TInt aPos, CBufBase*& aBuf, TInt aLength);
-
-private:
- // Construction
- void ConstructL();
- CObexSyncFileWriter(RFile& aFile);
-
-// Unowned
-private:
- /** Reference to the file which this object is used to write to */
- RFile& iFile;
- };
-
-#endif // __OBEXSYNCFILEWRITER_H__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/inc/obexunderlyingheader.h
--- a/obex/obexprotocol/obex/inc/obexunderlyingheader.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#ifndef __OBEXUNDERLYINGHEADER_H
-#define __OBEXUNDERLYINGHEADER_H
-
-#include
-#include
-
-/**
-Implements reference counting.
-
-@internalComponent
-*/
-NONSHARABLE_CLASS(CRefCounted) : public CBase
- {
-public:
- CRefCounted();
- virtual ~CRefCounted();
- void Open() const;
- void Close() const;
-
-private:
- mutable TInt iCount;
- };
-
-/**
-Encapsulates an Obex header.
-
-This class provides the ability to hold a header of any of the Obex
-supported types as a native Symbian OS type.
-
-A header may also have one or more attributes set. These are used by
-the object which owns the header collection so that it can keep track
-of which headers should be sent (!(ESuppressed || EDeleted)), which have
-been sent (ESent), and whether the header should be deleted (EDeleted).
-
-This is a reference counted object and should not be used directly.
-Instead the CObexHeader object provides a facade which not only allows
-the CRefCounted nature of this class to be concealed, but also
-allows header objects to be deleted normally, which decrements the
-count. Ultimately the count will reach zero, at which point this header
-object will be destroyed.
-
-@see CObexBaseObject
-@see CObexHeader
-@internalComponent
-*/
-NONSHARABLE_CLASS(CObexUnderlyingHeader) : public CRefCounted
- {
-public:
- static CObexUnderlyingHeader* NewL();
- virtual ~CObexUnderlyingHeader();
-
- void ResetContents();
- void SetAttributes(TUint16 aAttr);
- TUint16 Attributes() const;
-
- CObexHeader::THeaderType Type() const;
-
- TUint8 HI() const;
- TUint8 AsByte() const;
- TUint32 AsFourByte() const;
- const TDesC8& AsByteSeq() const;
- const TDesC16& AsUnicode() const;
-
- void SetByte(const TUint8 aHI, const TUint8 aByte);
- void SetFourByte(const TUint8 aHI, const TUint32 aFourByte);
- void SetByteSeqL(const TUint8 aHI, const TDesC8& aByteSeq);
- void SetUnicodeL(const TUint8 aHI, const TDesC16& aUnicode);
-
- TInt EncodedSize() const;
-
-private:
- CObexUnderlyingHeader();
-
-private:
- TUint16 iAttributes;
- TUint8 iHI;
-
- union
- {
- TUint8 iByte;
- TUint32 iFourByte;
- HBufC8* iByteSeq;
- HBufC16* iUnicode;
- } iHV;
- };
-
-#endif // __OBEXUNDERLYINGHEADER_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/OBEX.H
--- a/obex/obexprotocol/obex/public/OBEX.H Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef OBEX_H
-#define OBEX_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#endif // OBEX_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/ObexBtTransportInfo.h
--- a/obex/obexprotocol/obex/public/ObexBtTransportInfo.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __OBEXBTTRANSPORTINFO_H__
-#define __OBEXBTTRANSPORTINFO_H__
-
-#include
-#include
-
-/**
-Concrete transport info type for use when using RFCOMM transport controller.
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexBtTransportInfo) : public TObexTransportInfo
- {
-public:
- /**
- The BT device address of the remote party.
- */
- TBTSockAddr iAddr;
- };
-
-#endif // __OBEXBTTRANSPORTINFO_H__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/ObexIrTransportInfo.h
--- a/obex/obexprotocol/obex/public/ObexIrTransportInfo.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,96 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __OBEXIRTRANSPORTINFO_H__
-#define __OBEXIRTRANSPORTINFO_H__
-
-#include
-#include
-
-/**
-Concrete transport info type for use when using Irda ttp transport controller.
-@see KObexIrTTPProtocol
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexIrTransportInfo) : public TObexTransportInfo
-
- {
-//From TObexIrProtocolInfo
-public:
- /** IrDA address information for this connection, as used in the IrDA sockets interface.
- Refer to the SDK for more information about this.
- Its main use is for setting the port that the local machine will listen on. */
- TIrdaSockAddr iAddr;
- /** The IAS class value that the OBEX session will register its listener port,
- or request remote port with. */
- TBuf8 iClassName;
- /** The IAS attribute value that the OBEX session will register its listener port,
- or request remote port with. */
- TBuf8 iAttributeName;
- };
-
-/**
-Concrete transport info type for use when using Irda ttp transport controller, with discovery extensions.
-@see KObexIrTTPProtocolV2
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexIrV2TransportInfo) : public TObexIrTransportInfo
-
- {
-//From TObexIrProtocolInfo
-public:
- /** The number of discovery slots to use. */
- TUint8 iDiscoverySlots;
- /** The number of discovery attempts to make. */
- TUint8 iDiscoveryAttempts;
-
-private:
- // This data padding has been added to help prevent future binary compatibility breaks
- // None of these padding variables have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- TUint32 iPadding3;
- TUint32 iPadding4;
- };
-
-
-/**
-Concrete transport info type for use when using Irda ttp transport controller, with nickname extension.
-@see KObexIrTTPProtocolV3
-@publishedAll
-
-@capability WriteDeviceData If the TObexIrV3TransportInfo is passed as the argument
- to CObexServer::NewL or CObexClient::NewL and the associated
- name is valid.
-
-@released
-*/
-NONSHARABLE_CLASS(TObexIrV3TransportInfo) : public TObexIrV2TransportInfo
- {
-public:
- /** The device nickname. The maximum length in the IrDA specification
- is defined as 23 - (number of hint octets [2] + 1) = 20
- */
- TBuf<20> iLocalDeviceNickname;
-
- /** A flag indicating if the device nickname field is valid. This
- allows Symbian to make further derivations of this interface without making
- the device nickname mandatory */
- TBool iLocalDeviceNicknameValid;
- };
-
-#endif // __OBEXIRTRANSPORTINFO_H__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/ObexTransportInfo.h
--- a/obex/obexprotocol/obex/public/ObexTransportInfo.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __OBEXTRANSPORTINFO_H__
-#define __OBEXTRANSPORTINFO_H__
-
-#include
-
-/**
-This class is a combination of the TObexProtocolInfo and TObexProtocolPolicy
-classes.
-This class is designed for licensee derivation, to support novel transport
-controllers. Existing superclasses include @c TObexUsbTransportInfo, @c
-TObexUsbV2TransportInfo, @c TObexBtTransportInfo and @c TObexIrTransportInfo.
-It is also designed for 3rd party instantiation, for use when creation a
-CObexServer or a CObexClient.
-
-Note that, being a T-type, this type and all derived types must hold data by
-value, to support bitwise copying.
-
-@publishedAll
-@released
-*/
-class TObexTransportInfo
- {
-public:
- /**
- The type of the transport over which obex will run.
- The size of the buffer is chosen for historical reasons. This is the size
- originally used by TObexProtocolInfo.
- @publishedAll
- @released
- */
- TBuf<60> iTransportName;
-
- /**
- The version of the protocol policy format that this class supports
- @publishedAll
- @released
- */
- TUint16 iVersion;
-
- /**
- The maximum size of the receive packet buffer for the policy
- @publishedAll
- @released
- */
- TUint16 iReceiveMtu;
-
- /**
- The maximum size of the transmit packet buffer for the policy
- @publishedAll
- @released
- */
- TUint16 iTransmitMtu;
-
- /** */
- TUint16 iFuture1;
-
- /** */
- TUint32 iFuture2;
-
- /** */
- TInt iFuture3;
-
- /** */
- TInt iFuture4;
- };
-
-#endif // __OBEXTRANSPORTINFO_H__
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/ObexUsbTransportInfo.h
--- a/obex/obexprotocol/obex/public/ObexUsbTransportInfo.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef __OBEXUSBTRANSPORTINFO_H__
-#define __OBEXUSBTRANSPORTINFO_H__
-
-#include "obextransportinfo.h"
-#include
-
-/**
-Concrete transport info type for use when using the usb transport controller.
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexUsbTransportInfo) : public TObexTransportInfo
- {
-//Data from TObexUsbProtocolInfo class, declared in obex\public\obexconstants.h
-public:
- /** Provides a string to be attached to the Obex function's Communication Class interface,
- which may be used to identify the Obex service. */
- TBuf16 iInterfaceStringDescriptor;
- };
-
-/**
-Concrete transport info type when using the USB transport controller with client driver extensions.
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexUsbV2TransportInfo) : public TObexUsbTransportInfo
- {
-
- //Data from TObexUsbProtocolInfoV2 class, declared in obex\public\obexconstants.h
-public:
- /** Bitmap containing the bandwidth priorities to use on IN and OUT endpoints
- @see TUsbcBandwidthPriority
- */
- TInt iBandwidthPriority;
- /** Specifies whether to use DMA on the bulk OUT endpoint */
- TBool iDmaOnOutEndpoint;
- /** Specifies whether to use DMA on the bulk IN endpoint */
- TBool iDmaOnInEndpoint;
- };
-
-#endif
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexbase.h
--- a/obex/obexprotocol/obex/public/obexbase.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,236 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef __OBEXBASE_H
-#define __OBEXBASE_H
-
-#include
-#include
-
-class CObexTransportControllerBase;
-class TObexTransportInfo;
-class CObexPacket;
-class CObexNotifyHandlerBase;
-
-/**
-@publishedAll
-@released
-
-This class is the common base class for any object which wishes
-to use the Obex Server or Client.
-The class which owns a CObexClient or CObexServer must be provide an object
-derived from this class to handle the call from the Server/Client for a request
-for a Password.
-@see CObex::SetCallBack
-*/
-class MObexAuthChallengeHandler
- {
-public:
- /**
- Indicates that the server/client has received an Authentication challenge. The challenge
- can only be responded to once a password has been retrieved by some means and passed
- back to the calling class. The password is passed back via CObex::UserPasswordL
- @param aRealm This will contain the Realm specified by the unit forcing the
- Authentication, if no UserID was supplied then this parameter will be of zero length.
- */
- virtual void GetUserPasswordL(const TDesC& aRealm) = 0;
-
- /**
- Returns a null aObject if the extension is not implemented, or a pointer to another interface if it is.
- @param aInterface UID of the interface to return
- @param aObject the container for another interface as specified by aInterface
- */
- IMPORT_C virtual void MOACH_ExtensionInterfaceL(TUid aInterface, void*& aObject);
- };
-
-/**
-This class is the common base class for CObexClient and CObexServer. It is
-an abstract class and cannot be instantiated in itself. However, it does
-contain user functionality common to both client and server connections.
-
-Provides the basic OBEX transport functionality (sending and receiving
-files)
-Client and server provide the more specialied APIs for
-- initiation or response to puts & gets
-- (possible) handling of more generalised 'objects' (prob. with data buffered through a file).
-
-This class is not designed for user derivation
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CObex) : public CBase, protected MObexNotify
- {
-public:
- /**
- Describes the information set or received in a SETPATH command.
-
- The first bit of iFlags, 0, can be set to indicate to the receiver of SETPATH to backup a level before applying the path name.
- The second bit of iFlags, 1, can be set to indicate to the receiver of SETPATH to NOT create the directory if it doesn't exist.
- The iConstants variable is always set to zero as it is reserved.
- The iName variable indicates the directory to create or go to, and does not include the root directory of the receiver (i.e.
- if the directory to be set is C:\notes then iName is set to "notes").
- If a name is not set then set CObex::TSetPathInfo::iNamePresent to false.
- */
- NONSHARABLE_CLASS(TSetPathInfo)
- {
- public:
- IMPORT_C TSetPathInfo();
- TSetPathInfo(const TObexSetPathData& aData);
- IMPORT_C TBool Parent() const;
- TUint8 iFlags;
- TUint8 iConstants;
- TBuf iName;
- /** Whether iName is present in this SETPATH info */
- TBool iNamePresent;
- private:
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
- /**
- Current obex connection state
- In general, the further through the enum the values are,
- the further through the connection process the state machine
- will be.
- */
- enum TConnectState
- {
- EConnIdle, /** Nothing is happening */
- EConnTransport, /** Transport Link connected not yet established true Link */
- EConnObex, /** full connection established */
- ESimpleConnRequest, /** Connect without Auth has been sent by ClientReceived by Server */
- EConnChallRxed, /** Server has issued a challenge, to a Client cionnect */
- ESimpleConnChallIssued, /** Server, received Simple Connect but Server Challenge issued */
- EChallConnRequested, /** Connect with Auth has been sent by Client/Received by Server */
- EChallConnChallIssued, /** Server has sent a Challenge & Resp to a Client EChallConnRequest */
- EWaitForFinalResponse, /** Client, waiting for final success/fail not chall-response expected
- Server, Waiting for final Resp fromm Client to Challenge */
- EFinalResponseReceived, /** Server, the final response has been received */
- EFinalChallRxed, /** Server, Client connect with challenge, Server responds with challenge, Client re-issued original/new challenge */
- EWaitForUserInput, /** waiting for the user */
- EDropLink /** drop the link */
- };
-
- /**
- The Obex operation currently being performed.
- */
- enum TOperation
- {
- EOpConnect = 0x00, /** Connect */
- EOpDisconnect = 0x01, /** Disconnect */
- EOpPut = 0x02, /** Put */
- EOpGet = 0x03, /** Get */
- EOpSetPath = 0x05, /** SetPath */
- EOpAbort = 0xFF, /** Abort - must fit in one pkt so final bit is always set */
- EOpAbortNoFBit = 0x7F, /** Abort (internal, never transmitted) */
- EOpGetResponse = 0xFD, /** Internal - not actually an obex operation. */
- EOpIdle = 0xFE, /** Internal - not actually an obex operation. */
- };
-
- /**
- Flags to suppress the authentication elements of the authentication challenge header.
- */
- enum TObexSuppressedAuthElements
- {
- EObexNoSuppressedAuthElements = 0x00,
- EObexSuppressChallengeOptionsAuthElement = 0x01,
- EObexSuppressRealmAuthElement = 0x02,
- EObexSuppressAllAuthElements = EObexSuppressChallengeOptionsAuthElement | EObexSuppressRealmAuthElement // Must be last
- };
-
- virtual ~CObex();
- IMPORT_C void SetCallBack(MObexAuthChallengeHandler& aCallBack);
- IMPORT_C TBool IsConnected() const;
- IMPORT_C TBool IsStrictPeer() const;
- IMPORT_C const TObexConnectInfo& LocalInfo() const;
- IMPORT_C TInt SetLocalWho(const TDesC8& aInfo);
- IMPORT_C const TObexConnectInfo& RemoteInfo() const;
- IMPORT_C void SuppressAuthenticationHeaderElements(TObexSuppressedAuthElements aSuppressedObexAuthElements);
-
-public: // Implementation of MObexNotify Interface (No longer used)
- virtual void Process(CObexPacket& aPacket);
- virtual void Error(TInt aError);
- virtual void TransportUp();
- virtual void TransportDown(TBool aForceTransportDeletion);
-
-public:
- virtual void UserPasswordL( const TDesC& aPassword) = 0;
- IMPORT_C void RemoteAddr(TSockAddr& anAddr);
-
- TConnectState GetConnectState() const;
-
- IMPORT_C TBool IsAuthenticating() const;
-
- // Handling notified events.
- void NotifyProcess(CObexPacket& aPacket);
- void NotifyError(TInt aError);
- void NotifyTransportUp();
- void NotifyTransportDown(TBool);
-
-protected:
- CObex();
- virtual void ConstructL(TObexTransportInfo& aObexTransportInfo);
- virtual TInt ParseConnectPacket(CObexPacket& aPacket) = 0;
- void SetConnectState(TConnectState aNewState);
- IMPORT_C TConnectState ConnectState() const; // same as GetConnectState - has to be maintained here for BC
- virtual void OnPacketReceive(CObexPacket& aPacket) =0;
- virtual void OnError(TInt aError) =0;
- virtual void OnTransportUp() =0;
- virtual void OnTransportDown() =0;
- void ProcessChallengeL(const TObexInternalHeader& hdr); //process the received challenge
- void ProcessChallResponseL(const TObexInternalHeader& hdr); //process the response to challenge
- TInt GenerateChallenge(CObexPacket& aPacket); //generate a challenge
- void PrepareChallResponseL(const TDesC& aPassword); //generate a response to challenge
- //after user Password input
- void ForcedTransportDown();
- void ControlledTransportDown();
- void RemoteInfoCleanup();
- void CancelObexConnection();
-protected:
- TConnectState iConnectState;
- CObexTransportControllerBase* iTransportController;
- TObexConnectInfo iLocalInfo;
- TObexConnectInfo iRemoteInfo;
- MObexAuthChallengeHandler* iCallBack;
- TNonce iOutgoingNonce; //nonce used when challenging
- TNonce iIncomingNonce; //nonce used when receiving a challenge
- HBufC8* iChallPassword; //password used when challenging
- HBufC8* iRespPassword; //password used when responding to a challenge
- HBufC8* iRxChallenge;
- TBuf8 iOutgoingChallResp;//response to the previously issued challenge
- //16 nonce, 16 digest resp, 20 UserID, 3*(tag+size)
- TBuf8 iIncomingChallResp;//response received from previous challenge
- TBuf8 iIncomingRequestDigest;
- HBufC* iRemoteUID; //UID of remote device
- HBufC* iRemoteRealm;//Realm of remote device
- CObexAuthenticator* iAuthEngine;
- TBool iChallenge; //to challenge or not to challenge?
- TBool iUserIDRequested; //does the challenge insist that a UserID is returned
- TBool iReserved; //released boolean now available for future use
- TOperation iCurrentOperation;
- CObexNotifyHandlerBase* iNotifyHandler;
- TUint iSuppressedObexAuthElements;
- };
-
-#endif // __OBEXBASE_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexbaseobject.h
--- a/obex/obexprotocol/obex/public/obexbaseobject.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef __OBEXBASEOBJECT_H
-#define __OBEXBASEOBJECT_H
-
-#include
-#include
-
-const TUint32 KConnIDInvalid = 0xffffffff;
-
-/**
-Objects of this class are used to describe the objects to be transferred and
-those received via Obex.
-Consists of a number of attributes describing the object, along with
-methods to set them. CObexBaseObject is an abstract base class, which defines
-attribute setting and transferring functionality, but does not specify the
-storage mechanism for the data part (called the object body) of the object.
-This body part is defined in derived classes.
-
-Object description attributes are tracked for validity automatically, so
-that only valid attributes are sent to the remote machine. Also has the
-concept of "header masks". This selects which of the various attributes
-will actually be sent out/read in when the object is used in an operation
-with the remote machine. Objects default to transferring all valid
-attributes, use the header mask if restriction is required on the headers
-exchanged.
-
-See the various derived classes for description of object body
-representation.
-
-The common attributes are defined to be as close to the underlying OBEX
-headers as usefully possible, hence any OBEX header specified as a Unicode
-string (e.g. Name) translate to TDes (variant) EPOC descriptors, "byte
-sequences" (e.g. Type) are TDes8 (or ASCII invariant), and byte and 32 bit
-integers (e.g. Length) are TUint32s.
-
-This class is not designed for user derivation (ie. outside of this dll).
-
-@see CObexHeader
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CObexBaseObject) : public CBase
- {
-// required for access to iValidHeaders in CObexServer::CheckForConnectionID
-friend class CObexServer;
-
-public:
- virtual ~CObexBaseObject();
- IMPORT_C void SetHeaderMask(const TObexHeaderMask aHeaderMask);
- IMPORT_C void SetNameL(const TDesC& aDesc);
- IMPORT_C void SetTypeL(const TDesC8& aDesc);
- IMPORT_C void SetLengthL(const TUint32 aLength);
- IMPORT_C void SetTimeL(const TTime aLocalTime);
- IMPORT_C void SetDescriptionL(const TDesC& aDesc);
- IMPORT_C void SetTargetL(const TDesC8& aDesc);
- IMPORT_C void AddHttpL(const TDesC8& aDesc);
- IMPORT_C void SetAppParamL(const TDesC8& aDesc);
-
- IMPORT_C void AddHeaderL(CObexHeader& aHeader);
- IMPORT_C TInt BytesSent();
- IMPORT_C TInt BytesReceived();
- IMPORT_C TObexHeaderMask HeaderMask();
- IMPORT_C TObexHeaderMask ValidHeaders();
- IMPORT_C const TDesC& Name();
- IMPORT_C const TDesC8& Type();
- IMPORT_C TUint32 Length();
- IMPORT_C const TTime Time();
- IMPORT_C const TDesC& Description();
- IMPORT_C const TDesC8& Target();
- IMPORT_C const RPointerArray* Http() const;
- IMPORT_C const TDesC8& AppParam() const;
- IMPORT_C void Reset();
- IMPORT_C const CObexHeaderSet& HeaderSet() const;
- IMPORT_C CObexHeaderSet& HeaderSet();
-
- // Public unexported functions used by CObexServer, CObexClient, etc
- enum TProgress { EContinue,EComplete,EError,ELastPacket };
- TInt InitSend(TObexOpcode aOpcode);
- TProgress PrepareNextSendPacket(CObexPacket& aPacket);
- TInt InitReceive();
- TProgress ParseNextReceivePacket(CObexPacket& aPacket);
- void PrepareConnectionHeader( CObexPacket& aPacket );
- void SetConnectionIdL(TUint32 aFourByte);
- TUint32 ConnectionID();
- TObexResponse GetLastError() const;
-
-protected:
- CObexBaseObject();
- void GuessTypeFromExtL(const TDesC& aExt);
- void ResetHeaders();
- // Pure virtuals that all derived objects must implement
- virtual void GetData(TInt aPos, TDes8& aDes) =0;
- virtual void NewData(TInt aPos, TDes8& aDes) =0;
- virtual TInt DataSize() =0;
- virtual void ResetData() =0;
- void CreateHeaderStorageDataL();
- void SetTimeHeaderL(const TDesC8& aTimeDes);
- void SetUtcTimeL(const TTime aUtcTime);
-
-// Data
-private:
- TObexHeaderMask iHeaderMask;
- TObexHeaderMask iValidHeaders;
-
- mutable RPointerArray* iHttp;
-
- CObexHeaderSet* iHeaderSet;
-
- TProgress iSendProgress;
- TProgress iRecvProgress;
- TObexOpcode iSendOpcode;
-
- // This data item is used to store a CObexHeader which is used as a temporary
- // store when finding headers
- CObexHeader* iObexHeader;
-
- TObexHeaderMask iSendHeaders;
- TInt iSendBytes;
- TInt iRecvBytes;
-
- TObexResponse iLastError;
-
- };
-
-#endif // __OBEXBASEOBJECT_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexclient.h
--- a/obex/obexprotocol/obex/public/obexclient.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef __OBEXCLIENT_H
-#define __OBEXCLIENT_H
-
-#include
-#include
-
-class CObexPacket;
-class MObexFinalPacketObserver;
-class CObexPacketSignaller;
-class CObexPacketTimer;
-class CObexErrorEngine;
-
-/**
-Client side functionality. Connection based.
-Supports ...
-- Opening IrDA TTP sockets for the OBEX session.
-- Opening an OBEX session over a connected socket
-- Standard OBEX (spec. version 1.2) operations.
-
-This class is not designed for user derivation.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CObexClient) : public CObex
- {
-public:
- IMPORT_C ~CObexClient();
- IMPORT_C static CObexClient* NewL(TObexProtocolInfo& aObexProtocolInfoPtr);
- IMPORT_C static CObexClient* NewL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy);
- IMPORT_C static CObexClient* NewL(TObexTransportInfo& aObexTransportInfo);
- IMPORT_C void Connect(TRequestStatus& aStatus);
- IMPORT_C void Connect(CObexBaseObject& aObject, TRequestStatus& aStatus);
- IMPORT_C void ConnectL(CObexBaseObject& aObject, const TDesC& aPassword, TRequestStatus& aStatus);
- IMPORT_C void ConnectL(const TDesC& aPassword, TRequestStatus& aStatus);
- IMPORT_C void Disconnect(TRequestStatus& aStatus);
- IMPORT_C void Put(CObexBaseObject& aObject, TRequestStatus& aStatus);
- IMPORT_C void Get(CObexBaseObject& aObject, TRequestStatus& aStatus);
- IMPORT_C void SetPath(TSetPathInfo& aPathInfo, TRequestStatus& aStatus);
- IMPORT_C void Abort();
- IMPORT_C void UserPasswordL( const TDesC& aPassword);
- IMPORT_C const CObexHeaderSet& GetPutFinalResponseHeaders();
- IMPORT_C void SetFinalPacketObserver(MObexFinalPacketObserver* aObserver);
- IMPORT_C TObexResponse LastServerResponseCode() const;
- IMPORT_C void SetCommandTimeOut(TTimeIntervalMicroSeconds32 aTimeOut);
- IMPORT_C TAny* ExtensionInterface(TUid aUid);
-
-public: // Called from CObexNotifyExtendClient
- void SignalPacketProcessEvent(TInt aEvent);
- void TimeOutCompletion();
-
-private:
- CObexClient();
- void ConstructL(TObexTransportInfo& aObexTransportInfo);
- TBool AlreadyActive(TRequestStatus& aStatus);
- void ClientCommandL(TOperation aOp, TAny* aParam, TRequestStatus& aStatus);
- // Implementation of CObex Events
- virtual void OnPacketReceive(CObexPacket& aPacket);
- virtual void OnError(TInt aError);
- virtual void OnTransportUp();
- virtual void OnTransportDown();
- void SetRequest(TRequestStatus& aStatus, TOperation aOperation);
- void CompleteRequest(const TInt aCompletion);
- TInt PrepareConnectPacket(CObexPacket& aPacket); // Should be members of TConnectInfo
- TInt ParseConnectPacket(CObexPacket& aPacket);
- void ResetConnectionID();
- void SetConnectionID(TUint32 aConnectionID);
- void EmptyHeaderSet();
- void SendRequestPacket();
- void SendRequestPacket(TObexOpcode aObexOpcode);
-
-private:
- TRequestStatus* iPendingRequest;
- CObexBaseObject* iCurrentObject;
- TUint32 iConnectionID;
- TBool iConnectionIdSet;
- CObexHeaderSet* iHeaderSet;
- CObexHeader* iHeader;
- CObexPacketSignaller* iPacketProcessSignaller;
- TObexResponse iLastReceivedResponseOpcode;
- CObexErrorEngine* iErrorEngine;
- TBool iIsLastErrorSet;
- TTimeIntervalMicroSeconds32 iCmdTimeOutDuration;
- CObexPacketTimer* iPacketTimer;
- };
-
-#endif // __OBEXCLIENT_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexconstants.h
--- a/obex/obexprotocol/obex/public/obexconstants.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,595 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef __OBEXCONSTANTS_H
-#define __OBEXCONSTANTS_H
-
-#include
-#include
-#include
-#include
-#include
-#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
-#include
-#endif
-
-
-/** @publishedAll */
-const TInt KChallResponseSize = 58;
-/** @publishedAll */
-const TInt KObexRespSize = 16;
-/** @publishedAll */
-const TInt KUsbIntStringDescLength = 30;
-/** @publishedAll */
-const TUint8 KObexObjectDescriptionSize = 255;
-
-// Extended errors for IrObex
-
-/** Must not use as not in the allocated range */
-const TInt KErrIrObexRespBase = - 5500;
-
-/** Extended error for IrObex - No other infrared device found */
-const TInt KErrIrObexClientNoDevicesFound = -5501;
-
-/** Extended error for IrObex - Other IR device cannot handle IrObex */
-const TInt KErrIrObexClientPeerDoesNotHaveObex = -5502;
-
-/** Extended error for IrObex - Other IR device aborted the transfer */
-const TInt KErrIrObexClientPutPeerAborted = -5503;
-
-/** Extended error for IrObex - Peer device aborted data transmission/obex sending */
-const TInt KErrIrObexServerPutPeerAborted = -5507;
-
-/** Extended error for IrObex - Cannot authorise the challenge so link dropped */
-const TInt KErrIrObexConnectChallRejected = -5512;
-
-// Other Obex errors defined in the system but no longer used
-// Do not reuse the number!
-// KErrIrObexClientPutPeerCannotHandleObject -5504
-// KErrIrObexServerPutFileWriteError -5509
-// KErrIrObexClientFirstPutFailed -5510
-// KErrIrObexClientSubsequentPutFailed -5511
-
-/** Unexpected event for the given state */
-const TInt KErrIrObexBadEvent = -5513;
-
-/** Event occurred while Server is stopped */
-const TInt KErrIrObexServerStopped = -5514;
-
-/** Packet received while state machine is in a wait state */
-const TInt KErrIrObexPacketDuringWait = -5515;
-
-// There are other error codes defined at the end of this file,
-// which are a direct mapping of specific Obex error codes and
-// are returned by the client.
-
-
-// Flags used by Connect
-// ...None in OBEX 1.0
-
-
-/**
-Version number for TObexTransportInfo and derived classes.
-When iVersion is set to this value the following fields of TObexTransportInfo
-must be set:
-iTransportName,
-iReceiveMtu
-iTransmitMtu
-The iVersion member variable must be set to this value. If in future any of the
-iFuture variables are used a new version constant will be created.
-
-@see TObexTransportInfo
-@publishedAll
-@released
-*/
-const TInt KObexTransportInfoVersion0 = 0;
-
-/**
-Default for the receive and transmit MTU sizes
-Use this default value for setting the iReceiveMtu or iTransmitMtu in TObexTransportInfo
-objects or derived classes.
-
-@see TObexTransportInfo
-@publishedAll
-@released
-*/
-const TInt KObexDefaultMtuSize = 4000;
-
-/**
-Default value for the number of discovery slots to use. Use this value as a default
-for iDiscoverySlots in TObexIrdaV2TransportInfo.
-
-@see TObexIrdaV2TransportInfo
-@publishedAll
-@released
-*/
-const TUint KObexIrdaDefaultDiscoverySlotsToUse = 1;
-
-/**
-Default value for the number of discovery attempts made. Use this value as a default for iDiscoveryAttempts
-in TObexIrdaV2TransportInfo.
-@see TObexIrdaV2TransportInfo
-@publishedAll
-@released
-*/
-const TUint KObexIrdaDefaultDiscoveryAttempts = 4;
-
-// Constants used to define which transport Obex will run over.
-// Used in TObexTransportInfo and TObexProtocolInfo's iTransport member.
-
-/**
-Protocol string when running over IrDA
-@see TObexIrProtocolInfo
-@see TObexTransportInfo
-@publishedAll
-@released
-*/
-_LIT(KObexIrTTPProtocol, "IrTinyTP");
-
-/**
-Protocol string when running over IrDA
-Using this version indicates that the configuration object contains discovery parameters.
-@see TObexIrProtocolInfo
-@publishedAll
-@released
-*/
-_LIT(KObexIrTTPProtocolV2, "IrTinyTP-V2");
-
-/**
-Protocol string when running over IrDA
-Using this version indicates that the configuration object contains the device nickname.
-@see TObexIrProtocolInfo
-@publishedAll
-
-@capability WriteDeviceData If the TObexIrV3TransportInfo is passed as the argument
- to CObexServer::NewL or CObexClient::NewL and the associated
- name is valid.
-@released
-*/
-_LIT(KObexIrTTPProtocolV3, "IrTinyTP-V3");
-
-/**
-Protocol string when running over Bluetooth
-@see TObexBluetoothProtocolInfo
-@see TObexTransportInfo
-@publishedAll
-@released
-*/
-_LIT(KObexRfcommProtocol, "RFCOMM");
-
-/**
-Protocol string when running over USB
-@see TObexUsbProtocolInfo
-@see TObexTransportInfo
-@publishedAll
-@released
-*/
-_LIT(KObexUsbProtocol, "USB");
-
-/**
-Place holder for...
-protocol string that should be used
-if a Win32 emulator USB transport were
-to be created for testing.
-@see TObexUsbProtocolInfo
-@see TObexTransportInfo
-@publishedAll
-@released
-*/
-_LIT(KObexWin32UsbProtocol, "Win32Usb");
-
-/**
-Protocol string when running over USB using client driver extensions
-@see TObexUsbProtocolInfoV2
-@see TObexTransportInfo
-@publishedAll
-@released
-*/
-_LIT(KObexUsbProtocolV2, "USB-V2");
-
-/**
-This class is derived for each underlying transport protocol OBEX
-runs over.
-
-The iTransport member holds the unique name for the transport. For example for
-infra-red (TinyTP) this is "IrTinyTP" or KObexIrTTPProtocol.
-
-@see TObexIrProtocolInfo for running over TinyTP
-@see TObexBluetoothProtocolInfo for running over Rfcomm
-@see TObexUsbProtocolInfo for running over USB
-@see TObexUsbProtocolInfoV2 for running over USB using client driver extensions
-
-@see KObexIrTTPProtocol
-@see KObexIrTTPProtocolV2
-@see KObexRfcommProtocol
-@see KObexUsbProtocol
-@see KObexUsbProtocolV2
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexProtocolInfo)
- {
-public:
- /** Holds the unique name for the transport. */
- TBuf<60> iTransport;
-private:
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
-/**
-Used to describe IrDA specific protocol information
-
-To access the default OBEX server, the IAS class value should be "OBEX"
-and the IAS attribute name "IrDA:TinyTP:LsapSel".
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexIrProtocolInfo) : public TObexProtocolInfo
- {
-public:
- /** IrDA address information for this connection, as used in the IrDA sockets interface.
- Refer to the SDK for more information about this.
- Its main use is for setting the port that the local machine will listen on. */
- TIrdaSockAddr iAddr;
- /** The IAS class value that the OBEX session will register its listener port,
- or request remote port with. */
- TBuf8 iClassName;
- /** The IAS attribute value that the OBEX session will register its listener port,
- or request remote port with. */
- TBuf8 iAttributeName;
- /** The number of discovery slots to use. */
- TUint8 iDiscoverySlots;
- /** The number of discovery attempts to make. */
- TUint8 iDiscoveryAttempts;
-
-private:
- // This data padding has been added to help prevent future binary compatibility breaks
- // None of these padding variables have been zero'd because they are currently not used
- TUint16 iPadding1;
- TUint32 iPadding2;
- TUint32 iPadding3;
- TUint32 iPadding4;
- };
-
-/**
-Used to describe Bluetooth specific protocol information
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexBluetoothProtocolInfo) : public TObexProtocolInfo
- {
-public:
- /**
- For OBEX servers:
- This defines the server channel on which the OBEX server listens
- for connections. The server channel is set using SetPort on the
- TRfcommSockAddr.
- Note:
- 1) Unless the channel is defined as KRfcommPassiveAutoBind
- it may be in use when the obex server attempts to 'bind' to it
- 2) If the channel is defined as KRfcommPassiveAutoBind
- then when the server is FIRST started it will attempt
- to find a free RFComm channel. If this is successful
- that free channel will be used as the server channel
- for the life time of the obex server including
- when it is 'stopped' and re-'started'.
- 3) When the obex server is stopped, and very
- briefly when a bluetooth connection comes down, the
- obex server releases its server channel. It is possible
- therefore that during this time another application might bind
- to it. This will cause an error when the obex server tries
- to re-bind.
-
- Also note that a Bluetooth OBEX server will itself set the Object Transfer
- bit in the Service Class as required by the Generic Object Exchange
- Profile so the user need not do this.
- @see CObexServer
-
- For OBEX clients:
- This defines the server channel and the
- device address to connect to. The server channel
- and device address are set respectively using SetPort
- and SetBTAddr on the TRfcommSockAddr.
- */
- TRfcommSockAddr iAddr;
-
-private:
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
-/**
-Used to describe USB specific protocol information
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexUsbProtocolInfo) : public TObexProtocolInfo
- {
-public:
- /** Provides a string to be attached to the Obex function's Communication Class interface,
- which may be used to identify the Obex service. */
- TBuf16 iInterfaceStringDescriptor;
- };
-
-/**
-Used to set options used by the extended USB client driver for improved performance
-
-@see TObexUsbProtocolInfo
-@see RDevUsbcClient
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexUsbProtocolInfoV2) : public TObexUsbProtocolInfo
- {
-public:
- /** Bitmap containing the bandwidth priorities to use on IN and OUT endpoints
- @see TUsbcBandwidthPriority
- */
- TInt iBandwidthPriority;
- /** Specifies whether to use DMA on the bulk OUT endpoint */
- TBool iDmaOnOutEndpoint;
- /** Specifies whether to use DMA on the bulk IN endpoint */
- TBool iDmaOnInEndpoint;
-
-private:
- // This data padding has been added to help prevent future binary compatibility breaks
- // None of these padding variables have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- TUint32 iPadding3;
- TUint32 iPadding4;
- };
-
-/**
-Contains information about OBEX packet sizing policy, defining the
-maximum buffer size for receive and transmit packets
-*/
-NONSHARABLE_CLASS(TObexProtocolPolicy)
- {
-public:
- IMPORT_C TObexProtocolPolicy (); // Sets version and default values
-
- IMPORT_C TInt SetReceiveMtu ( TUint16 aReceiveMtu );
- IMPORT_C TInt SetTransmitMtu ( TUint16 aTransmitMtu );
- IMPORT_C TUint16 Version () const;
- IMPORT_C TUint16 ReceiveMtu () const;
- IMPORT_C TUint16 TransmitMtu () const;
-
-private:
- TUint16 iVersion;
- TUint16 iReceiveMtu;
- TUint16 iTransmitMtu;
-
- // This data padding has been added to help prevent future binary compatibility breaks
- // None of these padding variables have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- TUint32 iPadding3;
- TUint32 iPadding4;
- };
-
-struct TObexConnectionInfo;
-
-/**
-TObexConnectInfo
-This structure contains information used during OBEX connection. iVersion
-holds the encoded OBEX version of the machine, use @c VersionMajor() and
-@c VersionMinor() to extract the parts of the version number (each having a
-value from 0 to 15). @c iFlags holds OBEX connection flags. @c iWho holds
-the Who attribute from the connect packet, if any was specified, or
-otherwise has a length of 0.
-It is recommended that this class is only ever allocated on the heap as it is quite big.
-*/
-NONSHARABLE_CLASS(TObexConnectInfo)
- {
-public:
- IMPORT_C TObexConnectInfo();
- IMPORT_C TUint8 VersionMajor() const;
- IMPORT_C TUint8 VersionMinor() const;
-public:
- TUint8 iVersion; /** Encoded OBEX version of the machine*/
- TUint8 iFlags; /** iFlags holds OBEX connection flags*/
- TBuf8 iWho; /** the Who attribute from the connect packet, if any was specified */
- TBuf8 iTargetHeader; /** the Target header from the connect packet, if any was specified */
-
-private:
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
-
-
-//if these codes are extended due to a IRObex spec update ensure
-//that the TInt immediately below are updated
-//and the default in the method IrOBEXUtil::ObexResponse is also updated
-enum TObexResponse
- {
-/** Response is "Continue" */
- ERespContinue = 0x10,
-
-/** Response is "Success" */
- ERespSuccess = 0x20,
-
-/** Response is "Created" */
- ERespCreated = 0x21,
-
-/** Response is "Accepted" */
- ERespAccepted = 0x22,
-
-/** Response is "Non-Authenticated Information" */
- ERespNonAuthInfo = 0x23,
-
-/** Response is "No Content" */
- ERespNoContent = 0x24,
-
-/** Response is "Reset Content" */
- ERespResetContent = 0x25,
-
-/** Response is "Partial Content" */
- ERespPartialContent = 0x26,
-
-/** Response is "Multiple Choices" */
- ERespMultipleChoices = 0x30,
-
-/** Response is "Moved Permanently" */
- ERespMovedPerm = 0x31,
-
-/** Response is "Moved Temporarily" */
- ERespMovedTemp = 0x32,
-
-/** Response is "See Other" */
- ERespSeeOther = 0x33,
-
-/** Response is "Not Modified" */
- ERespNotModified = 0x34,
-
-/** Response is "Use Proxy" */
- ERespUseProxy = 0x35,
-
-/** Response is "Bad Request" */
- ERespBadRequest = 0x40,
-
-/** Response is "Unauthorized" */
- ERespUnauthorized = 0x41,
-
-/** Response is "Payment Required" */
- ERespPaymentRequired = 0x42,
-
-/** Response is "Forbidden" */
- ERespForbidden = 0x43,
-
-/** Response is "Not Found" */
- ERespNotFound = 0x44,
-
-/** Response is "Method Not Allowed" */
- ERespMethodNotAllowed = 0x45,
-
-/** Response is "Not Acceptable" */
- ERespNotAcceptable = 0x46,
-
-/** Response is "Proxy Authentication is Required" */
- ERespProxyAuthenReqd = 0x47,
-
-/** Response is "Timed Out" */
- ERespTimedOut = 0x48,
-
-/** Response is "Conflict" */
- ERespConflict = 0x49,
-
-/** Response is "Gone" */
- ERespGone = 0x4A,
-
-/** Response is "Length Required" */
- ERespLengthReqd = 0x4B,
-
-/** Response is "Precondition Failed" */
- ERespPreCondFailed = 0x4C,
-
-/** Response is "Required Entity is Too Large" */
- ERespReqEntityTooLarge = 0x4D,
-
-/** Response is "Required URL is Too Large" */
- ERespReqURLTooLarge = 0x4E,
-
-/** Response is "Unsupported Media Type" */
- ERespUnsupMediaType = 0x4F,
-
-/** Response is "Internal Error" */
- ERespInternalError = 0x50,
-
-/** Response is "Not Implemented" */
- ERespNotImplemented = 0x51,
-
-/** Response is "Bad Gateway" */
- ERespBadGateway = 0x52,
-
-/** Response is "Service Unavailable" */
- ERespServiceUnavail = 0x53,
-
-/** Response is "Gateway Timeout" */
- ERespGatewayTimeout = 0x54,
-
-/** Response is "HTTP Version is Not Supported" */
- ERespHTTPVerNotSupp = 0x55,
-
-/** Response is "Database is Full" */
- ERespDatabaseFull = 0x60,
-
-/** Response is "Database is Locked" */
- ERespDatabaseLocked = 0x61,
-
-/** Response is "Service is Unavailable" */
- ERespServiceUnavailable = 0xD3,
- };
-
-
-//some error codes to be used specifically by the client
-//these shall, be mapped directly to OBEX defined error codes.
-const TInt KErrIrObexRespSuccess = KErrIrObexRespBase - ERespSuccess; //-5532 returns 0x20 (0xA0)
-const TInt KErrIrObexRespCreated = KErrIrObexRespBase - ERespCreated; //-5533 returns 0x21 (0xA1)
-const TInt KErrIrObexRespAccepted = KErrIrObexRespBase - ERespAccepted; //-5534 returns 0x22 (0xA2)
-const TInt KErrIrObexRespNonAuthInfo = KErrIrObexRespBase - ERespNonAuthInfo; //-5535 returns 0x23 (0xA3)
-const TInt KErrIrObexRespNoContent = KErrIrObexRespBase - ERespNoContent; //-5536 returns 0x24 (0xA4)
-const TInt KErrIrObexRespResetContent = KErrIrObexRespBase - ERespResetContent; //-5537 returns 0x25 (0xA5)
-const TInt KErrIrObexRespPartialContent = KErrIrObexRespBase - ERespPartialContent; //-5538 returns 0x26 (0xA6)
-const TInt KErrIrObexRespMultipleChoices = KErrIrObexRespBase - ERespMultipleChoices; //-5548 returns 0x30 (0xB0)
-const TInt KErrIrObexRespMovedPerm = KErrIrObexRespBase - ERespMovedPerm; //-5549 returns 0x31 (0xB1)
-const TInt KErrIrObexRespMovedTemp = KErrIrObexRespBase - ERespMovedTemp; //-5550 returns 0x32 (0xB2)
-const TInt KErrIrObexRespSeeOther = KErrIrObexRespBase - ERespSeeOther; //-5551 returns 0x33 (0xB3)
-const TInt KErrIrObexRespNotModified = KErrIrObexRespBase - ERespNotModified; //-5552 returns 0x34 (0xB4)
-const TInt KErrIrObexRespUseProxy = KErrIrObexRespBase - ERespUseProxy; //-5553 returns 0x35 (0xB5)
-const TInt KErrIrObexRespBadRequest = KErrIrObexRespBase - ERespBadRequest; //-5564 returns 0x40 (0xC0)
-const TInt KErrIrObexRespUnauthorized = KErrIrObexRespBase - ERespUnauthorized; //-5565 returns 0x41 (0xC1)
-const TInt KErrIrObexRespPaymentRequired = KErrIrObexRespBase - ERespPaymentRequired; //-5566 returns 0x42 (0xC2)
-const TInt KErrIrObexRespForbidden = KErrIrObexRespBase - ERespForbidden; //-5567 returns 0x43 (0xC3)
-const TInt KErrIrObexRespNotFound = KErrIrObexRespBase - ERespNotFound; //-5568 returns 0x44 (0xC4)
-const TInt KErrIrObexRespMethodNotAllowed = KErrIrObexRespBase - ERespMethodNotAllowed; //-5569 returns 0x45 (0xC5)
-const TInt KErrIrObexRespNotAcceptable = KErrIrObexRespBase - ERespNotAcceptable; //-5570 returns 0x46 (0xC6)
-const TInt KErrIrObexRespProxyAuthenReqd = KErrIrObexRespBase - ERespProxyAuthenReqd; //-5571 returns 0x47 (0xC7)
-const TInt KErrIrObexRespTimedOut = KErrIrObexRespBase - ERespTimedOut; //-5572 returns 0x48 (0xC8)
-const TInt KErrIrObexRespConflict = KErrIrObexRespBase - ERespConflict; //-5573 returns 0x49 (0xC9)
-const TInt KErrIrObexRespGone = KErrIrObexRespBase - ERespGone; //-5574 returns 0x4A (0xCA)
-const TInt KErrIrObexRespLengthReqd = KErrIrObexRespBase - ERespLengthReqd; //-5575 returns 0x4B (0xCB)
-const TInt KErrIrObexRespPreCondFailed = KErrIrObexRespBase - ERespPreCondFailed; //-5576 returns 0x4C (0xCC)
-const TInt KErrIrObexRespReqEntityTooLarge = KErrIrObexRespBase - ERespReqEntityTooLarge;//-5577 returns 0x4D (0xCD)
-const TInt KErrIrObexRespReqURLTooLarge = KErrIrObexRespBase - ERespReqURLTooLarge; //-5578 returns 0x4E (0xCE)
-const TInt KErrIrObexRespUnsupMediaType = KErrIrObexRespBase - ERespUnsupMediaType; //-5579 returns 0x4F (0xCF)
-const TInt KErrIrObexRespInternalError = KErrIrObexRespBase - ERespInternalError; //-5580 returns 0x50 (0xD0)
-const TInt KErrIrObexRespNotImplemented = KErrIrObexRespBase - ERespNotImplemented; //-5581 returns 0x51 (0xD1)
-const TInt KErrIrObexRespBadGateway = KErrIrObexRespBase - ERespBadGateway; //-5582 returns 0x52 (0xD2)
-const TInt KErrIrObexRespServiceUnavail = KErrIrObexRespBase - ERespServiceUnavail; //-5583 returns 0x53 (0xD3)
-const TInt KErrIrObexRespGatewayTimeout = KErrIrObexRespBase - ERespGatewayTimeout; //-5584 returns 0x54 (0xD4)
-const TInt KErrIrObexRespHTTPVerNotSupp = KErrIrObexRespBase - ERespHTTPVerNotSupp; //-5585 returns 0x55 (0xD5)
-const TInt KErrIrObexRespDatabaseFull = KErrIrObexRespBase - ERespDatabaseFull; //-5596 returns 0x60 (0xE0)
-const TInt KErrIrObexRespDatabaseLocked = KErrIrObexRespBase - ERespDatabaseLocked; //-5597 returns 0x61 (0xE1)
-
-#endif // __OBEXCONSTANTS_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexfinalpacketobserver.h
--- a/obex/obexprotocol/obex/public/obexfinalpacketobserver.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEXFINALPACKETOBSERVER_H
-#define OBEXFINALPACKETOBSERVER_H
-
-#include
-
-/**
-This mixin class must be inherited by any class interested in final packet notifications.
-
-@publishedAll
-@released
-*/
-
-class MObexFinalPacketObserver
- {
-public:
-
- /** Indicates start of final packet.
- @publishedAll
- @released
- */
- virtual void MofpoFinalPacketStarted() {};
-
- /** Indicates end of final packet.
- @publishedAll
- @released
- */
- virtual void MofpoFinalPacketFinished() {};
- };
-
-#endif // OBEXFINALPACKETOBSERVER_H
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexheaders.h
--- a/obex/obexprotocol/obex/public/obexheaders.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef __OBEXHEADERS_H
-#define __OBEXHEADERS_H
-
-#include
-
-/**
-Encapsulates an Obex header.
-
-This class provides the ability to hold a header of any of the Obex
-supported types as a native Symbian OS type.
-
-A header may also have one or more attributes set. These are used by
-the object which owns the header collection so that it can keep track
-of which headers should be sent (!(ESuppressed || EDeleted)), which have
-been sent (ESent), and whether the header should be deleted (EDeleted).
-Deletion is a special case---any operation on the Object which causes
-a scan of the headers will trigger deletion of any marked headers.
-This is required as they are owned by the Object, but can be accessed
-seperately (including through the creator keeping a pointer to the
-header).
-
-@see CObexBaseObject
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CObexHeader) : public CBase
- {
-public:
- // Requires friendship with CObexBaseObject to support some aspects of the
- // legacy API (specifically the HTTP accessor method).
- friend class CObexBaseObject;
-
- enum THeaderType
- {
- EUnicode = 0x00,
- EByteSeq = 0x01,
- EByte = 0x02,
- EFourByte = 0x03
- };
-
- enum THeaderAttr
- {
- ESuppressed = 0x01,
- ESent = 0x02,
- EDeleted = 0x04,
- };
-
- IMPORT_C static CObexHeader* NewL();
- virtual ~CObexHeader();
- IMPORT_C CObexHeader* CopyL() const;
-
- //Sets this object to use the same underlying header as the parameter.
- IMPORT_C void Set(CObexHeader* aHeader);
- //Resets the contents of this header, discarding the underlying data.
- IMPORT_C void Reset();
-
- //Resets and destroys all header attributes.
- IMPORT_C void ResetContents();
-
- IMPORT_C void SetAttributes(TUint16 aAttr);
- IMPORT_C TUint16 Attributes() const;
-
- IMPORT_C THeaderType Type() const;
-
- IMPORT_C TUint8 HI() const;
- IMPORT_C TUint8 AsByte() const;
- IMPORT_C TUint32 AsFourByte() const;
- IMPORT_C const TDesC8& AsByteSeq() const;
- IMPORT_C const TDesC16& AsUnicode() const;
-
- IMPORT_C void SetByte(const TUint8 aHI, const TUint8 aByte);
- IMPORT_C void SetFourByte(const TUint8 aHI, const TUint32 aFourByte);
- IMPORT_C void SetByteSeqL(const TUint8 aHI, const TDesC8& aByteSeq);
- IMPORT_C void SetUnicodeL(const TUint8 aHI, const TDesC16& aUnicode);
-
- IMPORT_C TInt EncodedSize() const;
-
-private:
- CObexHeader();
- CObexHeader(CObexUnderlyingHeader* aHeader);
- void ConstructL();
-
-private:
- CObexUnderlyingHeader* iHeader;
- };
-
-/**
-Used to allow the iterator to decide whether to present a header to
-the user, by passing in a possible header HI value. Headers present
-in the object will be presented to the Interested() function in the
-object in which they are held (if received from a remote device
-this will be the order in which they were received, otherwise this will
-be the order in which they were set).
-The function can implement any desired behaviour, including relying on
-the order in which the headers are presented.
-
-In case any state is held, the object also provides a Reset() function.
-Reset() provides a default empty implementation.
-
-Note: there is no destructor.
-
-@publishedAll
-@released
-*/
-class MObexHeaderCheck
- {
-public:
- /**
- Called to discover is the user is interested in the contents of
- this header.
-
- @param aHI The identifier of the header, including type bits.
- @return ETrue if the user is interested in the contents of this
- header.
- @publishedAll
- @released
- */
- IMPORT_C virtual TBool Interested(TUint8 aHI) =0;
-
- /**
- Called in response to First() being called on the iterator object.
- The default implementation does nothing---some implementations may
- wish to reset state variables.
-
- @publishedAll
- @released
- */
- IMPORT_C virtual void Reset();
-
- /**
- Returns a null aObject if the extension is not implemented, or a pointer to another interface if it is.
- @param aInterface UID of the interface to return
- @param aObject the container for another interface as specified by aInterface
- @publishedAll
- */
- IMPORT_C virtual void MOHC_ExtensionInterfaceL(TUid aInterface, void*& aObject);
- };
-
-/**
-A collection of headers. Includes code to filter based on the header HI
-value, iterate through the set of interesting headers, and extract headers
-with specific HI values.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CObexHeaderSet) : public CBase
- {
-public:
- IMPORT_C static CObexHeaderSet* NewL();
- IMPORT_C CObexHeaderSet* CopyL();
- IMPORT_C CObexHeaderSet* CopyL(MObexHeaderCheck& aHeaderCheck);
- ~CObexHeaderSet();
-
- IMPORT_C TInt AddHeader(CObexHeader* aHeader);
- IMPORT_C void DeleteCurrentHeader();
-
- IMPORT_C void SetMask(MObexHeaderCheck* aMask);
- IMPORT_C void DeleteMasked();
-
- IMPORT_C void First() const;
- IMPORT_C TInt This(CObexHeader* aHeader) const;
- IMPORT_C TInt Next() const;
- IMPORT_C TInt Next(TInt aSkip) const;
- IMPORT_C TInt Count() const;
-
- IMPORT_C TInt Find(TUint8 aHI, CObexHeader& aHeader) const;
-
-private:
- CObexHeaderSet();
-
-private:
- RPointerArray iHeaders;
- mutable MObexHeaderCheck* iMask;
- mutable TInt iPos;
- };
-
-/**
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexMatchHeader) : public MObexHeaderCheck
- {
-public:
- virtual EXPORT_C TBool Interested(TUint8 aHI);
- IMPORT_C void SetHeader(TUint8 aHI);
-
-private:
- TUint8 iHI;
-
-private:
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
-/**
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexMatchHeaderType) : public MObexHeaderCheck
-{
-public:
- virtual EXPORT_C TBool Interested(TUint8 aHI);
- IMPORT_C void SetType(CObexHeader::THeaderType aType);
-
-private:
- TInt iType;
-
-private:
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
-#endif // __OBEXHEADERS_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexobjects.h
--- a/obex/obexprotocol/obex/public/obexobjects.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,341 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef __OBEXOBJECTS_H
-#define __OBEXOBJECTS_H
-
-#include
-#include
-#include
-
-class MObexFileWriter;
-class TObexBufferingDetails;
-
-/**
-This class is a concrete derivation of the CObexBaseObject class. Use it to
-store and transfer OBEX objects with the body part stored in an EPOC file.
-Hence this class is particularly suited to OBEX "file" beaming applications
-(c.f. arbitrary object beaming), although there is in reality no
-restriction in what it is used to transfer. Access to the body is acheived
-through an additional attribute to the object; the data file. This is the
-file-system name of the file used to store the body of the object. Note
-that there is no explicit relation between this and the Name of the object,
-although it is expected that most applications would attempt to relate the
-two.
-
-When ever a valid data file is set (i.e. DataFile().Length > 0), this file
-is effectively open, hence stopping any other application from opening it
-with exclusive rights. Therefore, it is recommended that Reset () be called
-on the object as soon as it is no longer required, and definitely before
-(conceptually) passing ownership of the data file to any other object or
-user.
-
-CObexFileObject is also suited to situations where an object is expected to
-be received, but no information about the purpose of this object is known.
-This is due to CObexFileObject’s ability to create temporary files "on the
-fly" to store received data into, when a specific file is not provided by
-the application.
-
-This class is not designed for user derivation.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CObexFileObject) : public CObexBaseObject
- {
-public:
- static IMPORT_C CObexFileObject* NewL();
- static IMPORT_C CObexFileObject* NewL(const TDesC &aDataFile);
- virtual IMPORT_C ~CObexFileObject();
- IMPORT_C void InitFromFileL(const TDesC& aFile);
-
-private:
- void ConstructL(const TDesC &aDataFile);
- void SetDataFileL(const TDesC& aDesc);
- const TDesC& DataFile();
- TBool RenameFile(const TDesC& aDesC);
- void SetTempFilePath(const TDesC& aPath);
- void QueryTempFilePath(TDes& aPath);
- // From CObexBaseObject
- virtual void GetData(TInt aPos, TDes8& aDes);
- virtual void NewData(TInt aPos, TDes8& aDes);
- virtual TInt DataSize();
- virtual void ResetData();
-// Data
-private:
- RFs iFs;
- TParse iDataFile;
- RFile iFile;
- TBuf iTempFilePath;
- };
-
-
-
-/**
-Use this class to hold objects where the body part is stored in a CBufFlat
-object. Please note that although parameters are supplied as CBufBase objects,
-non-CBufFlat parameters are not supported and will have unpredictable results.
-At no point does the CObexBufObject create, or take ownership of any CBaseBuf
-object it uses - it is always the responsibility of the creator/owner of the
-CBaseBuf to free it when no longer required.
-
-As this class does not take ownership of the buffers it uses, it equally can
-not create its own buffers ad-hoc for storing new data into. Hence at no
-time is it valid for a CObexBufObject to exist with out it having a valid
-data buffer set. If such a situation arises, where it is required that
-received information should be discarded, consider using a CObexNullObject.
-
-It is also posible to supply a file instead of a memory buffer, or to supply
-both. This functionality is due to the MObexServerNotify class expecting to
-work only on CObexBufObjects, so CObexFileObjects cannot be returned from the
-upcalls.
-To use a file for body storage, call NewL() passing in a NULL pointer, then
-call SetDataBufL() manually afterwards. There are three overloads---to allow
-purely memory based objects, purely file based, or a hybrid. The hybrid object
-buffers into a memory buffer (which is not allowed to grow), then writes data
-to the file when the buffer is full. The buffering behaviour can therefore be
-tuned to the application by setting the size of the buffer prior to use.
-
-This class is not designed for user derivation.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CObexBufObject) : public CObexBaseObject
- {
-public:
- /**
- Obex file buffering method.
-
- @publishedAll
- @released
- */
- enum TFileBuffering
- {
- /** Only the supplied buffer will be used to buffer file writes. */
- ESingleBuffering,
- /** The object will create a second buffer and perform double buffering. */
- EDoubleBuffering
- };
-
-public:
- static IMPORT_C CObexBufObject* NewL(CBufBase* aDataBuf);
- virtual IMPORT_C ~CObexBufObject();
- IMPORT_C TInt WriteToFile(const TPtrC& aFileName);
-
- IMPORT_C void SetDataBufL(TObexBufferingDetails& aDetails);
- IMPORT_C void SetDataBufL(CBufBase* aDataBuf);
- IMPORT_C void SetDataBufL(const TPtrC& aFilename);
- IMPORT_C void SetDataBufL(const TPtrC& aFilename, CBufBase* aDataBuf);
- IMPORT_C void SetDataBufL(const TPtrC& aFilename, CBufBase& aDataBuf, const TFileBuffering aBufferingStrategy);
- IMPORT_C CBufBase* DataBuf();
- HBufC* FileName();
-
-private:
- CObexBufObject();
- void ConstructL(CBufBase* aDataBuf);
-
- void PrepareToSetBufferL();
-
- void CopyFileL(const TDesC& aFilename);
- TInt NewFileData(TInt aPos, TDes8& aDes);
- void GetFileData(TInt aPos, TDes8& aDes);
-
- // From CObexBaseObject
- virtual void GetData(TInt aPos, TDes8& aDes);
- virtual void NewData(TInt aPos, TDes8& aDes);
- virtual TInt DataSize();
- virtual void ResetData();
-
- void CloseDataFile();
- TInt OpenDataFile(const TDesC& aFilename);
- void CloseFileServer();
- TInt OpenFileServer();
- TInt WriteBufferToFile(TBool aFinal);
-
-// Data
-private:
- CBufBase* iBuf;
- HBufC* iFilename;
- RFs* iFileServ;
- RFile* iFile;
- TInt iBufOffset;
- TInt iBuffered;
- TInt iBufSegSize;
-
-// Added for double-buffering
-private:
- // Owned
- MObexFileWriter* iWriter;
- CBufBase* iDoubleBuf;
- };
-
-
-
-/**
-Wraps parameters which can affect the buffering method used by the
-CObexBufObject.
-This version provides a single memory buffer which holds the entire object.
-Subclasses will always use a memory buffer, but can override the way that
-Obex uses it.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexBufferingDetails)
- {
-public:
- /**
- Versions (subclasses) of the buffering style object.
- This enum should not be used outside the dll.
- @internalComponent
- */
- enum TVersion
- {
- EBasicBuffer,
- EPureFile,
- EFilenameBackedBuffer,
- ERFileBackedBuffer,
- ELastVersion
- };
-
- IMPORT_C TObexBufferingDetails(CBufBase& aBuffer);
-
- TVersion Version(); // Return the version of this object
- CBufBase* Buffer();
-
-protected:
- TObexBufferingDetails(TVersion aVersion, CBufBase* aBuffer);
-
-private:
- TVersion iVersion;
- CBufBase* iBuffer;
-
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
-
-/**
-Provides alternate behaviour for a CObexBufObject, allowing use of a file
-to hold the object in its entirety. No memory buffer is used. This is a
-special case option provided to cater for the MObexServerNotify interface
-which requires the use of CObexBufObject objects. It is generally better to
-use a buffered variant.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexPureFileBuffer) : public TObexBufferingDetails
- {
-public:
- IMPORT_C TObexPureFileBuffer(const TPtrC& aFilename);
- const TPtrC& Filename();
-
-private:
- const TPtrC& iFilename;
-
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
-/**
-Provides alternate behaviour for a CObexBufObject, allowing use of a file
-to hold the object in its entirety. Writes to this object are buffered through
-the supplied CBufBase derived object, which is never enlarged. Once
-it is full, the data is flushed to the file.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexFilenameBackedBuffer) : public TObexBufferingDetails
- {
-public:
- IMPORT_C TObexFilenameBackedBuffer(CBufBase& aBuffer, const TPtrC& aFilename, CObexBufObject::TFileBuffering aBufferingStrategy);
- const TPtrC& Filename();
- CObexBufObject::TFileBuffering Strategy();
-
-private:
- const TPtrC& iFilename;
- CObexBufObject::TFileBuffering iBufferingStrategy;
-
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
-
-
-/**
-Provides alternate behaviour for a CObexBufObject, allowing use of a file
-to hold the object in its entirety. Writes to this object are buffered through
-the supplied CBufBase derived object, which is never enlarged. Once
-it is full, the data is flushed to the file.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(TObexRFileBackedBuffer) : public TObexBufferingDetails
- {
-public:
- IMPORT_C TObexRFileBackedBuffer(CBufBase& aBuffer, RFile aFile, CObexBufObject::TFileBuffering aBufferingStrategy);
- RFile File();
- CObexBufObject::TFileBuffering Strategy();
-
-private:
- RFile iFile;
- CObexBufObject::TFileBuffering iBufferingStrategy;
-
- // This data padding has been added to help prevent future binary compatibility breaks
- // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
- TUint32 iPadding1;
- TUint32 iPadding2;
- };
-
-
-
-/**
-Concrete OBEX object with NULL data representation. Use when only the
-headers of an object are required, and the data (if any) can safely be
-discarded.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CObexNullObject) : public CObexBaseObject
- {
-public:
- IMPORT_C static CObexNullObject* NewL ();
-private:
- // From CObexBaseObject
- void ConstructL();
- virtual void GetData (TInt aPos, TDes8& aDes);
- virtual void NewData (TInt aPos, TDes8& aDes);
- virtual TInt DataSize ();
- virtual void ResetData ();
- };
-
-#endif // __OBEXOBJECTS_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexpanics.h
--- a/obex/obexprotocol/obex/public/obexpanics.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEX_PANICS_H
-#define OBEX_PANICS_H
-
-/**
-@file
-@publishedAll
-@released
-
-This file contains details of all OBEX and OBEX Transport panics which may be raised
-as a result programming error by the users of OBEX (e.g. Client or Server Application
-or a proprietry transport controller).
-
-Internal panic codes should not be raised due to user errors but would reflect
-internal Obex programming errors - see inc/obexfaults.h
-*/
-
-
-/**
-Category for Obex panics
-@see TObexPanicCode
-*/
-_LIT(KObexPanicCategory, "Obex");
-
-/**
-@publishedAll
-@released
-
-All Obex panics which may be raised as a result of a client (i.e. external) programming error.
-Internal Obex panics are errors listed in TObexFaultCode
-@see TObexFaultCode
-*/
-enum TObexPanicCode
- {
- /** A NULL value was supplied for the data buffer. Note that this
- pointer can refer to either a memory buffer or a pointer to a RFile object.
- @see CObexBufObject
- */
- ENullPointer = 0,
-
-
- /** The supplied buffer is of zero length.
- @see CObexBufObject
- */
- EEmptyBuffer = 1,
-
-
- /** The header is not of the requested type.
- @see CObexHeader
- */
- EHeaderAsBadType = 2,
-
-
- /** An unknown TFileBuffering value was supplied.
- @see CObexBufObject
- */
- EInvalidBufferStrategy = 3,
-
-
- /** The RFile object does not point to a valid (open) file.
- @see CObexBufObject
- */
- ENullFileHandle = 4,
-
-
- /** An unknown TObexBufferingDetails object was supplied to a buffer object.
- @see CObexBufObject
- */
- EInvalidBufferDetails = 5,
-
-
- /** A call has been made to CObexServer::RequestIndicationCallback when no
- asynchronous request is outstanding.
- @see MObexNotifyAsync
- @see CObexServer
- */
- ENoNotificationToComplete = 6,
-
-
- /** A call has been made to CObexServer::Start when an asynchronous request
- is outstanding.
- @see MObexNotifyAsync
- @see CObexServer
- */
- EChangeInterfaceDuringWait = 7,
-
-
-
- /** An invalid packet process event has been signalled.
- */
- EBadPacketProcessEvent = 8,
-
-
- /** An event is available for signalling, but there is no observer set.
- */
- ENoPacketProcessObserverSet = 9,
-
- /** In CObexServer, a call has been made to RequestCompleteIndicationCallback(TObexResponse)
- or RequestIndicationCallback(TObexResponse) with invalid response code or
- RequestCompleteIndicationCallback(TInt) with invalid Symbian error code
- */
- EInvalidResponseCodeFromServerApp = 10,
-
- /** In CObexServer, RequestCompleteIndicationCallback has been called in response to Put/GetRequestIndication
- or ReuqestIndicationCallback has been called in response to Put/GetComplete or SetPath Indication
- */
- EInvalidResponseCallback = 11,
-
- /** The last server response code has been requested prior to a response from the server.
- */
- ENoResponseCodeToReturn = 12,
-
- /** Adding End of Body header when there is data in the object.
- */
- EAddingInvalidEoBHeader = 13,
-
- /** A user has requested to override the handling of a request
- packet at an invalid time.
- */
- EOverrideRequestHandlingInBadState = 14,
-
- /** A pointer must be null before constructing the object it points to.
- */
- ENotNullPointer = 15,
- };
-
-
-
-/**
-The category for obex transport panics
-*/
-_LIT(KObexTransportPanicCat, "ObexTransPanics");
-
-/**
-Obex transport panics raised as a result of client programming error
-*/
-enum TObexTransportPanicCode
- {
- /**
- The number of transport implementations for a given transport name is more than what is allowed.
- Check that there is not more than the allowed number of plugin resource files containing the same default
- data and inteface uid.
- */
- EInvalidNumberOfTransportImplementations = 0,
- };
-
-#endif
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexreadactivityobserver.h
--- a/obex/obexprotocol/obex/public/obexreadactivityobserver.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#ifndef OBEXREADACTIVITYOBSERVER_H
-#define OBEXREADACTIVITYOBSERVER_H
-
-#include
-
-/**
-This mixin class must be inherited by any class interested in read activity notifications.
-
-@publishedPartner
-@released
-*/
-
-class MObexReadActivityObserver
- {
-public:
-
- /** Indicates read activity.
- This is guaranteed to be called when the transport completes the first
- transport read in an Obex operation (which may correspond to less than a
- complete Obex packet), and may be called at additional times before the
- operation is completed.
- Note that the upcall behaviour is dependent on transport layer and
- version -- even if experiments show more frequent upcalls, the only
- behaviour which may be assumed is a single upcall per operation.
-
- @publishedPartner
- @released
- */
- virtual void MoraoReadActivity() {};
- };
-
-#endif // OBEXREADACTIVITYOBSERVER_H
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obexserver.h
--- a/obex/obexprotocol/obex/public/obexserver.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,692 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef __OBEXSERVER_H
-#define __OBEXSERVER_H
-
-#include
-#include
-
-class TObexTransportInfo;
-class CObexServerRequestPacketEngine;
-class CObexPacketSignaller;
-class MObexReadActivityObserver;
-
-/** OBEX server.
-
-CObexServer provides a framework for servicing OBEX requests from remote clients.
-It is designed to be able to act as either a "default" application (in IrDA
-terms, registering on the IrDA:OBEX IAS class), or as a application specific
-server (registering itself on a private IAS class).
-
-You implement service-specific behaviour by providing a MObexServerNotify
-interface implementation to the server object. The server calls the interface's
-functions to provide notification of server events, which specific implementations
-can process (or ignore) as appropriate.
-
-This class is not designed for user derivation.
-
-@publishedAll
-@released
-*/
-NONSHARABLE_CLASS(CObexServer) : public CObex
- {
- // CObexServer is friends with the core Server State Machine class so
- // that it can access the CObex::ControlledTransportDown() method
- friend class CObexServerStateMachine;
-
- // CObexServer is friends with the TObexServerStateObexConnecting class so
- // that it can access the CObex::SetConnectState(TConnectState aNewState) method
- friend class TObexServerStateObexConnecting;
-
- // CObexServer is friends with the Server Request Packet Engine so that
- // it can NULL the iServerRequestPacketEngine pointer ready for another
- // extension interface
- friend class CObexServerRequestPacketEngine;
-
-public:
- /**
- @publishedAll
- @released
-
- The target header checking to apply to incoming connection requests. Defaults to
- EIfPresent.
- @see CObexServer::SetTargetChecking
- */
- enum TTargetChecking
- {
- ENoChecking, /** Allow all target headers to connect. */
- EIfPresent, /** Only check target header in response to receiving one. Allows all clients
- specifying an Inbox service to connect. */
- EAlways, /** Strict checking. Only allow connections if target header matches or no header
- received and none expected. */
- };
-
- IMPORT_C static CObexServer* NewL(TObexProtocolInfo& aObexProtocolInfoPtr);
- IMPORT_C static CObexServer* NewL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy);
- IMPORT_C static CObexServer* NewL(TObexTransportInfo& aObexTransportInfo);
- ~CObexServer();
- IMPORT_C TInt Start(MObexServerNotify* aOwner);
- IMPORT_C TInt Start(MObexServerNotifyAsync* aOwner);
- IMPORT_C void Stop();
- IMPORT_C TBool IsStarted();
- IMPORT_C TOperation CurrentOperation() const;
- void SetCurrentOperation(const TOperation aOperation); // used internally by state machine
- IMPORT_C void SetChallengeL(const TDesC& aPassword);
- IMPORT_C void ResetChallenge();
- IMPORT_C void UserPasswordL( const TDesC& aPassword);
- IMPORT_C void SetTargetChecking(TTargetChecking aChecking);
- IMPORT_C TInt SetPutFinalResponseHeaders(CObexHeaderSet* aHeaderSet);
- IMPORT_C TInt RequestIndicationCallback(CObexBaseObject* aObject);
- IMPORT_C TInt RequestIndicationCallbackWithError(TObexResponse aResponseCode);
- IMPORT_C TInt RequestIndicationCallbackWithError(TInt aErrorCode);
- IMPORT_C TInt RequestCompleteIndicationCallback(TObexResponse aResponseCode);
- IMPORT_C TInt RequestCompleteIndicationCallback(TInt aErrorCode);
-
- IMPORT_C TInt PacketHeaders(CObexHeaderSet*& aHeaderSet);
- IMPORT_C TInt PacketHeaders(CObexHeaderSet*& aHeaderSet, MObexHeaderCheck& aHeaderCheck);
- IMPORT_C void SetReadActivityObserver(MObexReadActivityObserver* aObserver);
-
- IMPORT_C TAny* ExtensionInterfaceL(TUid aUid);
- IMPORT_C const TObexTransportInfo* TransportInfo() const;
-
-public:
- // Called from CObexNotifyExtendServer
- void SignalPacketProcessEvent(TInt aEvent);
-
- // Unexported functions used by the Server state machine
- TBool CheckObjectForConnectionId(CObexBaseObject& aObject);
- TBool CheckPacketForConnectionId(CObexPacket& aObject);
-
-private:
- CObexServer();
- void ConstructL(TObexTransportInfo& aObexTransportInfo);
- TInt AcceptConnection();
- // Implementation of CObex Events
- virtual void OnPacketReceive(CObexPacket& aPacket);
- virtual void OnError(TInt aError);
- virtual void OnTransportUp();
- virtual void OnTransportDown();
-
-public:
- // These three functions need to be public so the Server state machine can use them
- // However ParseConnectPacket cannot be moved as it is a virtual function (from CObex)
- TInt PrepareConnectPacket(CObexPacket& aPacket);
- TInt PrepareErroredConnectPacket(CObexPacket& aPacket);
- void SignalReadActivity();
- TInt ParseConnectPacket(CObexPacket& aPacket);
-
-private:
- TInt AddConnectionIDHeader(CObexPacket& aPacket);
- TInt PrepareFinalChallResponse(CObexPacket& aPacket, TConnectState& aNextState);
- void CheckTarget(TConnectState& aNextState, TInt& aRetVal);
- void ResetConnectionID();
- void SetConnectionID(TUint32 aConnectionID);
- TUint32 ConnectionID();
- void CheckServerAppResponseCode(TObexOpcode aOpcode, TObexResponse aResponse);
- TInt DoPacketHeaders(CObexHeaderSet*& aHeaderSet, MObexHeaderCheck* aHeaderCheck);
-
-private:
- MObexServerNotifyAsync* iOwner;
- TBool iEnabled;
- TBool iSpecDone;
- TBool iTargetReceived;
- TTargetChecking iTargetChecking;
- TUint32 iConnectionID;
- TBool iConnectionIdSet;
- CObexHeader* iHeader;
- CObexServerStateMachine* iStateMachine;
- CObexServerNotifySyncWrapper* iSyncWrapper;
- CObexServerRequestPacketEngine* iServerRequestPacketEngine;
- CObexPacketSignaller* iPacketProcessSignaller;
- };
-
-
-/** OBEX synchronous server notification interface.
-
-Any service that provides OBEX server functionality must implement one of the two
-server observer classes -- this one or MObexServerNotifyAsync.
-
-The CObexServer object handles the protocol side of an OBEX server session,
-while this class provides the server policy for a particular session.
-
-PUT and GET requests are handled synchronously, with the implementer returning a
-CObexBufObject which will be processed immediately.
-
-@publishedAll
-@released
-@see MObexServerNotifyAsync
-@see CObexServer
-*/
-class MObexServerNotify
- {
-public:
- /**
- Returns a null aObject if the extension is not implemented, or a pointer to another interface if it is.
- @param aInterface UID of the interface to return
- @param aObject the container for another interface as specified by aInterface
- */
- IMPORT_C virtual void MOSN_ExtensionInterfaceL(TUid aInterface, void*& aObject);
-
- /** Called if an OBEX protocol error occurs.
-
- It is only called for fatal errors that cause the OBEX connection to terminate.
- An error that does not terminate the connection, for example the server issuing
- a semantically valid, but unrecognised command, will not be indicated.
-
- @param aError Error code that describes the OBEX error. OBEX specific error
- codes are listed from KErrIrObexClientNoDevicesFound.
-
- @publishedAll
- @released
- */
- virtual void ErrorIndication(TInt aError) =0;
-
-
-
- /** Called when the underlying transport connection is made from a remote
- client to the server.
-
- Note that this does not, however, indicate an OBEX connection has been successfully
- established.
-
- You can define any low-level connection policy here. It is also a good place
- to set up the local connection information (CObex::LocalInfo()), if any non-defaults
- are required.
-
- @publishedAll
- @released
- */
- virtual void TransportUpIndication() =0;
-
-
-
- /** Called when the transport connection is dropped (by either party).
-
- It is called whether the OBEX connection was gracefully disconnected or not.
- The function is the definitive place for disconnection processing.
-
- @publishedAll
- @released
- */
- virtual void TransportDownIndication() =0;
-
-
-
- /** Called when an OBEX connection is made from a remote client.
-
- Override this function to provide any extra OBEX connection processing.
- Despite this method returning a value, implementers cannot use this to
- refuse the connection attempt.
-
- @param aRemoteInfo Connection information supplied by that remote machine
- @param aInfo Further information about the requested connection (reserved)
- @return Ignored
-
- @publishedAll
- @released
- */
- virtual TInt ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo) =0;
-
-
-
- /** Called on a (graceful) OBEX disconnection by the client.
-
- Override this to provide any extra processing OBEX disconnection processing.
-
- Note that this indication will not be raised if the remote machine simply
- drops the transport connection. However, ErrorIndication() will be called
- if the disconnection is unexpected/ invalid (i.e. another operation was in
- progress at the time). In all cases, TransportDownIndication() will be called.
-
- @param aInfo Contains information about the disconnection (reserved)
-
- @publishedAll
- @released
- */
- virtual void ObexDisconnectIndication(const TDesC8& aInfo) =0;
-
-
-
- /** Called on receipt of the first packet of a (valid) put request.
-
- It is called before any parsing of the packet is performed, simply to establish
- whether this server is interested in receiving objects at all.
-
- Note if the returned object cannot be initialised for receiving, ERespInternalError
- is returned to the client.
-
- @return CObexBaseObject-derived object, which the object being put will be
- parsed into. If this is NULL, ERespForbidden is returned to the client.
-
- @publishedAll
- @released
- */
- virtual CObexBufObject* PutRequestIndication() =0;
-
-
-
- /** Called on receipt of every packet of an OBEX PUT operation.
-
- It will always be preceded by a PutRequestIndication(). The object returned
- by the request indication will be updated to reflect all the information received
- concerning the object which the client is sending, from packets up to and
- including the current one.
-
- You can use this function to provide periodic user notification on the progress
- of the transfer (noting that the Length attribute may take an arbitrary number
- of packets to become non-zero, and the constraints on its accuracy). Due to
- the nature of OBEX operations, where any header attribute can be sent at any
- point in the transfer, this is also a good place to marshal the details of
- a received object, and possibly prompt for action on the received object (e.g.
- renaming on filename clashes).
-
- Note that this function could be hit quite heavily, in proportion to the size
- of the object transferred. Therefore more consideration should be given to
- the speed of execution of this function than that of the other indications.
-
- @return KErrNone instructs the server to allow the client to continue the put
- operation. Any other value cancels the operation with an appropriate OBEX
- server response code.
-
- @publishedAll
- @released
- */
- virtual TInt PutPacketIndication() =0;
-
-
-
- /** Called after the final put packet has been successfully received and parsed.
-
- Note that there will not necessarily be a call to this function corresponding
- to each PutRequestIndication() as, if an error occurs while the put is being
- carried out, ErrorIndication() will be called instead.
-
- Before version 6.1, the return type was void.
-
- @return KErrNoneinstructs the remote client that the put completed successfully.
- Any other value cancels the operation with an appropriate OBEX server response
- code.
-
- @publishedAll
- @released
- */
- virtual TInt PutCompleteIndication() =0;
-
-
-
- /** Called when a full get request has been received from the client.
-
- aRequestedObject holds all the details about the object the remote client
- has requested. Use this function to analyse the client's request, and return
- a pointer to the object to be returned to the client, or NULL to return no
- object.
-
- If NULL is returned, the server will send ERespForbidden to the client; if
- an error occurs in returning the object, ERespInternalError is returned, otherwise
- the returned object is sent back to the client.
-
- @param aRequiredObject Details about the object the remote client has requested
- @return Object to return to the client
-
- @publishedAll
- @released
- */
- virtual CObexBufObject* GetRequestIndication(CObexBaseObject *aRequiredObject) =0;
-
-
-
- /** Called for every packet of get reply sent by the server back to the client.
-
- The function is only called while an object is being sent to the client, not
- while the client is providing its initial specification for the object it
- requires.
-
- You can use this function to provide user notification on the object being
- sent, and its progress. As with PutPacketIndication(), you should consider
- that this function might get called often, especially for large objects and
- small OBEX packet sizes, so the speed of execution here is important.
-
- @return KErrNone to continue sending the object, or any other error code to
- cancel the operation
-
- @publishedAll
- @released
- */
- virtual TInt GetPacketIndication() =0;
-
-
-
- /** Called when the final packet of the object has been returned to the client.
-
- Note like PutCompleteIndication(), this function might not be called for each
- GetRequestIndication(), if the operation is interrupted by an error.
-
- Before version 6.1, the return type was void.
-
- @return KErrNoneinstructs the remote client that the get completed successfully.
- Any other value cancels the operation with an appropriate OBEX server response
- code.
-
- @publishedAll
- @released
- */
- virtual TInt GetCompleteIndication() =0;
-
-
-
- /** Called when an OBEX SETPATH command is received by the server.
-
- @param aPathInfo SETPATH command parameters
- @param aInfo Not currently used
- @return System wide error code indicating the success of the setpath command
-
- @publishedAll
- @released
- */
- virtual TInt SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo) =0;
-
-
-
- /** Called when an abort packet is received from the client.
-
- An OBEX abort command simply cancels the current operation, and does not necessarily
- have to cause the connection to be dropped. On return, a ERespSuccess packet
- is sent to the client.
-
- @publishedAll
- @released
- */
- virtual void AbortIndication() =0;
- };
-
-
-
-/** OBEX asynchronous server notification interface.
-
-Any service that provides OBEX server functionality must implement one of the two
-server observer classes -- this one or MObexServerNotify.
-
-The CObexServer object handles the protocol side of an OBEX server session,
-while this class provides the server policy for a particular session.
-
-PUT and GET requests are handled asynchronously, with the upcall from the server
-being followed at some stage in the future by a call to CObexServer::RequestIndicationComplete
-to trigger processing.
-
-@publishedAll
-@released
-@see MObexServerNotify
-@see CObexServer
-*/
-class MObexServerNotifyAsync
- {
-public:
-
- /**
- Returns a null aObject if the extension is not implemented, or a pointer to another
- interface if it is.
- @param aInterface UID of the interface to return
- @param aObject the container for another interface as specified by aInterface
- */
- IMPORT_C virtual void MOSNA_ExtensionInterfaceL(TUid aInterface, void*& aObject);
-
-
-
- /** Called if an OBEX protocol error occurs.
-
- It is only called for fatal errors that cause the OBEX connection to terminate.
- An error that does not terminate the connection, for example the server issuing
- a semantically valid, but unrecognised command, will not be indicated.
-
- @param aError Error code that describes the OBEX error. OBEX specific error
- codes are listed from KErrIrObexClientNoDevicesFound.
-
- @publishedAll
- @released
- */
- virtual void ErrorIndication(TInt aError) =0;
-
-
-
- /** Called when the underlying transport connection is made from a remote
- client to the server.
-
- Note that this does not, however, indicate an OBEX connection has been successfully
- established.
-
- You can define any low-level connection policy here. It is also a good place
- to set up the local connection information (CObex::LocalInfo()), if any non-defaults
- are required.
-
- @publishedAll
- @released
- */
- virtual void TransportUpIndication() =0;
-
-
-
- /** Called when the transport connection is dropped (by either party).
-
- It is called whether the OBEX connection was gracefully disconnected or not.
- The function is the definitive place for disconnection processing.
-
- @publishedAll
- @released
- */
- virtual void TransportDownIndication() =0;
-
-
-
- /** Called when an OBEX connection is made from a remote client.
-
- Override this function to provide any extra OBEX connection processing.
-
- @param aRemoteInfo Connection information supplied by that remote machine
- @param aInfo Further information about the requested connection (reserved)
-
- @publishedAll
- @released
- */
- virtual void ObexConnectIndication(const TObexConnectInfo& aRemoteInfo, const TDesC8& aInfo) =0;
-
-
-
- /** Called on a (graceful) OBEX disconnection by the client.
-
- Override this to provide any extra processing OBEX disconnection processing.
-
- Note that this indication will not be raised if the remote machine simply
- drops the transport connection. However, ErrorIndication() will be called
- if the disconnection is unexpected/ invalid (i.e. another operation was in
- progress at the time). In all cases, TransportDownIndication() will be called.
-
- @param aInfo Contains information about the disconnection (reserved)
-
- @publishedAll
- @released
- */
- virtual void ObexDisconnectIndication(const TDesC8& aInfo) =0;
-
-
-
- /** Called on receipt of the first packet of a (valid) put request.
-
- It is called before any parsing of the packet is performed, simply to establish
- whether this server is interested in receiving objects at all.
-
- Following this notification, the server will wait for a call to
- CObexServer::RequestIndicationCallback supplying a CObexBaseObject derived
- object to receive into or a response code specifying the error.
-
- @publishedAll
- @released
- */
- virtual void PutRequestIndication() =0;
-
-
-
- /** Called on receipt of every packet of an OBEX PUT operation.
-
- It will always be preceded by a PutRequestIndication(). The object returned
- by the request indication will be updated to reflect all the information received
- concerning the object which the client is sending, from packets up to and
- including the current one.
-
- You can use this function to provide periodic user notification on the progress
- of the transfer (noting that the Length attribute may take an arbitrary number
- of packets to become non-zero, and the constraints on its accuracy). Due to
- the nature of OBEX operations, where any header attribute can be sent at any
- point in the transfer, this is also a good place to marshal the details of
- a received object, and possibly prompt for action on the received object (e.g.
- renaming on filename clashes).
-
- Note that this function could be hit quite heavily, in proportion to the size
- of the object transferred. Therefore more consideration should be given to
- the speed of execution of this function than that of the other indications.
-
- @return KErrNone instructs the server to allow the client to continue the put
- operation. Any other value cancels the operation with an appropriate OBEX
- server response code.
-
- @publishedAll
- @released
- */
- virtual TInt PutPacketIndication() =0;
-
-
-
- /** Called after the final put packet has been successfully received and parsed.
-
- Note that there will not necessarily be a call to this function corresponding
- to each PutRequestIndication() as, if an error occurs while the put is being
- carried out, ErrorIndication() will be called instead.
-
- Following this notification, the server will wait for a call to
- CObexServer::RequestCompleteIndicationCallback supplying a Obex response code.
-
- @publishedAll
- @released
- */
- virtual void PutCompleteIndication() =0;
-
-
-
- /** Called when a full get request has been received from the client.
-
- aRequestedObject holds all the details about the object the remote client
- has requested. Use this function to analyse the client's request, and return
- a pointer to the object to be returned to the client, or NULL to return no
- object.
-
- Following this notification, the server will wait for a call to
- CObexServer::RequestIndicationCallback supplying a CObexBaseObject derived
- object to send to the client or a response code specifying the error.
-
- @param aRequiredObject Details about the object the remote client has requested
-
- @publishedAll
- @released
- */
- virtual void GetRequestIndication(CObexBaseObject* aRequiredObject) =0;
-
-
-
- /** Called for every packet of get reply sent by the server back to the client.
-
- The function is only called while an object is being sent to the client, not
- while the client is providing its initial specification for the object it
- requires.
-
- You can use this function to provide user notification on the object being
- sent, and its progress. As with PutPacketIndication(), you should consider
- that this function might get called often, especially for large objects and
- small OBEX packet sizes, so the speed of execution here is important.
-
- @return KErrNone to continue sending the object, or any other error code to
- cancel the operation
-
- @publishedAll
- @released
- */
- virtual TInt GetPacketIndication() =0;
-
-
-
- /** Called when the final packet of the object has been returned to the client.
-
- Note like PutCompleteIndication(), this function might not be called for each
- GetRequestIndication(), if the operation is interrupted by an error.
-
- Following this notification, the server will wait for a call to
- CObexServer::RequestCompleteIndicationCallback supplying a Obex response code.
-
- @publishedAll
- @released
- */
- virtual void GetCompleteIndication() =0;
-
-
-
- /** Called when an OBEX SETPATH command is received by the server.
-
- Following this notification, the server will wait for a call to
- CObexServer::RequestCompleteIndicationCallback supplying a Obex response code.
-
- @param aPathInfo SETPATH command parameters
- @param aInfo Not currently used
-
- @publishedAll
- @released
- */
- virtual void SetPathIndication(const CObex::TSetPathInfo& aPathInfo, const TDesC8& aInfo) =0;
-
-
-
- /** Called when an abort packet is received from the client.
-
- An OBEX abort command simply cancels the current operation, and does not necessarily
- have to cause the connection to be dropped. On return, a ERespSuccess packet
- is sent to the client.
-
- @publishedAll
- @released
- */
- virtual void AbortIndication() =0;
-
-
-
- /** Cancel an asynchronous callback request (ie. PutRequest/GetRequest/PutComplete/GetComplete/SetPath
- notification).
-
- Note that ignoring this call will lead to a panic when the indication callback function
- is called.
-
- @publishedAll
- @released
- */
- virtual void CancelIndicationCallback() =0;
- };
-
-
-#endif // __OBEXSERVER_H
-
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/public/obextypes.h
--- a/obex/obexprotocol/obex/public/obextypes.h Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,70 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
- @released
-*/
-
-#ifndef __OBEXTYPES_H
-#define __OBEXTYPES_H
-
-#include
-#include
-#include
-#include // Required for source compatability
-#include
-
-typedef TUint16 TObexHeaderMask;
-typedef TUint8 TObexOpcode;
-typedef TBuf8<16> TNonce;
-
-class TObexProtocolInfo;
-class TObexIrProtocolInfo;
-class TObexBluetoothProtocolInfo;
-class TObexUsbProtocolInfo;
-class TObexUsbProtocolInfoV2;
-class TObexProcotolPolicy;
-struct TObexConnectionInfo;
-class TObexConnectInfo;
-
-class CObexPacket;
-class CObexHeader;
-class CObexUnderlyingHeader;
-class MObexHeaderCheck;
-class CObexHeaderSet;
-class CObexBaseObject;
-class CObexFileObject;
-class CObexBufObject;
-class CObexNullObject;
-class MObexNotify;
-class MObexAuthChallengeHandler;
-class CObexTransport;
-class CObexConnector;
-class TObexInternalHeader;
-class CObexAuthenticator;
-class CObex;
-class TObexSetPathData;
-class CObexClient;
-class MObexServerNotify;
-class CObexServer;
-class CObexServerStateMachine;
-class MObexServerNotify;
-class MObexServerNotifyAsync;
-class CObexServerNotifySyncWrapper;
-
-
-#endif // __OBEXTYPES_H
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/OBEX.CPP
--- a/obex/obexprotocol/obex/src/OBEX.CPP Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,962 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "logger.h"
-#include "obexsetpathdata.h"
-#include "OBEXUTIL.H"
-#include "authentication.h"
-#include
-
-#ifdef __FLOG_ACTIVE
-_LIT8(KLogComponent, "OBEX");
-#endif
-
-/**
-Constructor - set initial values and copy in protocol policy information
-@internalComponent
-*/
-CObex::CObex()
- {
-#ifdef _DEBUG
- CObexLog::Connect();
-#endif
- FLOG(_L("Creating CObex"));
- SetConnectState(EConnIdle);
- }
-
-void CObex::ConstructL(TObexTransportInfo& aObexTransportInfo)
- {
- iTransportController = CObexTransportControllerBase::NewL(aObexTransportInfo);
- iAuthEngine = CObexAuthenticator::NewL();
- iSuppressedObexAuthElements = EObexNoSuppressedAuthElements;
- }
-
-/**
-Destructor.
-*/
-CObex::~CObex()
- {
-
- delete iTransportController;
- delete iAuthEngine;
- delete iChallPassword;
- delete iRespPassword;
- delete iRemoteUID;
- delete iRemoteRealm;
- delete iRxChallenge;
-
- // This must be done AFTER destroying the transport controller.
- REComSession::FinalClose();
-
- // iNotifyHandler is deleted in the derived classes where it is instantiated
-
-#ifdef _DEBUG
- CObexLog::Close();
-#endif
- }
-
-/**
-Get the socket address of the remote device.
-
-This is the address of the device OBEX is connected to over an IrDA or Bluetooth
-socket.
-
-@param aAddr Socket address.
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObex::RemoteAddr(TSockAddr& aAddr)
- {
- LOG_LINE
- LOG_FUNC
-
- // iTransportController must be valid for all the CObex life cycle
- __ASSERT_DEBUG(iTransportController, IrOBEXUtil::Fault(ETransportControllerNotCreated));
-
- iTransportController->RemoteAddr(aAddr);
- }
-
-/**
-Sets the local Who field.
-
-This is used to identify the local end of the OBEX session when the OBEX connection
-is made. If it is required, set it before establishing the connection.
-
-@param aInfo Who field
-@return KErrNone or KErrArgument if aInfo is empty
-
-@publishedAll
-@released
-*/
-EXPORT_C TInt CObex::SetLocalWho(const TDesC8& aInfo)
- {
- LOG_LINE
- LOG_FUNC
-
- if(aInfo.Length())
- { iLocalInfo.iWho.Copy(aInfo); return KErrNone;}
- else
- return KErrArgument;
- }
-
-/**
-Indicates if the Server / Client is currently authenticating the OBEX
-connection.
-
-@return ETrue if the Server / Client is currently authenticating the OBEX connection otherwise EFalse.
-
-@publishedAll
-@released
-*/
-EXPORT_C TBool CObex::IsAuthenticating() const
- {
- return (ConnectState() >= EConnChallRxed && ConnectState() <= EWaitForUserInput);
- }
-
-
-/**
-@param aPassword Password to use in challenge response
-@internalComponent
-*/
-void CObex::PrepareChallResponseL(const TDesC& aPassword)
- {
-
- FLOG(_L("CObex::PrepareChallResponse\r\n"));
- iOutgoingChallResp.Zero();
- TRequestDigest response;
- delete iRespPassword;
- iRespPassword = NULL;
- iRespPassword = HBufC8::NewL(aPassword.Length());
- TPtr8 ptr = iRespPassword->Des();
- CnvUtfConverter::ConvertFromUnicodeToUtf8(ptr, aPassword);
-
- iAuthEngine->GenerateResponseL(ptr, iIncomingNonce, response);
- FLOG(_L("PrepareChallResponse: Digest response generated"));
-
- FLOG(_L("PrepareChallResponse: Adding response hash"));
- iOutgoingChallResp.Append(KObexRespTag); //0x00
- iOutgoingChallResp.Append(KObexRespSize); //16
- iOutgoingChallResp.Append(response);
-
- //only reply with UserID if requested
- if (iUserIDRequested )
- {
- FLOG(_L("PrepareChallResponse: User ID required, adding zero length field"));
- iOutgoingChallResp.Append(KObexRespUserIDTag); //0x01
- //Fixme, add in the size of the user ID
- iOutgoingChallResp.Append(0); //assume no UserID size of 0
- //any user ID would have to be inserted here
- //iOutgoingChallResp.Append(userID); //Fixme what is the user ID?
- }
-
- FLOG(_L("PrepareChallResponse: Adding nonce of challenge we're replying to"));
- iOutgoingChallResp.Append(KObexRespNonceTag);
- iOutgoingChallResp.Append(KObexNonceSize);
- iOutgoingChallResp.Append(iIncomingNonce);
-
- FLOG(_L(" PrepareChallResponse - complete response generated"));
- }
-
-/**
-@internalComponent
-*/
-TInt CObex::GenerateChallenge(CObexPacket& aPacket)
- {
- TInt retValue = KErrNone;
-
- FLOG(_L("CObex::GenerateChallenge\r\n"));
- iOutgoingNonce.Zero();
- iAuthEngine->GenerateNonce(iOutgoingNonce);
- //now pack all the data together for the overall challenge
- TBuf8 outGoingHeader; //this size assumes no Realm data
- outGoingHeader.Zero();
- outGoingHeader.Append(KObexChallNonceTag);
- outGoingHeader.Append(KObexNonceSize);
- outGoingHeader.Append(iOutgoingNonce);
-
- // Add authentication header only if the client has not disallowed it
- if (!(iSuppressedObexAuthElements & EObexSuppressChallengeOptionsAuthElement))
- {
- outGoingHeader.Append(KObexChallOptionsTag);
- outGoingHeader.Append(1); //size is always 1
- outGoingHeader.Append(0); //all options off
- }
-
- // Add realm header only if the client has not disallowed it
- if (!(iSuppressedObexAuthElements & EObexSuppressRealmAuthElement))
- {
- outGoingHeader.Append(KObexChallRealmTag);
- outGoingHeader.Append(0); //no realm so size = 0
- }
-
- TObexInternalHeader hdr;
- hdr.Set(TObexInternalHeader::EAuthChallenge, (const_cast (outGoingHeader.Ptr())), outGoingHeader.Size());
- if(!aPacket.InsertData(hdr))
- retValue = KErrOverflow;
-
- return (retValue);
- }
-
-/**
-@internalComponent
-*/
-void CObex::ProcessChallResponseL(const TObexInternalHeader& hdr)
- {
- FLOG(_L("CObex::ProcessChallResponse"));
- TBool retValue = ETrue;
- TInt responseSize = hdr.HVSize();
- TInt elementsLeft = responseSize; //keep track of how many elements still to be removed
-
- if ( responseSize > KChallResponseSize )
- {
- retValue = EFalse;
- FLOG(_L("ProcessChallResponse - Response header too big FAILED"));
- }
- else if (responseSize < KMinChallResponseSize)
- {
- retValue = EFalse;
- FLOG(_L("ProcessChallResponse - Response header too small FAILED"));
- }
-
- //get the response
- iIncomingChallResp.Zero();
- iIncomingChallResp.Copy(hdr.HVByteSeq(), responseSize);
-
- //there is no reason to assume that the data is going to arrive
- //in any particular order
- TInt extractionPosn = 0;
-
- //ensure space enough for the tag and size
- while ((extractionPosn < (responseSize-1) ) && retValue)
- {
- switch (iIncomingChallResp[extractionPosn++])
- {
- case KObexRespTag:
- {
- elementsLeft--; //moved passed the tag
- if ((iIncomingChallResp[extractionPosn++] == KObexRespSize)&&
- (elementsLeft > KObexRespSize)) //must be greater to allow for size field
- {
- elementsLeft--; //moved passed the size
- FLOG(_L("ProcessChallResponse - iIncoming Request Response extracted"));
- iIncomingRequestDigest.Zero();
- iIncomingRequestDigest.Append((TUint8*)iIncomingChallResp.Ptr() + extractionPosn, KObexRespSize);
- extractionPosn += KObexRespSize;
- elementsLeft -= KObexRespSize;
- }
- else
- {
- FLOG(_L("ProcessChallResponse - iIncoming Request Response extraction FAILED"));
- retValue = EFalse;
- }
- }
- break;
- case KObexRespUserIDTag:
- {
- elementsLeft--; //moved passed the tag
- TInt userIDSize = iIncomingChallResp[extractionPosn++];
- if ( userIDSize > 0)
- {
- elementsLeft--; //moved passed the User ID size
- if (( userIDSize > 0 )&&(userIDSize <= elementsLeft ))
- {
- elementsLeft -= userIDSize;
- FLOG(_L("ProcessChallResponse - iIncoming ASCII UserID Extracted"));
- delete iRemoteUID;
- iRemoteUID = NULL;
- iRemoteUID = HBufC::NewL(userIDSize);
- TPtrC8 ptr((TUint8*)iIncomingChallResp.Ptr() + extractionPosn, userIDSize);
- TPtr ptrUID((TUint16*)iRemoteUID->Ptr(), userIDSize);
- CnvUtfConverter::ConvertToUnicodeFromUtf8(ptrUID, ptr);
- extractionPosn += userIDSize;
- }
- }
- else
- {
- retValue = EFalse;
- FLOG(_L("ProcessChallResponse - iIncoming UserID Extraction FAILED"));
- }
- }
- break;
- //don't bother extracting the Nonce as we do not support multiple Nonce replies
- //the assumption is the reply received is for the Nonce we sent out
- case KObexRespNonceTag:
- {
- FLOG(_L("ProcessChallResponse: extracting incoming nonce"));
- elementsLeft--; //moved passed the tag
- TInt nonceSize = iIncomingChallResp[extractionPosn++];
- if ( nonceSize > 0 )
- {
- elementsLeft--; //moved passed size
- if ( nonceSize <= elementsLeft )
- {
- FTRACE(
- TPtrC8 incomingNonce(iIncomingChallResp.Ptr() + extractionPosn, nonceSize);
- if (incomingNonce != iOutgoingNonce)
- {
- FLOG(_L("ProcessChallResponse: incoming nonce does not match our challenge. Continuing anyway."));
- }
- );
-
- elementsLeft -= nonceSize;
- extractionPosn += nonceSize;
- }
- else
- {
- FLOG(_L("ProcessChallResponse - iIncoming Request Response extraction, bad nonce size FAILED"));
- retValue = EFalse;
- }
- }
- }
- break;
- default:
- {
- FLOG(_L("ProcessChallResponse - iIncoming Request Response extraction,unknown tag type FAILED"));
- retValue = EFalse;
- }
- break;
-
- }
- TRAPD(err, iAuthEngine->ChallengeResponseL(*iChallPassword, iOutgoingNonce, iIncomingRequestDigest));
- if ( err != KErrNone)
- {
- FLOG(_L("ProcessChallResponse - Responsed Denied"));
- User::Leave(err);
- }
- }
- if (!retValue )
- User::Leave(KErrGeneral);
- }
-
-/**
-@internalComponent
-*/
-void CObex::ProcessChallengeL(const TObexInternalHeader& hdr)
- {
- FLOG(_L("CObex::ProcessChallenge\n\r"));
-
- //extract all the necessary data
- TInt challengeSize = hdr.HVSize();
- TInt extractionPosn = 0;
- TInt elementsLeft = challengeSize;
- TBool nonceExtracted = EFalse;
-
- delete iRxChallenge;
- iRxChallenge = NULL;
- iRxChallenge = HBufC8::NewL(challengeSize);
- iRxChallenge->Des().Copy(hdr.HVByteSeq(), challengeSize);
- delete iRemoteRealm;
- iRemoteRealm = NULL;
-
-
-
- //can't make any assumptions about the order
- //in which anything may arrive, so allow any old order
- TBool exit = EFalse;
- if ( challengeSize < (KObexNonceSize + 2))
- {
- FLOG(_L("CObex::ProcessChallenge incoming Challenge too small\n\r"));
- User::Leave(KErrGeneral);
- }
-
- //must be space for Tag and size
- while ((elementsLeft > 2) && (!exit))
- {
- switch (iRxChallenge->Des()[extractionPosn++])
- {
- case KObexChallNonceTag: //check the Nonce tag has arrived
- {
- elementsLeft--; //passed the tag posn
- if (( iRxChallenge->Des()[extractionPosn++] == KObexNonceSize )
- && (elementsLeft > KObexNonceSize))
- {
- FLOG(_L("CObex::ProcessChallenge incoming Nonce Extracted\n\r"));
- iIncomingNonce.Zero();
- //extract the Nonce data
- TPtr8 ptr((TUint8*)iRxChallenge->Ptr() + extractionPosn
- ,KObexNonceSize, KObexNonceSize);
- iIncomingNonce.Append(ptr);
- elementsLeft -= (KObexNonceSize + 1);
- nonceExtracted = ETrue;
- extractionPosn += KObexNonceSize;
- }
- else
- {
- FLOG(_L("CObex::ProcessChallenge Incorrect Nonce size\n\r"));
- exit = ETrue;
- }
- }
- break;
- case KObexChallOptionsTag:
- {
- elementsLeft--; //passed the tag posn
- //check the options flag
- iUserIDRequested = EFalse;
- if (( iRxChallenge->Des()[extractionPosn++] == KObexChallOptionSize )
- && (elementsLeft > KObexChallOptionSize))
- {
- //check if the user ID is required in the reply
- if ( iRxChallenge->Des()[extractionPosn++] & KObexRequireUID )
- {
- //the userID has been requested so it MUST be sent back in the chall response
- iUserIDRequested = ETrue;
- FLOG(_L("CObex::ProcessChallenge User ID Requested\n\r"));
- }
- elementsLeft -= (KObexChallOptionSize + 1);
-
- }
- else
- {
- FLOG(_L("CObex::ProcessChallenge Incorrect Options size\n\r"));
- exit = ETrue;
- }
- }
- break;
- case KObexChallRealmTag:
- {
- elementsLeft--; //passed the tag posn
- TInt size = iRxChallenge->Des()[ extractionPosn++ ];
- elementsLeft--;
- if ( (size > 0 ) && (size <= elementsLeft ) )
- {
- elementsLeft -= size;
- size--; //remove the first byte
- //check which format the data is in
- TUint convertType=0;
- switch(iRxChallenge->Des()[extractionPosn++])
- {
- case 0:
- convertType=KCharacterSetIdentifierAscii;
- break;
- case 1:
- convertType=KCharacterSetIdentifierIso88591;
- break;
- case 2:
- convertType=KCharacterSetIdentifierIso88592;
- break;
- case 3:
- convertType=KCharacterSetIdentifierIso88593;
- break;
- case 4:
- convertType=KCharacterSetIdentifierIso88594;
- break;
- case 5:
- convertType=KCharacterSetIdentifierIso88595;
- break;
- case 6:
- convertType=KCharacterSetIdentifierIso88596;
- break;
- case 7:
- convertType=KCharacterSetIdentifierIso88597;
- break;
- case 8:
- convertType=KCharacterSetIdentifierIso88598;
- break;
- case 9:
- convertType=KCharacterSetIdentifierIso88599;
- break;
- case 0xFF:
- // Unicode, no conversion needed
- break;
- default:
- User::Leave(KErrGeneral);
- }
-
- if(convertType)
- {
- RFs fs;
- LEAVEIFERRORL(fs.Connect());
- CleanupClosePushL(fs);
- CCnvCharacterSetConverter* converter = CCnvCharacterSetConverter::NewLC();
- if (converter->PrepareToConvertToOrFromL(convertType, fs) != CCnvCharacterSetConverter::EAvailable)
- User::Leave(KErrGeneral);
-
- iRemoteRealm = HBufC::NewL(size);
- TPtr16 dest = iRemoteRealm->Des();
- TInt state=CCnvCharacterSetConverter::KStateDefault;
- TInt err = converter->ConvertToUnicode(dest, iRxChallenge->Mid(extractionPosn, size), state);
- if (err < 0)
- User::Leave(err);
- CleanupStack::PopAndDestroy(2); // fs, converter
- }
- else //can only be unicode
- { //if unicode
- FLOG(_L("CObex::ProcessChallenge incoming UNICODE Realm extracted\n\r"));
- size = size/2; //if it's UNICODE then should be an even number
- iRemoteRealm = HBufC::NewMaxL(size);
- TPtr16 dest = iRemoteRealm->Des();
- for ( TInt x = 0; x < size; x++ )
- dest[x] = LittleEndian::Get16((TUint8*)iRxChallenge->Ptr() + extractionPosn + (2*x));
- extractionPosn += size * 2;
- }
-
- }
- else
- {
- FLOG(_L("CObex::ProcessChallenge Incorrect Realm size\n\r"));
- exit = ETrue;
- }
- }
- break;
- default:
- {
- FLOG(_L("CObex::ProcessChallenge Unknown Tag type\n\r"));
- exit = ETrue;
- }
- break;
- }
- }
- if ( !nonceExtracted) //the nonce is mandatory so must exist
- {
- FLOG(_L("CObex::ProcessChallenge Nonce was not extracted\n\r"));
- exit = ETrue;
- }
- if ( exit )
- User::Leave(KErrGeneral);
- }
-
-
-/**
-Sets the authentication challenge handler.
-
-The caller must supply a MObexAuthChallengeHandler implementation to handle
-calls from the Server/Client for a request for a password.
-
-@param aCallBack Authentication challenge handler
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObex::SetCallBack(MObexAuthChallengeHandler& aCallBack)
- {
- LOG_LINE
- LOG_FUNC
-
- iCallBack = &aCallBack;
- }
-
-/**
-@internalTechnology
-
-This function is retained for backwards compatibility and should not be called.
-
-Calling this function has undefined behaviour.
-*/
-void CObex::Process(CObexPacket& aPacket)
- {
- NotifyProcess(aPacket);
- }
-
-/**
-@internalTechnology
-
-This function is retained for backwards compatibility and should not be called.
-
-Calling this function has undefined behaviour.
-*/
-void CObex::Error(TInt aError)
- {
- NotifyError(aError);
- }
-
-/**
-@internalTechnology
-
-This function is retained for backwards compatibility and should not be called.
-
-Calling this function has undefined behaviour.
-*/
-void CObex::TransportUp()
- {
- NotifyTransportUp();
- }
-
-/**
-@internalTechnology
-
-This function is retained for backwards compatibility and should not be called.
-Use ControlledTransportDown() or ForcedTransportDown() to disconnect the transport layer.
-Calling this function will result in an ETransportDownCalled panic.
-
-@panic ObexFault ETransportDownCalled
-@see ControlledTransportDown()
-@see ForcedTransportDown()
-*/
-void CObex::TransportDown(TBool)
- {
- IrOBEXUtil::Fault(ETransportDownCalled);
- }
-
-
-void CObex::NotifyProcess(CObexPacket& aPacket)
- {
- LOG2(_L8("Packet Received, opcode: 0x%2X, Length: %d"),
- aPacket.Opcode(), aPacket.PacketSize());
- FTRACE(aPacket.Dump());
- OnPacketReceive(aPacket);
- // The queuing of the next read packet varies between Server and Client
- // Client is done at the end of CObexClient::OnPacketReceive
- // Server is done once the write packet completes in CObexServer::SignalPacketProcessEvent
- // This is because the Server may be mid-way through an asynchronous operation after OnPacketReceive
- // so we have to keep the current read packet
- if ((GetConnectState() == EWaitForUserInput )&&(iCallBack))
- {
- TRAPD(err, iCallBack->GetUserPasswordL(iRemoteRealm ? static_cast(*iRemoteRealm) : KNullDesC()));
- if ( err )
- {
- Error(err);
- }
- }
- }
-
-void CObex::NotifyError(TInt aError)
- {
- LOG1(_L8("Error Called: %d"), aError);
-
- // This call has been moved to before ForcedTransportDown(), because it
- // needs to check whether the current operation is "disconnect" or
- // not, and ForcedTransportDown() sets it to "idle".
- OnError(aError);
-
- if(iConnectState >= EConnTransport)
- {
- ForcedTransportDown();
- }
- }
-
-void CObex::NotifyTransportUp()
- {
- FLOG(_L("CObex::NotifyTransportUp\n\r"));
- SetConnectState(EConnTransport);
- OnTransportUp();
- }
-
-void CObex::NotifyTransportDown(TBool)
- {
- IrOBEXUtil::Fault(ETransportDownCalled);
- }
-
-/**
-This function forces the transport to be taken down
-regardless of whether or not the underlying transport can recover without
-restarting obex applications
-However if the transport controller fails to bring the transport down, then only
-the obex connection is cancelled.
-This is called in error conditions
-
-@see ControlledTransportDown()
-@internalComponent
-*/
-void CObex::ForcedTransportDown()
- {
- // iTransportController must be valid for all the CObex life cycle
- __ASSERT_DEBUG(iTransportController, IrOBEXUtil::Fault(ETransportControllerNotCreated));
-
- if (iTransportController->BringTransportDown())
- {
- SetConnectState(EConnIdle);
- OnTransportDown();
- }
- else
- {
- //the transport failed to be taken down
- CancelObexConnection();
- }
- RemoteInfoCleanup();
- }
-
-/**
-This function will tear down the transport if the transport layer supports
-transport reconnection on obex reconnection
-This is called in conditions other than error conditions
-
-@see ForcedTransportDown()
-@internalComponent
-*/
-void CObex::ControlledTransportDown()
- {
- // iTransportController must be valid for all the CObex life cycle
- __ASSERT_DEBUG(iTransportController, IrOBEXUtil::Fault(ETransportControllerNotCreated));
-
- TBool canBringTransportDown = iTransportController->IsTransportRestartable();
- if (canBringTransportDown)
- {
- ForcedTransportDown();
- }
- else
- {
- CancelObexConnection();
- RemoteInfoCleanup();
- }
-
- }
-
-/**
-General cleanup of iRemoteInfo
-@internalComponent
-*/
-void CObex::RemoteInfoCleanup()
- {
- // Some general cleanup here.
- iRemoteInfo.iTargetHeader.SetLength(0);
- iRemoteInfo.iWho.SetLength(0);
- }
-
-/**
-Put into transport connected state but cancel any outstanding transfers and operations
-@internalComponent
-*/
-void CObex::CancelObexConnection()
- {
- // iTransportController must be valid for all the CObex life cycle
- __ASSERT_DEBUG(iTransportController, IrOBEXUtil::Fault(ETransportControllerNotCreated));
-
- iTransportController->CancelTransfers();
- SetConnectState(EConnTransport);
- iCurrentOperation = EOpIdle;
- }
-
-/**
-Change the state of the authentication state machine
-@param aNewState New state
-@internalComponent
-*/
-void CObex::SetConnectState(TConnectState aNewState)
- {
- switch(iConnectState = aNewState)
- {
- case EConnIdle:
- FLOG(_L("### Connection State EConnIdle\r\n"));
- break;
- case EConnTransport:
- FLOG(_L("###### Connection State EConnTransport\r\n"));
- break;
- case ESimpleConnRequest:
- FLOG(_L("######### Connection State ESimpleConnRequest\r\n"));
- break;
- case EConnObex:
- FLOG(_L("######### Connection State EConnObex\r\n"));
- break;
- case EConnChallRxed:
- FLOG(_L("######### Connection State EConnChallRxed\r\n"));
- break;
- case ESimpleConnChallIssued:
- FLOG(_L("######### Connection State ESimpleConnChallIssued\r\n"));
- break;
- case EChallConnRequested:
- FLOG(_L("######### Connection State EChallConnRequested\r\n"));
- break;
- case EChallConnChallIssued:
- FLOG(_L("######### Connection State EChallConnChallIssued\r\n"));
- break;
- case EWaitForFinalResponse:
- FLOG(_L("######### Connection State EWaitForFinalResponse\r\n"));
- break;
- case EFinalChallRxed:
- FLOG(_L("######### Connection State EConnChallReIssued\r\n"));
- break;
- case EDropLink:
- FLOG(_L("######### Connection State EDropLink\r\n"));
- break;
- default:
- break;
- }
- }
-
-// CObex::TSetPathInfo
-/**
-Constructor.
-
-This is the path information used in the SETPATH command.
-The variable iFlags is set to zero by default. The variable iConstants is always set to zero as this is a reserved
-varaible. The path name is NOT present by default.
-
-@publishedAll
-@released
-*/
-EXPORT_C CObex::TSetPathInfo::TSetPathInfo()
- {
- LOG_LINE
- LOG_FUNC
-
- iFlags = 0;
- iConstants = 0;
- iNamePresent = EFalse;
- }
-
-/**
-@internalComponent
-*/
-CObex::TSetPathInfo::TSetPathInfo(const TObexSetPathData& aData)
- : iFlags(aData.iFlags), iConstants(aData.iConstants), iNamePresent(EFalse)
- {
- }
-
-/**
-Returns true if the flags are set so that the receiver will backup a level before applying the path name
-
-@return ETrue if the flags are set so that the receiver will backup a level before applying the path name othewise EFalse.
-
-@publishedAll
-@released
-*/
-EXPORT_C TBool CObex::TSetPathInfo::Parent() const
- {
- LOG_LINE
- LOG_FUNC
-
- return(iFlags & KObexSetPathParent);
- }
-
-// CObex
-/**
-Returns ETrue if this CObex is connected at an OBEX level, merely having
-a transport connected does not satisfy this condition. I.e. the two devices
-must have completed the OBEX connection request/response . All other states
-return EFalse. This will be unreliable if either the server blindly
-returns the client’s who header (always reporting ETrue), or if neither
-supply "who" headers (always reporting EFalse).
-
-@return ETrue if this CObex is connected at an OBEX level. EFalse otherwise.
-@publishedAll
-@released
-*/
-EXPORT_C TBool CObex::IsConnected() const
- {
- LOG_LINE
- LOG_FUNC
-
- return(GetConnectState() == EConnObex);
- }
-
-/**
-@return ETrue if the "who" header specified in the server’s connect response
- matched that of the client’s connect request, and both had a length greater
- than 0 (i.e. both specified a "who" field). Undefined if IsConnected() == EFalse.
-
-@publishedAll
-@released
-*/
-EXPORT_C TBool CObex::IsStrictPeer() const
- {
- LOG_LINE
- LOG_FUNC
-
- return((iLocalInfo.iWho.Length()>0) && (iLocalInfo.iWho==iRemoteInfo.iWho));
- }
-
-/**
-Use this member to gain access to (and alter, if necessary) the
-CObex::TConnectInfo structure which will be sent to the OBEX peer as part
-of the connection process. Only alter the contents of this having read and
-understood the purpose of the fields, as defined in the OBEX spec. Altering
-this structure after a connection has been made will have no effect on the
-current session, but will be used for future connection attempts.
-
-@return The connect info which will be sent to the OBEX peer.
-@publishedAll
-@released
-*/
-EXPORT_C const TObexConnectInfo& CObex::LocalInfo() const
- {
- LOG_LINE
- LOG_FUNC
-
- return(iLocalInfo);
- }
-
-/**
-Use this member to read the details of the remote machine’s connection
-information, as specified by it in during OBEX connection. This data can
-not be altered, as this serves no purpose.
-The content of this structure is undefined when @see IsConnected () ==
-EFalse.
-
-@return The connect info from the remote machine.
-@publishedAll
-@released
-*/
-EXPORT_C const TObexConnectInfo& CObex::RemoteInfo() const
- {
- LOG_LINE
- LOG_FUNC
-
- return(iRemoteInfo);
- }
-
-/**
-This function is in the protected scope of CObex and so is not externally usable
-@publishedAll
-@released
-*/
-EXPORT_C CObex::TConnectState CObex::ConnectState() const
- {
- LOG_LINE
- LOG_FUNC
-
- // This function is exported but protected, making it not much use
- // Making it public, and exposing more information about the authentication
- // state machine is undesirable, but a public function is required for other
- // classes in the DLL. Thus another public, unexported function has been defined
- // on to which this function chains.
- return GetConnectState();
- };
-
-/**
-Get the current state of the authentication state machine
-@internalComponent
-*/
-CObex::TConnectState CObex::GetConnectState() const
- {
- LOG_LINE
- LOG_FUNC
-
- return iConnectState;
- };
-
-/**
-Must be called by an application that wishes to suppress the authentication or(not excusive) the realm of the authentication challenge
-@param aSuppressedObexAuthElements enum TObexSuppressedAuthElements to indicate which header elements to surpress (if any)
-@panic KErrArgument if invalid value is passed in for enum
-@publishedAll
-@released
-*/
-EXPORT_C void CObex::SuppressAuthenticationHeaderElements(TObexSuppressedAuthElements aSuppressedObexAuthElements)
- {
- LOG_LINE
- LOG_FUNC
-
- // If the value passed in is not a valid bitmask then panic
- _LIT(panicText, "Invalid bitmask passed to CObex::SuppressAuthenticationHeaderElements");
- __ASSERT_ALWAYS((!(aSuppressedObexAuthElements > EObexSuppressAllAuthElements)), User::Panic(panicText, KErrArgument));
-
- iSuppressedObexAuthElements = aSuppressedObexAuthElements;
-
- };
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/OBEXUTIL.CPP
--- a/obex/obexprotocol/obex/src/OBEXUTIL.CPP Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include "obexcommon.h"
-#include "OBEXUTIL.H"
-#include "obexfaults.h"
-
-
-void IrOBEXUtil::Panic(TObexPanicCode aCode)
- {
- User::Panic(KObexPanicCategory, aCode);
- }
-
-
-void IrOBEXUtil::Fault(TObexFaultCode aCode)
- {
- User::Panic(KObexFaultCategory, aCode);
- }
-
-/**
-Converts aResp to an EPOC error number
-*/
-TInt IrOBEXUtil::EpocError(TUint8 aResp)
- {
- switch (aResp)
- {
- case ERespContinue:
- case ERespSuccess:
- case ERespCreated:
- case ERespAccepted:
- return (KErrNone);
- case ERespBadRequest:
- case ERespUnauthorized:
- case ERespForbidden:
- case ERespNotAcceptable:
- case ERespMethodNotAllowed:
- return (KErrArgument);
- case ERespNotFound:
- return (KErrNotFound);
- case ERespTimedOut:
- return (KErrTimedOut);
- case ERespConflict:
- return (KErrInUse);
- case ERespNotImplemented:
- return (KErrNotSupported);
- default:
- return (KErrIrObexRespBase - aResp);
- }
- }
-
-/**
-Returns a TObexTransportInfo created from the received aObexProtocolInfoPtr and aObexProtocolPolicy
-to be used in the transport layer
-*/
-TObexTransportInfo* IrOBEXUtil::CreateTransportInfoL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy)
- {
- TObexTransportInfo* transportInfo = NULL;
-
- if ( aObexProtocolInfoPtr.iTransport == KObexIrTTPProtocol )
- {
- transportInfo = new(ELeave) TObexIrTransportInfo;
- TObexIrProtocolInfo& irProtocolInfo = static_cast(aObexProtocolInfoPtr);
- static_cast(transportInfo)->iAddr = irProtocolInfo.iAddr;
- static_cast(transportInfo)->iClassName = irProtocolInfo.iClassName;
- static_cast(transportInfo)->iAttributeName = irProtocolInfo.iAttributeName;
- }
- else if ( aObexProtocolInfoPtr.iTransport == KObexIrTTPProtocolV2 )
- {
- transportInfo = new(ELeave) TObexIrV2TransportInfo;
- TObexIrProtocolInfo& irProtocolInfo = static_cast(aObexProtocolInfoPtr);
- static_cast(transportInfo)->iAddr = irProtocolInfo.iAddr;
- static_cast(transportInfo)->iClassName = irProtocolInfo.iClassName;
- static_cast(transportInfo)->iAttributeName = irProtocolInfo.iAttributeName;
- static_cast(transportInfo)->iDiscoverySlots = irProtocolInfo.iDiscoverySlots;
- static_cast(transportInfo)->iDiscoveryAttempts = irProtocolInfo.iDiscoveryAttempts;
- }
- else if ( aObexProtocolInfoPtr.iTransport == KObexRfcommProtocol )
- {
- transportInfo = new(ELeave) TObexBtTransportInfo;
- TObexBluetoothProtocolInfo& btProtocolInfo = static_cast(aObexProtocolInfoPtr);
- static_cast(transportInfo)->iAddr = btProtocolInfo.iAddr;
- }
-#ifdef __WINS__
- else if ( aObexProtocolInfoPtr.iTransport == KObexUsbProtocol || aObexProtocolInfoPtr.iTransport == KObexWin32UsbProtocol )
-#else
- else if ( aObexProtocolInfoPtr.iTransport == KObexUsbProtocol)
-#endif
- {
- transportInfo = new(ELeave) TObexUsbTransportInfo();
- TObexUsbProtocolInfo& usbTransportInfo = static_cast(aObexProtocolInfoPtr);
- static_cast(transportInfo)->iInterfaceStringDescriptor = usbTransportInfo.iInterfaceStringDescriptor;
- }
- else if ( aObexProtocolInfoPtr.iTransport == KObexUsbProtocolV2 )
- {
- transportInfo = new(ELeave) TObexUsbV2TransportInfo();
- TObexUsbProtocolInfoV2& usbV2TransportInfo = static_cast(aObexProtocolInfoPtr);
- static_cast(transportInfo)->iInterfaceStringDescriptor = usbV2TransportInfo.iInterfaceStringDescriptor;
- static_cast(transportInfo)->iBandwidthPriority = usbV2TransportInfo.iBandwidthPriority;
- static_cast(transportInfo)->iDmaOnOutEndpoint = usbV2TransportInfo.iDmaOnOutEndpoint;
- static_cast(transportInfo)->iDmaOnInEndpoint = usbV2TransportInfo.iDmaOnInEndpoint;
- }
-
- __ASSERT_DEBUG(transportInfo, Fault(EUtilNoTransportInfo));
- transportInfo->iTransportName = aObexProtocolInfoPtr.iTransport;
- transportInfo->iReceiveMtu = aObexProtocolPolicy.ReceiveMtu();
- transportInfo->iTransmitMtu = aObexProtocolPolicy.TransmitMtu();
- transportInfo->iVersion = KObexTransportInfoVersion0;
- return transportInfo;
- }
-
-/**
-Converts aErr to an obex response.
-
-@return aDefault if aErr == KErrNone, else the appriate obex response
-*/
-TObexResponse IrOBEXUtil::ObexResponse (TInt aErr, TObexResponse aDefault)
- {
- switch (aErr)
- {
- case KErrNone:
- return (aDefault);
- case KErrNotFound:
- case KErrPathNotFound:
- case KErrUnknown:
- case KErrBadName:
- return (ERespNotFound);
- case KErrNotSupported:
- return (ERespNotImplemented);
- case KErrAlreadyExists:
- case KErrInUse:
- return (ERespConflict);
- case KErrAccessDenied:
- return (ERespUnauthorized);
- case KErrLocked:
- return (ERespForbidden);
- case KErrTimedOut:
- return (ERespTimedOut);
- default:
- {
- //check if it's one of the Symbian codes which has been set aside for
- //mapping to an official OBEX code
- //unfortunately these are not continuous and exist in 4 discrete blocks
-
- if (( (aErr <= KErrIrObexRespSuccess ) && (aErr >= KErrIrObexRespPartialContent))
- ||( (aErr <=KErrIrObexRespMultipleChoices) && (aErr >= KErrIrObexRespUseProxy))
- ||( (aErr<=KErrIrObexRespBadRequest) && (aErr>=KErrIrObexRespHTTPVerNotSupp) )
- ||( (aErr <= KErrIrObexRespDatabaseFull) && (aErr >= KErrIrObexRespDatabaseLocked)))
- {
-
-
- TInt err = aErr * -1;
-
- err += KErrIrObexRespBase;
-
-
-
- return ( static_cast(err) );
-
- }
- //in all other cases the error code isn't understood
- return (ERespInternalError);
- }
- }
- }
-
-//
-// End of file
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerOperationState.cpp
--- a/obex/obexprotocol/obex/src/TObexServerOperationState.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,253 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-
-#include
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-*/
-
-/**
-Called by the state machine when it has moved into the state
-Default action - do nothing and return no error
-@param aContext Reference to state machine object
-*/
-void TObexServerOperationState::Entry(CObexServerStateMachine& /*aContext*/)
- {
- }
-
-/**
-Connection packet to be processed
-Default action - fault (event should not happen for this state)
-@param aContext Reference to state machine object
-@param aPacket Connect packet
-*/
-void TObexServerOperationState::Connect(CObexServerStateMachine& /*aContext*/, CObexPacket& /*aPacket*/)
- {
- IrOBEXUtil::Fault(EConnectInBadState);
- }
-
-/**
-Disconnect packet to be processed
-Default action - fault (event should not happen for this state)
-@param aContext Reference to state machine object
-@param aPacket Disconnect packet
-*/
-void TObexServerOperationState::Disconnect(CObexServerStateMachine& /*aContext*/, CObexPacket& /*aPacket*/)
- {
- IrOBEXUtil::Fault(EDisconnectInBadState);
- }
-
-/**
-Put packet to be processed
-Default action - fault (event should not happen for this state)
-@param aContext Reference to state machine object
-@param aPacket Put packet
-*/
-void TObexServerOperationState::Put(CObexServerStateMachine& /*aContext*/, CObexPacket& /*aPacket*/)
- {
- IrOBEXUtil::Fault(EPutInBadState);
- }
-
-/**
-Get packet to be processed
-Default action - fault (event should not happen for this state)
-@param aContext Reference to state machine object
-@param aPacket Get packet
-*/
-void TObexServerOperationState::Get(CObexServerStateMachine& /*aContext*/, CObexPacket& /*aPacket*/)
- {
- IrOBEXUtil::Fault(EGetInBadState);
- }
-
-/**
-SetPath packet to be processed
-Default action - fault (event should not happen for this state)
-@param aContext Reference to state machine object
-@param aPacket SetPath packet
-*/
-void TObexServerOperationState::SetPath(CObexServerStateMachine& /*aContext*/, CObexPacket& /*aPacket*/)
- {
- IrOBEXUtil::Fault(ESetPathInBadState);
- }
-
-/**
-Abort request to be processed
-Default action - fault (event should not happen for this state)
-@param aContext Reference to state machine object
-*/
-void TObexServerOperationState::Abort(CObexServerStateMachine& /*aContext*/)
- {
- IrOBEXUtil::Fault(EAbortInBadState);
- }
-
-/**
-Transport up notification
-Default action - do nothing or fault (event should not happen for this state)
-@param aContext Reference to state machine object
-*/
-void TObexServerOperationState::TransportUp(CObexServerStateMachine& /*aContext*/)
- {
- __ASSERT_DEBUG(EFalse, IrOBEXUtil::Fault(ETransportUpInBadState));
- }
-
-/**
-Server Start notification
-Default action - do nothing and return no error
-@param aContext Reference to state machine object
-*/
-void TObexServerOperationState::Start(CObexServerStateMachine& /*aContext*/)
- {
- }
-
-/**
-Reset notification - state machine should go back to the initial (disconnected) state
-Default action - change to Disconnected state
-@param aContext Reference to state machine object
-*/
-void TObexServerOperationState::Reset(CObexServerStateMachine& aContext)
- {
- aContext.ChangeState(CObexServerStateMachine::EDisconnected);
- }
-
-/**
-Asynchronous notification complete - the Application has return an object for the current operation
-Default action - panic as there is no operation waiting for a notification
-@param aContext Reference to state machine object
-@param aObject Pointer to object returned from the Application
-@panic ENoNotificationToComplete
-*/
-void TObexServerOperationState::RequestNotificationCompleted(CObexServerStateMachine& /*aContext*/, CObexBaseObject* /*aObject*/)
- {
- IrOBEXUtil::Panic(ENoNotificationToComplete);
- }
-
-/**
-Asynchronous notification complete - the Application has return an object for the current operation
-Default action - panic as there is no operation waiting for a notification
-@param aContext Reference to state machine object
-@param aObject Pointer to object returned from the Application
-@panic ENoNotificationToComplete
-*/
-void TObexServerOperationState::RequestNotificationCompleted(CObexServerStateMachine& /*aContext*/, TObexResponse /*aAppResponse*/)
- {
- IrOBEXUtil::Panic(ENoNotificationToComplete);
- }
-
-/**
-Asynchronous notification complete - the Application has return an object for the current operation
-Default action - panic as there is no operation waiting for a notification
-@param aContext Reference to state machine object
-@param aObject Pointer to object returned from the Application
-@panic ENoNotificationToComplete
-*/
-void TObexServerOperationState::RequestCompleteNotificationCompleted(CObexServerStateMachine& /*aContext*/, TObexResponse /*aAppResponse*/)
- {
- IrOBEXUtil::Panic(ENoNotificationToComplete);
- }
-
-
-/**
-Connection notification - an OBEX connection has been made
-Default action - panic. This should not be passed to the state machine in this state.
-@param aContext Reference to state machine object
-*/
-void TObexServerOperationState::ConnectionComplete(CObexServerStateMachine& /*aContext*/)
- {
- IrOBEXUtil::Fault(EConnectionCompleteInBadState);
- }
-
-/**
-A user has requested to override the handling of a request packet.
-@param aContext Reference to state machine object
-@param aResponse Response code to send to Obex Client (this must not be a success code)
-*/
-void TObexServerOperationState::OverrideRequestHandling(CObexServerStateMachine& /*aContext*/, TObexResponse /*aResponse*/)
- {
- IrOBEXUtil::Panic(EOverrideRequestHandlingInBadState);
- }
-
-// Utility functions - common operations performed by states
-
-/**
-Check disconnect packet for the correct connection ID (if required) and disconnect the Client
-If the check is not sucessful, return to the Idle state if there is an OBEX connection
-or the TransportConnected state otherwise
-@param aContext Reference to state machine object
-@param aPacket Disconnect packet
-*/
-/*static*/ void TObexServerOperationState::PerformDisconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- FLOG(_L("OnPacketReceive DisConnect OP code\r\n"));
- aContext.Owner().SetCurrentOperation(CObex::EOpDisconnect);
-
- // Check for connection ID before performing disconnect
- if (aContext.Owner().CheckPacketForConnectionId(aPacket))
- {
- aContext.Transport().Send(ERespSuccess);
- aContext.ChangeState(CObexServerStateMachine::EDisconnecting);
- }
- else
- {
- // Incorrect connection ID - abandon current operation
- aContext.Transport().Send(ERespServiceUnavailable);
- // Target states depends on whether there is a current OBEX connection
- if (aContext.Owner().GetConnectState() == CObex::EConnObex)
- {
- aContext.ChangeState(CObexServerStateMachine::EReady);
- }
- else
- {
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- }
- }
- }
-
-/**
-End the current operation, sending the given response code to the Client and moving to the Idle state
-@panic ObexFault ERespondAndEndOpWithoutObexConnection if there is no OBEX connection
-@param aContext Reference to state machine object
-@param aResponseCode Response code to send to the Client
-*/
-/*static*/ void TObexServerOperationState::RespondAndEndOperation(CObexServerStateMachine& aContext, TObexResponse aResponseCode)
- {
- // This function assumes that there is an OBEX connection, so it goes back to EReady - the assert checks this
- __ASSERT_DEBUG((aContext.Owner().GetConnectState() == CObex::EConnObex),IrOBEXUtil::Fault(ERespondAndEndOpWithoutObexConnection));
-
- aContext.Transport().Send(aResponseCode);
- aContext.ChangeState(CObexServerStateMachine::EReady);
- }
-
-TBool TObexServerOperationState::ValidResponse(TObexResponse /*aResponseCode*/)
- {
- return EFalse;
- }
-
-void TObexServerOperationState::WriteComplete(CObexServerStateMachine& /*aContext*/)
- {
- }
-
-/**
-Indicates that a new obex packet is being read. Do nothing in default state.
-*/
-void TObexServerOperationState::ReadActivityDetected(CObexServerStateMachine& /*aContext*/)
- {
- }
-
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateDisconnected.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateDisconnected.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-Disconnected State
-This is the ground state for the machine: transport is disconnected, operation is EOpIdle
-Machine will move to TransportConnnected state on receiving a TransportUp
-*/
-
-TObexServerStateDisconnected::TObexServerStateDisconnected()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "Disconnected");
- iName = KName;
-#endif
- }
-
-void TObexServerStateDisconnected::Entry(CObexServerStateMachine& aContext)
- {
- aContext.Owner().SetCurrentOperation(CObex::EOpIdle);
- }
-
-void TObexServerStateDisconnected::TransportUp(CObexServerStateMachine& aContext)
- {
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- }
-
-void TObexServerStateDisconnected::Reset(CObexServerStateMachine& /*aContext*/)
- {
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateDisconnecting.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateDisconnecting.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-#if ( defined __FLOG_ACTIVE && defined __LOG_FUNCTIONS__ )
-_LIT8(KLogComponent, "OBEX");
-#endif
-
-/**
-@file
-@internalComponent
-
-Disconnecting State
-In this state, the server has received a (correctly-addressed) disconnect
-request from the client, and placed an asynchronous request on the transport
-to ACK it.
-This state is interested in the completion of that send request so it can (a)
-complete the client's notifications, (b) move to 'transport connected' state
-and (c) pull down the transport.
-*/
-
-TObexServerStateDisconnecting::TObexServerStateDisconnecting()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "Disconnecting");
- iName = KName;
-#endif
- }
-
-void TObexServerStateDisconnecting::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexBadEvent);
- }
-
-void TObexServerStateDisconnecting::Disconnect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexBadEvent);
- }
-
-void TObexServerStateDisconnecting::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexBadEvent);
- }
-
-void TObexServerStateDisconnecting::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexBadEvent);
- }
-
-void TObexServerStateDisconnecting::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexBadEvent);
- }
-
-void TObexServerStateDisconnecting::Abort(CObexServerStateMachine& aContext)
- {
- aContext.Owner().Error(KErrIrObexBadEvent);
- }
-
-void TObexServerStateDisconnecting::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse /*aResponse*/)
- {
- aContext.Owner().Error(KErrIrObexBadEvent);
- }
-
-void TObexServerStateDisconnecting::WriteComplete(CObexServerStateMachine& aContext)
- {
- LOG_FUNC
-
- aContext.Notification().ObexDisconnectIndication(KNullDesC8);
- // ControlledTransportDown() may raise a TransportDown event immediately,
- // re-entering the state machine, so we need to be in the correct state
- // (TransportConnected) before the call.
- // Also need to keep current operation == EOpDisconnect until transport is
- // happy (which is done in CObex) so ETransportConnected does not set
- // iCurrentOperation to EOpIdle.
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- aContext.ControlledTransportDown();
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateGetOpFinal.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateGetOpFinal.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,120 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-Final Get Operation Receive State
-Waiting for reply from server app to an async notification GetCompleteIndication
-
-Any OBEX operation will cause a Protocol Error
-Chaging the MObexServerNotifyAsync via CObexServer::Start() will cause a Panic
-A Reset event (Protocol Error, Server Stop, Transport Down) will cancel the notification and move the machine to Disconnected
-The NotificationComplete event send the response back to the client and move the state machine to Ready
-*/
-
-TObexServerStateGetOpFinal::TObexServerStateGetOpFinal()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "GetOpFinal");
- iName = KName;
-#endif
- }
-
-void TObexServerStateGetOpFinal::Entry(CObexServerStateMachine& aContext)
- {
- aContext.Notification().GetCompleteIndication();
- }
-
-void TObexServerStateGetOpFinal::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpFinal::Disconnect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpFinal::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpFinal::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpFinal::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpFinal::Abort(CObexServerStateMachine& aContext)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpFinal::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse /*aResponse*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpFinal::Reset(CObexServerStateMachine& aContext)
- {
- // Cancel notification - if it has not already been activated
- if (!aContext.IsCallBackActive())
- {
- aContext.Notification().CancelIndicationCallback();
- }
- aContext.CancelCallBack();
- aContext.ChangeState(CObexServerStateMachine::EDisconnected);
- }
-
-void TObexServerStateGetOpFinal::Start(CObexServerStateMachine& /*aContext*/)
- {
- // Panic - trying to change interface during wait
- IrOBEXUtil::Panic(EChangeInterfaceDuringWait);
- }
-
-void TObexServerStateGetOpFinal::RequestCompleteNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse)
- {
- aContext.SetAppResponse(aAppResponse);
- aContext.CallBack(TObexServerStateGetOpFinal::ProcessNotification);
- }
-
-TInt TObexServerStateGetOpFinal::ProcessNotification(TAny* aPtr)
- {
- CObexServerStateMachine& context = *static_cast(aPtr);
-
- context.Transport().SendPacket().SetOpcode(context.AppResponse());
- context.Transport().SendPacket().SetFinal();
- context.Transport().Send();
-
- context.ChangeState(CObexServerStateMachine::EReady);
- return KErrNone;
- }
-
-TBool TObexServerStateGetOpFinal::ValidResponse(TObexResponse aResponseCode)
- {
- return (aResponseCode>0 && aResponseCode<=255 && aResponseCode != ERespContinue);
- }
-
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateGetOpReceiveSpecification.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateGetOpReceiveSpecification.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,107 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-GET Operation Receive Specification State
-This state receives the specification object from the client and transfers to GetOpWaitForUser once the object is received
-A GET, DISCONNECT or ABORT will be processed
-Any other OBEX operation will be answered with an OBEX error code
-*/
-
-TObexServerStateGetOpReceiveSpecification::TObexServerStateGetOpReceiveSpecification()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "GetOpReceiveSpecification");
- iName = KName;
-#endif
- }
-
-void TObexServerStateGetOpReceiveSpecification::Entry(CObexServerStateMachine& aContext)
- {
- // Reset specification object
- if(aContext.SpecObject()->InitReceive() != KErrNone)
- {
- aContext.Transport().Send(ERespInternalError);
- return;
- }
- aContext.Owner().SetCurrentOperation(CObex::EOpGet);
- // Chain on to Get to start receiving specification
- Get(aContext, aContext.LastReceivedPacket());
- }
-
-void TObexServerStateGetOpReceiveSpecification::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict and return to Ready
- RespondAndEndOperation(aContext, ERespConflict);
- }
-
-void TObexServerStateGetOpReceiveSpecification::Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- // Process disconnect
- PerformDisconnect(aContext, aPacket);
- }
-
-void TObexServerStateGetOpReceiveSpecification::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespBadRequest and return to Ready
- RespondAndEndOperation(aContext, ERespBadRequest);
- }
-
-void TObexServerStateGetOpReceiveSpecification::Get(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- // Process packet and see if specification is complete
- // Packet contains more headers describing the object to be 'got'
- if(aContext.SpecObject()->ParseNextReceivePacket(aPacket) == CObexBaseObject::EError)
- {
- aContext.Transport().Send(aContext.SpecObject()->GetLastError());
- aContext.ChangeState(CObexServerStateMachine::EReady);
- return;
- }
-
- if(aPacket.IsFinal())
- {// Time to turn around and start sending our reply
- aContext.ChangeState(CObexServerStateMachine::EGetOpWaitForUser);
- }
- else
- {
- aContext.Transport().Send(ERespContinue);
- }
- }
-
-void TObexServerStateGetOpReceiveSpecification::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict and return to Ready
- RespondAndEndOperation(aContext, ERespConflict);
- }
-
-void TObexServerStateGetOpReceiveSpecification::Abort(CObexServerStateMachine& aContext)
- {
- // Send ERespSuccess and return to Ready
- aContext.Notification().AbortIndication();
- RespondAndEndOperation(aContext, ERespSuccess);
- }
-
-void TObexServerStateGetOpReceiveSpecification::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse)
- {
- // Send server app response and return to Ready
- RespondAndEndOperation(aContext, aResponse);
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateGetOpSendObject.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateGetOpSendObject.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,108 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-GET Operation Send State
-This state sends the object to the client and transfers to Ready once the exchange is finished
-A GET, DISCONNECT or ABORT will be processed
-Any other OBEX operation will be answered with an OBEX error code
-*/
-
-TObexServerStateGetOpSendObject::TObexServerStateGetOpSendObject()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "GetOpSendObject");
- iName = KName;
-#endif
- }
-
-void TObexServerStateGetOpSendObject::Entry(CObexServerStateMachine& aContext)
- {
- // Chain on to Get() to start sending object
- Get(aContext, aContext.LastReceivedPacket());
- }
-
-void TObexServerStateGetOpSendObject::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict and return to Ready
- RespondAndEndOperation(aContext, ERespConflict);
- }
-
-void TObexServerStateGetOpSendObject::Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- // Process disconnect
- PerformDisconnect(aContext, aPacket);
- }
-
-void TObexServerStateGetOpSendObject::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespBadRequest and return to Ready
- RespondAndEndOperation(aContext, ERespBadRequest);
- }
-
-void TObexServerStateGetOpSendObject::Get(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- if(!aPacket.IsFinal())
- {
- // Raising a Protocol Error will cause a Reset event resulting in a move to Disconnected.
- // So any code after this call will potentially be executed in a different state
- aContext.Owner().Error(KErrCommsOverrun);
- return;
- }
-
- // This section prepares the next packet to send, if an error is detected or it is the final packet
- // the machine is moved to EReady.
- TInt err = KErrGeneral;
- if(aContext.TransObject()->PrepareNextSendPacket(aContext.Transport().SendPacket()) == CObexBaseObject::EError ||
- (err = aContext.Notification().GetPacketIndication()) != KErrNone)
- {
- aContext.Transport().SendPacket().Init(IrOBEXUtil::ObexResponse(err, ERespInternalError));
- aContext.ChangeState(CObexServerStateMachine::EReady);
- }
- else if(aContext.Transport().SendPacket().IsFinal())
- {// This is the last packet of the object being returned to client
- aContext.ChangeState(CObexServerStateMachine::EGetOpFinal);
- return;
- }
- // Send the resultant packet
- aContext.Transport().SendPacket().SetFinal();
- aContext.Transport().Send();
- }
-
-void TObexServerStateGetOpSendObject::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict and return to Ready
- RespondAndEndOperation(aContext, ERespConflict);
- }
-
-void TObexServerStateGetOpSendObject::Abort(CObexServerStateMachine& aContext)
- {
- // Send ERespSuccess and return to Ready
- aContext.Notification().AbortIndication();
- RespondAndEndOperation(aContext, ERespSuccess);
- }
-
-void TObexServerStateGetOpSendObject::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse)
- {
- // Send server app response and return to Ready
- RespondAndEndOperation(aContext, aResponse);
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateGetOpWaitForUser.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateGetOpWaitForUser.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-GET Operation Wait State
-This state issues the Get indication to the Application on entry and then waits for the response.
-
-Any OBEX operation will be cause a Protocol Error
-Chaging the MObexServerNotifyAsync via CObexServer::Start() will cause a Panic
-A Reset event (Protocol Error, Server Stop, Transport Down) will cancel the notification and move the machine to Disconnected
-The NotificationComplete event will queue a async one-shot to process the returned object, moving the machine to GetOpSendObject
-*/
-
-#ifdef __FLOG_ACTIVE
-_LIT8(KGetWaitCmpt, "getwait");
-
-#define GETWAIT_LOG(str) CObexLog::Write(KGetWaitCmpt, str)
-#else
-#define GETWAIT_LOG(str)
-#endif
-
-
-TObexServerStateGetOpWaitForUser::TObexServerStateGetOpWaitForUser()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "GetOpWaitForUser");
- iName = KName;
-#endif
- }
-
-void TObexServerStateGetOpWaitForUser::Entry(CObexServerStateMachine& aContext)
- {
- // Send notification to the Application
- aContext.SetTransObject(NULL);
-
- GETWAIT_LOG(_L8("Upcalling..."));
- aContext.Notification().GetRequestIndication(aContext.SpecObject());
- }
-
-void TObexServerStateGetOpWaitForUser::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpWaitForUser::Disconnect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpWaitForUser::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpWaitForUser::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpWaitForUser::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpWaitForUser::Abort(CObexServerStateMachine& aContext)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpWaitForUser::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse /*aResponse*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateGetOpWaitForUser::Start(CObexServerStateMachine& /*aContext*/)
- {
- // Panic - trying to change interface during wait
- IrOBEXUtil::Panic(EChangeInterfaceDuringWait);
- }
-
-void TObexServerStateGetOpWaitForUser::Reset(CObexServerStateMachine& aContext)
- {
- // Cancel notification - if it has not already been activated
- if (!aContext.IsCallBackActive())
- {
- aContext.Notification().CancelIndicationCallback();
- }
- aContext.CancelCallBack();
- aContext.ChangeState(CObexServerStateMachine::EDisconnected);
- }
-
-void TObexServerStateGetOpWaitForUser::RequestNotificationCompleted(CObexServerStateMachine& aContext, CObexBaseObject* aObject)
- {
- aContext.SetTransObject(aObject);
- aContext.CallBack(TObexServerStateGetOpWaitForUser::ProcessNotification);
- }
-
-void TObexServerStateGetOpWaitForUser::RequestNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse)
- {
- aContext.SetAppResponse(aAppResponse);
- aContext.CallBack(TObexServerStateGetOpWaitForUser::ProcessErrorNotification);
- }
-
-/*static*/ TInt TObexServerStateGetOpWaitForUser::ProcessNotification(TAny* aPtr)
- {
- // Get hold of the Context and the returned object
- CObexServerStateMachine& context = *static_cast(aPtr);
-
- GETWAIT_LOG(_L8("Process notification"));
- CObexBaseObject* object = context.TransObject();
-
- //Check and initialise object, move to GetOpSendObject
- if (!object)
- {
- RespondAndEndOperation(context, ERespForbidden);
- }
- else if (object->InitSend(ERespContinue) != KErrNone)
- {
- RespondAndEndOperation(context, ERespInternalError);
- }
- else
- {
- //ConnectionID is compulsory if Target header was used at connection
- if ( context.Owner().CheckObjectForConnectionId(*(context.SpecObject())))
- {
- context.ChangeState(CObexServerStateMachine::EGetOpSendObject);
- }
- else //connectionID was incorrect or not received
- {
- context.Transport().Send(ERespServiceUnavailable);
- }
- }
- return KErrNone;
- }
-
-/*static*/ TInt TObexServerStateGetOpWaitForUser::ProcessErrorNotification(TAny* aPtr)
- {
- // Get hold of the Context and the returned object
- CObexServerStateMachine& context = *static_cast(aPtr);
-
- RespondAndEndOperation(context, context.AppResponse());
-
- return KErrNone;
- }
-
-TBool TObexServerStateGetOpWaitForUser::ValidResponse(TObexResponse aResponseCode)
- {
- return (aResponseCode>0 && aResponseCode<=255 && aResponseCode != ERespContinue &&
- aResponseCode != ERespSuccess && aResponseCode != ERespCreated && aResponseCode != ERespAccepted);
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateObexConnecting.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateObexConnecting.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,178 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-OBEX Connecting State
-This state is entered during an OBEX connection attempt. The authentication state machine is
-invoked via ParseConnectPacket and PrepareConnect packet.
-A successful CONNECT will move the machine to Ready.
-A CONNECT requiring a user password will move the machine to WaitForUserPassword
-Other CONNECT results may stay in this state or move the machine to TransportConnected
-A DISCONNECT will be processed
-An ABORT will cause a Protocol Error
-Any other OBEX operation will be answered with an OBEX error code
-*/
-
-TObexServerStateObexConnecting::TObexServerStateObexConnecting()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "ObexConnecting");
- iName = KName;
-#endif
- }
-
-void TObexServerStateObexConnecting::Entry(CObexServerStateMachine& aContext)
- {
- // Reset the Connect State Machine
- aContext.Owner().SetConnectState(CObex::EConnTransport);
- // Chain on to Connect to process packet
- Connect(aContext, aContext.LastReceivedPacket());
- }
-
-void TObexServerStateObexConnecting::Connect(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- // Process connect packet
- // This will return KErrNone if the packet is OK
- // a positive number if an OBEX error should be returned to the Client
- // a negative number if a Symbian error should be raised (as a Protocol Error)
- TInt parseConnectResult = aContext.Owner().ParseConnectPacket(aPacket);
- if (parseConnectResult == KErrNone)
- {
- FLOG(_L("OnPacketReceive ParseConnectPacket succesfull\r\n"));
- aContext.Transport().SendPacket().Init(CObex::EOpConnect);
- // PrepareConnectPacket will check the present state and request
- // Auth, or check Auth as necessary and will return:
- // An error & connect state set to EWaitForUserInput if a User Password is required
- // No error and connect state set to EConnObex if the connection was successful
- // Connect state set to EConnTransport if there is an error packet to send back to the client
- // Other connect states will return a packet to send and stay in the current state
- TInt err = aContext.Owner().PrepareConnectPacket(aContext.Transport().SendPacket());
- if ((err == KErrNone) || (aContext.Owner().GetConnectState() == CObex::EConnTransport)
- || (aContext.Owner().GetConnectState() == CObex::EWaitForUserInput))
- {
- FLOG(_L("OnPacketReceive PrepareConnectPacket SUCCESS\r\n"));
- // If not waiting for user input, send the resultant packet
- if ( aContext.Owner().GetConnectState() != CObex::EWaitForUserInput )
- {
- aContext.Transport().SendPacket().SetFinal();
- aContext.Transport().Send();
- }
- // Move this (operation) state machine according to result of authentication state machine
- switch (aContext.Owner().GetConnectState())
- {
- case CObex::EConnTransport:
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- break;
- case CObex::EConnObex:
- aContext.ChangeState(CObexServerStateMachine::EReady);
- break;
- case CObex::EWaitForUserInput:
- aContext.ChangeState(CObexServerStateMachine::EWaitForUserPassword);
- break;
- }
- }
- else
- {
- FTRACE( if (err)
- {
- FPrint(_L("OnPacketReceive PrepareConnectPacket FAILED"));
- }
- else
- {
- FPrint(_L("OnPacketReceive PrepareConnectPacket OK but state is %d"), aContext.Owner().GetConnectState());
- }
- );
- // Raising a Protocol Error will cause a Reset event resulting in a move to Disconnected.
- // So any code after this call will potentially be executed in a different state.
- aContext.Owner().Error(err);
- }
- }
- else if (parseConnectResult > 0) // so it's an OBEX error code
- {
- FLOG(_L("OnPacketReceive ParseConnectPacket FAILED (OBEX error)\r\n"));
-
- aContext.Transport().SendPacket().Init(parseConnectResult);
- TInt rsp = aContext.Owner().PrepareErroredConnectPacket(aContext.Transport().SendPacket());
- if (rsp == KErrNone)
- {
- aContext.Transport().SendPacket().SetFinal();
- aContext.Transport().Send();
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- }
- else
- {
- aContext.Owner().Error(rsp);
- }
- }
- else // parseConnectResult < 0 so it's a Symbian error code
- {
- FLOG(_L("OnPacketReceive ParseConnectPacket FAILED (Symbian error)\r\n"));
- // Raising a Protocol Error will cause a Reset event resulting in a move to Disconnected.
- // So any code after this call will potentially be executed in a different state.
- aContext.Owner().Error(KErrAbort);
- }
- }
-
-void TObexServerStateObexConnecting::Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- // Process disconnect
- PerformDisconnect(aContext, aPacket);
- }
-
-void TObexServerStateObexConnecting::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespBadRequest and return to ETransportConnected
- aContext.Transport().Send(ERespBadRequest);
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- }
-
-void TObexServerStateObexConnecting::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict and return to ETransportConnected
- aContext.Transport().Send(ERespConflict);
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- }
-
-void TObexServerStateObexConnecting::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict and return to ETransportConnected
- aContext.Transport().Send(ERespConflict);
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- }
-
-void TObexServerStateObexConnecting::Abort(CObexServerStateMachine& aContext)
- {
- // Send ERespSuccess
- // Any other response would, according to the spec,
- // require the Obex client to bring down the transport.
- // Our attempt is to be resilient if an 'Abort'
- // is sent erroneously whilst we are in this state.
- aContext.Transport().Send(ERespSuccess);
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- }
-
-void TObexServerStateObexConnecting::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse)
- {
- // Send the server applications response and return to Transport Connected
- aContext.Transport().Send(aResponse);
- aContext.ChangeState(CObexServerStateMachine::ETransportConnected);
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStatePutOpFinal.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStatePutOpFinal.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,169 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-Final PUT Operation Receive State
-Waiting for reply from server app to an async notification PutCompleteIndication
-
-Any OBEX operation will cause a Protocol Error
-Chaging the MObexServerNotifyAsync via CObexServer::Start() will cause a Panic
-A Reset event (Protocol Error, Server Stop, Transport Down) will cancel the notification and move the machine to Disconnected
-The NotificationComplete event send the response back to the client and mvoe the state machine to Ready
-*/
-
-TObexServerStatePutOpFinal::TObexServerStatePutOpFinal()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "PutOpFinalPut");
- iName = KName;
-#endif
- }
-
-void TObexServerStatePutOpFinal::Entry(CObexServerStateMachine& aContext)
- {
- // Chain on to Put() to start receiving object
- //return Put(aContext, aContext.LastReceivedPacket());
- aContext.Notification().PutCompleteIndication();
- }
-
-void TObexServerStatePutOpFinal::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpFinal::Disconnect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpFinal::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpFinal::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpFinal::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpFinal::Abort(CObexServerStateMachine& aContext)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpFinal::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse /*aResponse*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpFinal::Start(CObexServerStateMachine& /*aContext*/)
- {
- // Panic - trying to change interface during wait
- IrOBEXUtil::Panic(EChangeInterfaceDuringWait);
- }
-
-// Utility function to handle the optional header set to send at the completion of the Put
-void TObexServerStatePutOpFinal::PrepareFinalResponseHeaderSet(CObexHeader* aHeader, CObexHeaderSet& aHeaderSet, CObexPacket& aPacket)
- {
- // We have some additional headers to send, on a best effort
- // basis...
- TObexInternalHeader intHeader;
- aHeaderSet.First();
- TBool insertedOK=ETrue;
-
- while(insertedOK && (aHeaderSet.This(aHeader)==KErrNone))
- {
- switch(aHeader->Type())
- {
- case CObexHeader::EUnicode:
- intHeader.Set(aHeader->HI(), aHeader->AsUnicode());
- break;
-
- case CObexHeader::EByteSeq:
- intHeader.Set(aHeader->HI(), (const_cast ((aHeader->AsByteSeq()).Ptr())), (aHeader->AsByteSeq()).Size());
- break;
-
- case CObexHeader::EByte:
- intHeader.Set(aHeader->HI(), aHeader->AsByte());
- break;
-
- case CObexHeader::EFourByte:
- intHeader.Set(aHeader->HI(), aHeader->AsFourByte());
- break;
- }
-
- insertedOK=aPacket.InsertData(intHeader);
-
- (void)aHeaderSet.Next();
- }
- }
-
-void TObexServerStatePutOpFinal::Reset(CObexServerStateMachine& aContext)
- {
- // Cancel notification - if it has not already been activated
- if (!aContext.IsCallBackActive())
- {
- aContext.Notification().CancelIndicationCallback();
- }
- aContext.CancelCallBack();
- aContext.ChangeState(CObexServerStateMachine::EDisconnected);
- }
-
-void TObexServerStatePutOpFinal::RequestCompleteNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse)
- {
- aContext.SetAppResponse(aAppResponse);
- aContext.CallBack(TObexServerStatePutOpFinal::ProcessNotification);
- }
-
-TInt TObexServerStatePutOpFinal::ProcessNotification(TAny* aPtr)
- {
- CObexServerStateMachine& context = *static_cast(aPtr);
-
- context.Transport().SendPacket().Init(context.AppResponse());
- context.Transport().SendPacket().SetFinal(); // Because it is
-
- // Check for additional headers to send
- if(context.PutFinalResponseHeaderSet())
- {
- PrepareFinalResponseHeaderSet( context.GetHeader(),
- *(context.PutFinalResponseHeaderSet()),
- context.Transport().SendPacket());
- // delete the headers now they've been used
- context.SetPutFinalResponseHeaderSet(NULL);
- }
-
- context.Transport().Send();
- context.ChangeState(CObexServerStateMachine::EReady);
-
- return KErrNone;
- }
-
-TBool TObexServerStatePutOpFinal::ValidResponse(TObexResponse aResponseCode)
- {
- return (aResponseCode>0 && aResponseCode<=255 && aResponseCode != ERespContinue);
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStatePutOpReceiveObject.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStatePutOpReceiveObject.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-PUT Operation Receive State
-This state receive the object from the client and transfers to Ready once the exchange is finished
-A PUT, DISCONNECT or ABORT will be processed
-Any other OBEX operation will be answered with an OBEX error code
-*/
-
-TObexServerStatePutOpReceiveObject::TObexServerStatePutOpReceiveObject()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "PutOpReceiveObject");
- iName = KName;
-#endif
- }
-
-void TObexServerStatePutOpReceiveObject::Entry(CObexServerStateMachine& aContext)
- {
- // Chain on to Put() to start receiving object
- Put(aContext, aContext.LastReceivedPacket());
- }
-
-void TObexServerStatePutOpReceiveObject::Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- // Process disconnect
- PerformDisconnect(aContext, aPacket);
- }
-
-void TObexServerStatePutOpReceiveObject::Put(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- //Initialise 'err' to KErrNone:
- //if ParseNextReceivePacket returns an error, we want
- //IrOBEXUtil::ObexResponse to return that error unchanged
- //See: IrOBEXUtil::ObexResponse
- TInt err = KErrNone;
-
- // Process Put packet into receive object
- if(aContext.TransObject()->ParseNextReceivePacket(aPacket) == CObexBaseObject::EError
- ||(err = aContext.Notification().PutPacketIndication()) != KErrNone)
- {// Error in receive
- aContext.Transport().Send(IrOBEXUtil::ObexResponse(err, aContext.TransObject()->GetLastError()));
- aContext.Notification().ErrorIndication(KErrGeneral);
- aContext.ChangeState(CObexServerStateMachine::EReady);
- }
-
- //ConnectionID is compulsory if Target header was used at connection
- else if ( aContext.Owner().CheckObjectForConnectionId(*(aContext.TransObject())))
- {
- if(aPacket.IsFinal())
- {// Successfully received
- aContext.ChangeState(CObexServerStateMachine::EPutOpFinal);
- }
- else // not final packet
- {
- aContext.Transport().Send(ERespContinue);
- }
- }
- else
- {
- aContext.Transport().Send(ERespServiceUnavailable); //connectionID was incorrect or not received
- }
- }
-
-
-void TObexServerStatePutOpReceiveObject::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict and return to Ready
- RespondAndEndOperation(aContext, ERespConflict);
- }
-
-void TObexServerStatePutOpReceiveObject::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict and return to Ready
- RespondAndEndOperation(aContext, ERespConflict);
- }
-
-void TObexServerStatePutOpReceiveObject::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict and return to Ready
- RespondAndEndOperation(aContext, ERespConflict);
- }
-
-void TObexServerStatePutOpReceiveObject::Abort(CObexServerStateMachine& aContext)
- {
- // Send ERespSuccess and return to Ready
- aContext.Notification().AbortIndication();
- RespondAndEndOperation(aContext, ERespSuccess);
- }
-
-void TObexServerStatePutOpReceiveObject::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse)
- {
- // Send server app response and return to Ready
- RespondAndEndOperation(aContext, aResponse);
- }
-
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStatePutOpWaitForUser.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStatePutOpWaitForUser.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-PUT Operation Wait State
-This state issues the Put indication to the Application on entry and then waits for the response.
-
-Any OBEX operation will be cause a Protocol Error
-Chaging the MObexServerNotifyAsync via CObexServer::Start() will cause a Panic
-A Reset event (Protocol Error, Server Stop, Transport Down) will cancel the notification and move the machine to Disconnected
-The NotificationComplete event will queue a async one-shot to process the returned object, moving the machine to PutOpReceiveObject
-*/
-
-TObexServerStatePutOpWaitForUser::TObexServerStatePutOpWaitForUser()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "PutOpWaitForUser");
- iName = KName;
-#endif
- }
-
-void TObexServerStatePutOpWaitForUser::Entry(CObexServerStateMachine& aContext)
- {
- // Send notification to the Application
- aContext.SetTransObject(NULL);
-
- aContext.Notification().PutRequestIndication();
- }
-
-void TObexServerStatePutOpWaitForUser::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpWaitForUser::Disconnect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpWaitForUser::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpWaitForUser::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpWaitForUser::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpWaitForUser::Abort(CObexServerStateMachine& aContext)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpWaitForUser::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse /*aResponse*/)
- {
- // Raise Protocol Error (which will cause a Reset and cancel the notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStatePutOpWaitForUser::Start(CObexServerStateMachine& /*aContext*/)
- {
- // Panic - trying to change interface during wait
- IrOBEXUtil::Panic(EChangeInterfaceDuringWait);
- }
-
-void TObexServerStatePutOpWaitForUser::Reset(CObexServerStateMachine& aContext)
- {
- // Cancel notification - if it has not already been activated
- if (!aContext.IsCallBackActive())
- {
- aContext.Notification().CancelIndicationCallback();
- }
- aContext.CancelCallBack();
- aContext.ChangeState(CObexServerStateMachine::EDisconnected);
- }
-
-void TObexServerStatePutOpWaitForUser::RequestNotificationCompleted(CObexServerStateMachine& aContext, CObexBaseObject* aObject)
- {
- aContext.SetTransObject(aObject);
- aContext.CallBack(TObexServerStatePutOpWaitForUser::ProcessNotification);
- }
-
-void TObexServerStatePutOpWaitForUser::RequestNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse)
- {
- aContext.SetAppResponse(aAppResponse);
- aContext.CallBack(TObexServerStatePutOpWaitForUser::ProcessErrorNotification);
- }
-
-/*static*/ TInt TObexServerStatePutOpWaitForUser::ProcessNotification(TAny* aPtr)
- {
- // Get hold of the Context and the returned object
- CObexServerStateMachine& context = *static_cast(aPtr);
-
- CObexBaseObject* object = context.TransObject();
-
- //Check and initialise object, move to PutOpReceiveObject
- if(!object)
- {
- RespondAndEndOperation(context, ERespForbidden);
- }
- else if (object->InitReceive() != KErrNone)
- {
- RespondAndEndOperation(context, ERespInternalError);
- }
- else
- {
- context.Owner().SetCurrentOperation(CObex::EOpPut);
- context.ChangeState(CObexServerStateMachine::EPutOpReceiveObject);
- }
-
- return KErrNone;
- }
-
-/*static*/ TInt TObexServerStatePutOpWaitForUser::ProcessErrorNotification(TAny* aPtr)
- {
- // Get hold of the Context and the returned object
- CObexServerStateMachine& context = *static_cast(aPtr);
-
- RespondAndEndOperation(context, context.AppResponse());
-
- return KErrNone;
- }
-
-TBool TObexServerStatePutOpWaitForUser::ValidResponse(TObexResponse aResponseCode)
- {
- return (aResponseCode>0 && aResponseCode<=255 && aResponseCode != ERespContinue &&
- aResponseCode != ERespSuccess && aResponseCode != ERespCreated && aResponseCode != ERespAccepted);
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateReady.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateReady.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-OBEX Ready State
-This is the default state when there is an OBEX connection but no current operation.
-A CONNECT will be answered with an OBEX error code
-A GET will move the machine to GetOpReceiveSpecification
-A PUT will move the machine to PutOpWaitForUser
-A SETPATH will move the machine to SetPathOp
-A DISCONNECT or ABORT will be processed
-*/
-
-TObexServerStateReady::TObexServerStateReady()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "Ready");
- iName = KName;
-#endif
- }
-
-void TObexServerStateReady::Entry(CObexServerStateMachine& aContext)
- {
- aContext.Owner().SetCurrentOperation(CObex::EOpIdle);
- }
-
-void TObexServerStateReady::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict
- aContext.Transport().Send(ERespConflict);
- }
-
-void TObexServerStateReady::Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- // Process disconnect
- PerformDisconnect(aContext, aPacket);
- }
-
-void TObexServerStateReady::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.ChangeState(CObexServerStateMachine::EPutOpWaitForUser);
- }
-
-void TObexServerStateReady::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.ChangeState(CObexServerStateMachine::EGetOpReceiveSpecification);
- }
-
-void TObexServerStateReady::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.ChangeState(CObexServerStateMachine::ESetPathOp);
- }
-
-void TObexServerStateReady::Abort(CObexServerStateMachine& aContext)
- {
- // Send ERespSuccess
- // Report that we're re-synced
- aContext.Transport().Send(ERespSuccess);
- }
-
-void TObexServerStateReady::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse)
- {
- // Send response and remain in Ready state
- aContext.Transport().Send(aResponse);
- }
-
-
-void TObexServerStateReady::ReadActivityDetected(CObexServerStateMachine& aContext)
- /*
- Indicates that a new obex packet is being read.
- This should only need to be passed up to the user
- if we are in 'Ready' state.
- */
- {
- aContext.Owner().SignalReadActivity();
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateSetPathOp.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateSetPathOp.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include
-#include "obexserverstatemachine.h"
-#include "obexsetpathdata.h"
-
-/**
-@file
-@internalComponent
-
-SETPATH Operation State
-This state processes the SetPath operation, the SetPathIndication is asynchronous.
-So the state has to wait for RequestCompleteIndicationCallback before sending
-response and transition to the ready state.
-*/
-
-TObexServerStateSetPathOp::TObexServerStateSetPathOp()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "SetPathOp");
- iName = KName;
-#endif
- }
-
-void TObexServerStateSetPathOp::Entry(CObexServerStateMachine& aContext)
- {
- TObexSetPathData data;
- TBool authChallengePresent = EFalse;
- CObexPacket& aPacket = aContext.LastReceivedPacket();
-
- if(!aPacket.ExtractData(data))
- {
- aContext.Transport().Send(ERespBadRequest);
- aContext.ChangeState(CObexServerStateMachine::EReady);
- return;
- }
- TInt packetSize = aPacket.PacketSize();
- // Check Connection ID
- if (aContext.Owner().CheckPacketForConnectionId(aPacket))
- {
- CObex::TSetPathInfo info(data);
-
- // Search for any name headers
- TObexInternalHeader header;
- while(aPacket.ExtractData(header))
- {
- if(!info.iNamePresent && header.HI() == TObexInternalHeader::EName && header.GetHVText(info.iName) == KErrNone)
- {
- info.iNamePresent = ETrue;
- }
- if (header.HI() == TObexInternalHeader::EAuthChallenge)
- {
- authChallengePresent = ETrue;
- }
- }
- if (authChallengePresent) // Auth challenge is present, send unauthorized response
- {
- aContext.Transport().Send(ERespUnauthorized);
- aContext.ChangeState(CObexServerStateMachine::EReady);
- }
- else
- {
- //There is no need to add a new state to wait for the RequestCompleteIndicationCallback because there is
- //no other actions required for SetPath. So just wait in this state.
- aContext.Notification().SetPathIndication(info, KNullDesC8);
- }
-
- }
- else //bad or missing ConnectionID
- {
- aContext.Transport().Send(ERespServiceUnavailable);
- aContext.ChangeState(CObexServerStateMachine::EReady);
- }
- }
-
-void TObexServerStateSetPathOp::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateSetPathOp::Disconnect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateSetPathOp::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateSetPathOp::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateSetPathOp::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateSetPathOp::Abort(CObexServerStateMachine& aContext)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateSetPathOp::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse /*aResponse*/)
- {
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateSetPathOp::Start(CObexServerStateMachine& /*aContext*/)
- {
- // Panic - trying to change interface during wait
- IrOBEXUtil::Panic(EChangeInterfaceDuringWait);
- }
-
-void TObexServerStateSetPathOp::Reset(CObexServerStateMachine& aContext)
- {
- // Cancel notification - if it has not already been activated
- if (!aContext.IsCallBackActive())
- {
- aContext.Notification().CancelIndicationCallback();
- }
- aContext.CancelCallBack();
- aContext.ChangeState(CObexServerStateMachine::EDisconnected);
- }
-
-void TObexServerStateSetPathOp::RequestCompleteNotificationCompleted(CObexServerStateMachine& aContext, TObexResponse aAppResponse)
- {
- aContext.SetAppResponse(aAppResponse);
- aContext.CallBack(TObexServerStateSetPathOp::ProcessNotification);
- }
-
-TInt TObexServerStateSetPathOp::ProcessNotification(TAny* aPtr)
- {
- CObexServerStateMachine& context = *static_cast(aPtr);
-
- context.Transport().Send(context.AppResponse());
- context.ChangeState(CObexServerStateMachine::EReady);
-
- return KErrNone;
- }
-
-TBool TObexServerStateSetPathOp::ValidResponse(TObexResponse aResponseCode)
- {
- return (aResponseCode>0 && aResponseCode<=255 && aResponseCode != ERespContinue);
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateTransportConnected.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateTransportConnected.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-Transport Connected State
-This is the state where there is a transport connect, but no OBEX connection.
-A CONNECT will move the machine to ObexConnecting
-A DISCONNECT will be processed
-An ABORT will cause a Protocol Error
-Any other OBEX operation will be answered with an OBEX error code
-*/
-
-TObexServerStateTransportConnected::TObexServerStateTransportConnected()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "TransportConnected");
- iName = KName;
-#endif
- }
-
-void TObexServerStateTransportConnected::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- aContext.ChangeState(CObexServerStateMachine::EObexConnecting);
- }
-
-void TObexServerStateTransportConnected::Disconnect(CObexServerStateMachine& aContext, CObexPacket& aPacket)
- {
- // Process disconnect
- PerformDisconnect(aContext, aPacket);
- }
-
-void TObexServerStateTransportConnected::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespBadRequest
- aContext.Transport().Send(ERespBadRequest);
- }
-
-void TObexServerStateTransportConnected::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict
- aContext.Transport().Send(ERespConflict);
- }
-
-void TObexServerStateTransportConnected::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Send ERespConflict
- aContext.Transport().Send(ERespConflict);
- }
-
-void TObexServerStateTransportConnected::Abort(CObexServerStateMachine& aContext)
- {
- // Send ERespSuccess
- // Any other response would, according to the spec,
- // require the Obex client to bring down the transport.
- // Our attempt is to be resilient if an 'Abort'
- // is sent erroneously whilst we are in this state.
- aContext.Transport().Send(ERespSuccess);
- }
-
-void TObexServerStateTransportConnected::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse aResponse)
- {
- aContext.Transport().Send(aResponse);
- // no need to change state, it's just as if the packet never arrived.
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/TObexServerStateWaitForUserPassword.cpp
--- a/obex/obexprotocol/obex/src/TObexServerStateWaitForUserPassword.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexserverstatemachine.h"
-
-/**
-@file
-@internalComponent
-
-CONNECT Operation Wait State
-This waits for the authentication state machine to receive a password from the user (CObexServer::UserPasswordL) which is indicated by ConnectionComplete
-
-Any OBEX operation will be cause a Protocol Error (which will then cause a reset event)
-Changing the MObexServerNotifyAsync via CObexServer::Start() will cause a Panic
-A Reset event (Protocol Error, Server Stop, Transport Down) will cause a transition to Disconnected
-*/
-
-TObexServerStateWaitForUserPassword::TObexServerStateWaitForUserPassword()
- {
-#ifdef __FLOG_ACTIVE
- _LIT8(KName, "WaitForUserPassword");
- iName = KName;
-#endif
- }
-
-void TObexServerStateWaitForUserPassword::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (no way to cancel the password request notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateWaitForUserPassword::Disconnect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (no way to cancel the password request notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateWaitForUserPassword::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (no way to cancel the password request notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateWaitForUserPassword::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (no way to cancel the password request notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateWaitForUserPassword::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
- {
- // Raise Protocol Error (no way to cancel the password request notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateWaitForUserPassword::Abort(CObexServerStateMachine& aContext)
- {
- // Raise Protocol Error (no way to cancel the password request notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateWaitForUserPassword::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse /*aResponse*/)
- {
- // Raise Protocol Error (no way to cancel the password request notification)
- aContext.Owner().Error(KErrIrObexPacketDuringWait);
- }
-
-void TObexServerStateWaitForUserPassword::Start(CObexServerStateMachine& /*aContext*/)
- {
- // Panic - trying to change interface during wait
- IrOBEXUtil::Panic(EChangeInterfaceDuringWait);
- }
-
-void TObexServerStateWaitForUserPassword::ConnectionComplete(CObexServerStateMachine& aContext)
- {
- // Move to Ready
- aContext.ChangeState(CObexServerStateMachine::EReady);
- }
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/authentication.cpp
--- a/obex/obexprotocol/obex/src/authentication.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,97 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include
-#include
-#include
-#include "authentication.h"
-
-_LIT8(KColonCharacter, ":");
-
-CObexAuthenticator* CObexAuthenticator::NewL()
- {
- CObexAuthenticator* s = new(ELeave) CObexAuthenticator;
- CleanupStack::PushL(s);
- s->ConstructL();
- CleanupStack::Pop();
- return s;
- }
-
-void CObexAuthenticator::ConstructL()
- {
- iMD5 = CMD5::NewL();
- }
-
-CObexAuthenticator::CObexAuthenticator()
- {
- TTime time;
- time.UniversalTime();
- iSeed = time.Int64();
- }
-
-CObexAuthenticator::~CObexAuthenticator()
- {
- delete iMD5;
- }
-
-TInt CObexAuthenticator::GenerateNonce(TDes8& aNonce)
- {
- TTime time;
- time.UniversalTime();
-
- TInt64 randomNumber = Math::Rand(iSeed);
- randomNumber <<= 32;
- randomNumber += Math::Rand(iSeed);
-
- TBuf8<33> key;
- key.Zero();
- key.AppendNum(time.Int64(), EHex);
- key.Append(_L8(":"));
- key.AppendNum(randomNumber, EHex);
-
- iMD5->Reset();
- aNonce.Append(iMD5->Hash(key));
- return KErrNone;
- }
-
-void CObexAuthenticator::GenerateResponseL(const TDesC8& aPasswd, const TNonce& aNonce, TRequestDigest& aRequestDigest)
- {
- //work out the length of buffer we need
- TInt buflen = aNonce.Length() + KColonCharacter().Length() + aPasswd.Length();
- HBufC8* buf = HBufC8::NewLC(buflen);
- TPtr8 ptr = buf->Des();
- ptr.Zero();
- ptr.Append(aNonce);
- ptr.Append(KColonCharacter);
- ptr.Append(aPasswd);
- iMD5->Reset();
- aRequestDigest.Append(iMD5->Hash(*buf));
-
- CleanupStack::PopAndDestroy();//buf
- }
-
-void CObexAuthenticator::ChallengeResponseL(const TDesC8& aPasswd, const TNonce& aNonce, const TRequestDigest& aRequestDigest)
- {
- TRequestDigest digest;
- digest.Zero();
- GenerateResponseL(aPasswd, aNonce, digest);
- if (digest != aRequestDigest)
- User::Leave(KErrAccessDenied);
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexasyncfilewriter.cpp
--- a/obex/obexprotocol/obex/src/obexasyncfilewriter.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,280 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include
-#include "obexasyncfilewriter.h"
-#include "logger.h"
-
-#ifdef __FLOG_ACTIVE
-_LIT8(KLogComponent, "OBEX");
-#endif
-
-//
-// Panic category for CObexAsyncFileWriter
-//
-_LIT(KObexAsyncFileWriterPanic, "Obex-AFW");
-
-/**
-Panic codes for CObexAsyncFileWriter
-
-@internalComponent
-@released
-*/
-enum TAsyncObexFileWriterPanic
- {
- /** Null buffer pointer */
- ENullBufferPointer
- };
-
-//
-// Implementation of CObexAsyncFileWriter
-//
-
-/**
-Factory function
-
-Note that we return a pointer to the interface class, so
-that this class can only be used through this interface.
-This class in an implementation of a strategy as part of
-a Strategy pattern. CObexSyncFileWriter provides an
-alternative strategy implementation, with CObexBufObject
-as the context for these strategies.
-
-@see MObexFileWriter
-@see CObexSyncFileWriter
-@see CObexBufObject
-
-@internalComponent
-@released
-
-@param aFile The file we're writing to
-@return An MObexFileWriter for writing to file
-*/
-MObexFileWriter* CObexAsyncFileWriter::NewL(RFile& aFile)
- {
- CObexAsyncFileWriter* self = new(ELeave) CObexAsyncFileWriter(aFile);
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(self);
- return self;
- }
-
-/**
-Constructor
-
-@internalComponent
-@released
-
-@param aFile The file we're writing to
-*/
-CObexAsyncFileWriter::CObexAsyncFileWriter(RFile& aFile)
- : CActive(EPriorityStandard), iFile(aFile), iBufPtr(NULL, 0)
- {
- CActiveScheduler::Add(this);
- }
-
-/**
-2nd phase constructor
-
-@internalComponent
-@released
-*/
-void CObexAsyncFileWriter::ConstructL()
- {
- }
-
-/**
-AO cancellation
-
-@internalComponent
-@released
-*/
-void CObexAsyncFileWriter::DoCancel()
- {
- iFile.Flush();
- }
-
-/**
-AO request completion
-
-@internalComponent
-@released
-*/
-void CObexAsyncFileWriter::RunL()
- {
- // Just ignore completions; the status is picked up next time
- // a service function is called
- }
-
-/**
-Normal asynchronous write to file
-
-@internalComponent
-@released
-
-@param aPos The file position
-@param aBuf The buffer we're to write. We use this buffer by copying the pointer
- and return the buffer we previously wrote to the caller by updating
- the pointer. If an error occurs, the buffers are not swapped and
- the pointer is not updated. Note that this class never owns any
- buffers and that passing a buffer to this function does not imply a
- transfer of ownership.
-@return Symbian OS error code
-*/
-TInt CObexAsyncFileWriter::Write(TInt aPos, CBufBase*& aBuf)
- {
- __ASSERT_ALWAYS(aBuf, PANIC(KObexAsyncFileWriterPanic, ENullBufferPointer));
-
- // If last write to file has not completed...
- if (IsActive())
- {
- // wait for it to complete
- User::WaitForRequest(iStatus);
-
- // if we had an error on the last write
- if (iStatus.Int())
- {
- // Signal ourselves again with the error
- TRequestStatus* status = &iStatus;
- User::RequestComplete(status, iStatus.Int());
- // and then de-activate ourselves by cancelling
- Cancel();
- }
- // if we didn't have an error on the last write,
- // we've consumed the completion of the write and
- // hence are still active
- }
-
- if (!iStatus.Int())
- // if the last write completed successfully...
- {
- // Swap our and the caller's pointers to show we
- // have swapped which buffers we are using. Note
- // that the ownership of the buffers is not changed
- // by this and the caller must deallocate any buffers
- // it owns which are passed to this function.
- CBufBase* buf = iBuffer;
- iBuffer = aBuf;
- aBuf = buf;
-
- // Set up the descriptor to be passed to the file write
- iBufPtr.Set(iBuffer->Ptr(0));
-
- // We'll need to be active to service another write
- if (!IsActive())
- {
- SetActive();
- }
-
- // kick off writing the next block
- iFile.Write(aPos, iBufPtr, iStatus);
-
- // and we're happy...
- return KErrNone;
- }
- else
- // the last write did not complete successfully
- {
- // Signal Obex error
- return iStatus.Int();
- }
-
- }
-
-/**
-Final, synchronous write to file
-
-@internalComponent
-@released
-
-@param aPos The file position
-@param aBuf The buffer we're to write. We use this buffer by copying the pointer
- and return the buffer we previously wrote to the caller by updating
- the pointer. If an error occurs, the buffers are not swapped and
- the pointer is not updated. Note that this class never owns any
- buffers and that passing a buffer to this function does not imply a
- transfer of ownership.
-@param aLength The amount of the buffer to write
-@return Symbian OS error code
-*/
-TInt CObexAsyncFileWriter::FinalWrite(TInt aPos, CBufBase*& aBuf, TInt aLength)
- {
- __ASSERT_ALWAYS(aBuf, PANIC(KObexAsyncFileWriterPanic, ENullBufferPointer));
-
- // If last write to file has not completed...
- if (IsActive())
- {
- // wait for it to complete
- User::WaitForRequest(iStatus);
-
- // Signal ourselves again with the request status
- TRequestStatus* status = &iStatus;
- User::RequestComplete(status, iStatus.Int());
-
- // and then de-activate ourselves by cancelling
- Cancel();
- }
-
- // if the last write completed successfully...
- if (!iStatus.Int())
- {
- // Swap our and the caller's pointers to show we
- // have swapped which buffers we are using. Note
- // that the ownership of the buffers is not changed
- // by this and the caller must deallocate any buffers
- // it owns which are passed to this function.
- CBufBase* buf = iBuffer;
- iBuffer = aBuf;
- aBuf = buf;
-
- // Set up the descriptor to be passed to the file write
- iBufPtr.Set(iBuffer->Ptr(0));
- iBufPtr.SetLength(aLength);
-
- // write the final block and return the error
- TInt err = iFile.Write(aPos, iBufPtr);
- if (err == KErrNone)
- {
- //flush the buffer, commit the write
- return iFile.Flush();
- }
- else
- {
- return err;
- }
- }
- else
- // the last write did not complete successfully
- {
- // Signal Obex error
- return iStatus.Int();
- }
- }
-
-/**
-Destructor
-
-@internalComponent
-@released
-*/
-CObexAsyncFileWriter::~CObexAsyncFileWriter()
- {
- Cancel();
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexauthchallengehandler.cpp
--- a/obex/obexprotocol/obex/src/obexauthchallengehandler.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @publishedAll
-*/
-
-#include
-
-/**
-This virtual function allows the M- classes to be extended in future in a binary
-compatible way by providing a method that clients can override in future to
-allow extra callbacks to be made via aObject.
-*/
-EXPORT_C void MObexAuthChallengeHandler::MOACH_ExtensionInterfaceL(TUid /*aInterface*/, void*& aObject)
- {
- aObject = NULL;
- }
-
-// EOF
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexclient.cpp
--- a/obex/obexprotocol/obex/src/obexclient.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,1486 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "logger.h"
-#include "obexsetpathdata.h"
-#include "OBEXUTIL.H"
-#include "obexheaderutil.h"
-#include "authentication.h"
-#include "obexpacketsignaller.h"
-#include "obexpackettimer.h"
-#include "obexnotifyhandlerclient.h"
-#include "obexerrorengine.h"
-
-#ifdef __FLOG_ACTIVE
-_LIT8(KLogComponent, "OBEX");
-#endif
-
-// Constant used to identify if the last received response code field
-// has been populated (i.e., if the first response has been received
-// from the OBEX server). The response code field is only 7 bits (+ the
-// 'final bit') so the use of this 16 bit number will ensure the value
-// for KUnpopulatedResponseCode never overlaps with an actual code.
-const static TUint16 KUnpopulatedResponseCode = 0xffff;
-
-// For debug builds check that when an underlying error is set
-// it has not already been set since the start of the client operation
-// and check that a last error has been set when the operation completes.
-#define SET_LAST_ERROR(_error) __ASSERT_DEBUG(!iIsLastErrorSet, IrOBEXUtil::Fault(ELastErrorSetTwice)); iErrorEngine->SetLastError(CObexErrorEngine::_error); iIsLastErrorSet = ETrue
-#define CHECK_LAST_ERROR_IS_SET __ASSERT_DEBUG(iIsLastErrorSet, IrOBEXUtil::Fault(ELastErrorNotSet)); iIsLastErrorSet = EFalse
-
-
-// Constructor - set initial values
-CObexClient::CObexClient() : CObex()
- {
- iCurrentOperation = EOpIdle;
- iConnectionID = KConnIDInvalid;
- iLastReceivedResponseOpcode = static_cast(KUnpopulatedResponseCode);
- }
-
-void CObexClient::ConstructL(TObexTransportInfo& aObexTransportInfo)
- {
- CObex::ConstructL(aObexTransportInfo);
- iNotifyHandler = new(ELeave)CObexNotifyHandlerClient(*this);
- iTransportController->SetOwner(*iNotifyHandler);
-
- // iHeaderSet is used to store headers received in Put Response
- iHeaderSet = CObexHeaderSet::NewL();
- iHeader = CObexHeader::NewL();
- iPacketProcessSignaller = CObexPacketSignaller::NewL();
- iErrorEngine = CObexErrorEngine::NewL();
- iPacketTimer = CObexPacketTimer::NewL(*this);
- }
-
-/** Destructor.
-
-@publishedAll
-@released
-*/
-EXPORT_C CObexClient::~CObexClient()
- {
- LOG_LINE
- LOG_FUNC
-
- Error(KErrCompletion);
- delete iHeader;
- delete iHeaderSet;
- delete iPacketProcessSignaller;
- delete iNotifyHandler;
- delete iErrorEngine;
- delete iPacketTimer;
- }
-
-/** A call back from the the service with the password required for use with generating
-the challenge response.
-
-@param aPassword Password
-
-@leave KErrNotReady if this function is not called from a MObexAuthChallengeHandler::GetUserPasswordL callback.
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::UserPasswordL(const TDesC& aPassword)
- {
- LOG_LINE
- LOG_FUNC
-
- //now have a password, get a nonce, and get it hashed then reply
- FLOG(_L("CObexClient::UserPasswordL\n\r"));
- if (GetConnectState() == EWaitForUserInput)
- {
- PrepareChallResponseL( aPassword);
-
- TObexInternalHeader hdr;
- hdr.Set(TObexInternalHeader::EAuthResponse, CONST_CAST(TUint8*, iOutgoingChallResp.Ptr()), iOutgoingChallResp.Size());
- FLOG(_L("CObexClient::UserPasswordL EAuth heaqder added\n\r"));
- if(iTransportController->SendPacket().InsertData(hdr))
- {
- SetConnectState(EWaitForFinalResponse);
- iTransportController->SendPacket().SetFinal();
- SendRequestPacket();
- FLOG(_L("CObexClient::UserPasswordL packet sent\n\r"));
-
- }
- else
- {
- LEAVEIFERRORL(KErrGeneral);
- }
- }
- else
- {
- LEAVEIFERRORL(KErrNotReady);
- }
- }
-
-/** Allocates and constructs a new OBEX client object.
-
-The received protocol information object, aObexProtocolInfoPtr, specifies the transport protocol to use:
-For the standard transports the following are used, TObexIrProtocolInfo for IrDA, TObexBluetoothProtocolInfo
-for Bluetooth, TObexUsbProtocolInfo for USB.
-
-@param aObexProtocolInfoPtr Protocol information object describing the transport to use
-@return New OBEX client object
-
-@publishedAll
-@released
-*/
-EXPORT_C CObexClient* CObexClient::NewL(TObexProtocolInfo& aObexProtocolInfoPtr)
- {
- LOG_LINE
- LOG_STATIC_FUNC_ENTRY
-
- TObexProtocolPolicy defaultProtocolPolicy; // no packet sizing policy specified, so use default
- TObexTransportInfo* transportInfo = IrOBEXUtil::CreateTransportInfoL(aObexProtocolInfoPtr, defaultProtocolPolicy);
- CleanupStack::PushL(transportInfo);
- CObexClient* client = CObexClient::NewL(*transportInfo);
- CleanupStack::PopAndDestroy(transportInfo);
- return client;
- }
-
-/** Allocates and constructs a new OBEX client object with packet sizing information.
-
-The received protocol information object, aObexProtocolInfoPtr, specifies the transport protocol to use:
-For the standard transports the following are used, TObexIrProtocolInfo for IrDA, TObexBluetoothProtocolInfo
-for Bluetooth, TObexUsbProtocolInfo for USB.
-
-The aObexProtocolPolicy parameter specifies the packet sizing policy for this OBEX object.
-
-@param aObexProtocolInfoPtr Protocol information object describing the transport to use
-@param aObexProtocolPolicy Protocol policy object specifying the packet sizes to use
-@return New OBEX client object
-
-@publishedAll
-@released
-*/
-EXPORT_C CObexClient* CObexClient::NewL(TObexProtocolInfo& aObexProtocolInfoPtr, TObexProtocolPolicy& aObexProtocolPolicy)
- {
- LOG_LINE
- LOG_STATIC_FUNC_ENTRY
-
- TObexTransportInfo* transportInfo = IrOBEXUtil::CreateTransportInfoL(aObexProtocolInfoPtr, aObexProtocolPolicy);
- CleanupStack::PushL(transportInfo);
- CObexClient* client = CObexClient::NewL(*transportInfo);
- CleanupStack::PopAndDestroy(transportInfo);
- return client;
- }
-
-/** Allocates and constructs a new OBEX client object with packet sizing information.
-
-The received transport information object, aObexTransportInfo, specifies the transport protocol packet sizes to use:
-For the standard transports the following are used, TObexIrProtocolInfo for IrDA, TObexBluetoothProtocolInfo
-for Bluetooth, TObexUsbProtocolInfo for USB.
-
-@param aObexTransportInfo Transport information object describing the transport and packet sizes to use
-@return New OBEX client object
-
-@capability WriteDeviceData If the TObexIrV3TransportInfo is passed as the argument
- and the associated name is valid.
-
-@publishedAll
-@released
-*/
-EXPORT_C CObexClient* CObexClient::NewL(TObexTransportInfo& aObexTransportInfo)
- {
- LOG_LINE
- LOG_STATIC_FUNC_ENTRY
-
- CObexClient* self = new(ELeave) CObexClient();
- CleanupStack::PushL(self);
- self->ConstructL(aObexTransportInfo);
- CleanupStack::Pop(self);
- return(self);
- }
-
-/** OBEX CONNECT operation to any available remote machine, specifying an object
-to pass.
-
-@param aObject OBEX object to pass to the remote machine
-@param aStatus Asynchronous status word. On completion, KErrNone if it was
-successful, or a system-wide error code
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::Connect(CObexBaseObject& aObject, TRequestStatus& aStatus)
- {
- LOG_LINE
- LOG_FUNC
-
- if(!AlreadyActive(aStatus))
- {
- FLOG(_L("CObexClient::Connect no password but some header data\r\n"));
- EmptyHeaderSet();
- iChallenge = EFalse;
- OBEX_TRAP(Error, ClientCommandL(EOpConnect, static_cast(&aObject), aStatus));
- }
- }
-
-/** OBEX CONNECT operation to any available remote machine, specifying an object
-to pass and a password.
-
-@param aObject OBEX object to pass to the remote machine
-@param aPassword Password to access remote machine
-@param aStatus Asynchronous status word. On completion, KErrNone if it was
-successful, or a system-wide error code
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::ConnectL(CObexBaseObject& aObject, const TDesC& aPassword,
- TRequestStatus& aStatus)
- {
- LOG_LINE
- LOG_FUNC
-
- if(!AlreadyActive(aStatus))
- {
- FLOG(_L("CObexClient::Connect with password and some header info\r\n"));
- EmptyHeaderSet();
- delete iChallPassword;
- iChallPassword = NULL;
- iChallPassword = HBufC8::NewL(aPassword.Size());
- TPtr8 ptr = iChallPassword->Des();
- CnvUtfConverter::ConvertFromUnicodeToUtf8(ptr, aPassword);
- iChallenge = ETrue;
- OBEX_TRAP(Error, ClientCommandL(EOpConnect, static_cast(&aObject), aStatus));
- }
- }
-
-
-/** OBEX CONNECT operation to any available remote machine, specifying a password.
-
-@param aPassword Password to access remote machine
-@param aStatus On completion, KErrNone if it was successful, or a system-wide
-error code
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::ConnectL(const TDesC& aPassword, TRequestStatus& aStatus)
- {
- LOG_LINE
- LOG_FUNC
-
- if(!AlreadyActive(aStatus))
- {
- FLOG(_L("CObexClient::Connect with password but no header info\r\n"));
- EmptyHeaderSet();
- delete iChallPassword;
- iChallPassword = NULL;
- iChallPassword = HBufC8::NewL(aPassword.Length());
- TPtr8 ptr = iChallPassword->Des();
- CnvUtfConverter::ConvertFromUnicodeToUtf8(ptr, aPassword);
- iChallenge = ETrue;
- OBEX_TRAP(Error, ClientCommandL(EOpConnect, NULL, aStatus));
- }
- }
-
-/** OBEX CONNECT operation to any available remote machine.
-
-@param aStatus Asynchronous status word. On completion, KErrNone if it was
-successful, or a system-wide error code
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::Connect(TRequestStatus& aStatus)
- {
- LOG_LINE
- LOG_FUNC
-
- if(!AlreadyActive(aStatus))
- {
- FLOG(_L("\tno password no header"));
- EmptyHeaderSet();
- iChallenge = EFalse;
- OBEX_TRAP(Error, ClientCommandL(EOpConnect, NULL, aStatus));
- }
- }
-
-/** OBEX DISCONNECT operation.
-
-This terminates the OBEX connection, and closes the transport on receiving
-any response from the server.
-
-@param aStatus Asynchronous status word. On completion, KErrNone on normal
-disconnection, or KErrDisconnected if the server dropped the transport before
-sending an OBEX response (which is valid behaviour).
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::Disconnect(TRequestStatus& aStatus)
- {
- LOG_LINE
- LOG_FUNC
-
- if(!AlreadyActive(aStatus))
- {
- FLOG(_L("CObexClient::Disconnect\r\n"));
- EmptyHeaderSet();
- OBEX_TRAP (Error, ClientCommandL(EOpDisconnect, NULL, aStatus));
- }
- }
-
-/** OBEX PUT operation.
-
-Any valid header that is also present in aObject’s header mask will be sent
-to the server, along with the object body specified by the implementation
-of aObject.
-
-@param aObject OBEX object to put
-@param aStatus Asynchronous status word. On completion, KErrNone if the server
-accepted the object and received it fully, or the appropriate file error if
-the data file could not be opened
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::Put(CObexBaseObject& aObject, TRequestStatus& aStatus)
- {
- LOG_LINE
- LOG_FUNC
-
- if(!AlreadyActive(aStatus))
- {
- FLOG(_L("\tnot already active"));
- EmptyHeaderSet();
- OBEX_TRAP(Error, ClientCommandL(EOpPut, static_cast(&aObject), aStatus));
- }
- }
-
-/** OBEX GET operation.
-
-The caller specifies in aObject the headers to send to the server to specify
-the object to get: normally just a name is expected. If the server can serve
-the request, the object it returns will be loaded into aObject on completion.
-All headers returned by the server that are also allowed by the object’s
-header mask will be loaded into the relevant attributes of aObject. Any object
-body is stored according to the implementation type of the CObexBaseObject
-passed.
-
-@param aObject OBEX object to get; on completion, the retrieved object
-@param aStatus Asynchronous status word. On completion, KErrNone if the server
-passed back an OBEX object, or the appropriate file error if the data file
-could not be opened
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::Get(CObexBaseObject& aObject, TRequestStatus& aStatus)
- {
- LOG_LINE
- LOG_FUNC
-
- if(!AlreadyActive(aStatus))
- {
- FLOG(_L("CObexClient::Get\r\n"));
- EmptyHeaderSet();
- OBEX_TRAP(Error, ClientCommandL(EOpGet, static_cast(&aObject), aStatus));
- }
- }
-
-/** OBEX SETPATH operation.
-
-This changes the remote device's current path.
-
-@param aPathInfo Information to send in the SETPATH command. If you do not
-which to send a name, make sure CObex::TSetPathInfo::iNamePresent is set to
-false.
-@param aStatus Asynchronous status word. On completion, KErrNone if successful,
-or a system-wide error code
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::SetPath(TSetPathInfo& aPathInfo, TRequestStatus& aStatus)
- {
- LOG_LINE
- LOG_FUNC
-
- if(!AlreadyActive(aStatus))
- {
- FLOG(_L("CObexClient::SetPath\r\n"));
- EmptyHeaderSet();
- OBEX_TRAP(Error, ClientCommandL(EOpSetPath, static_cast(&aPathInfo), aStatus));
- }
- }
-
-/** OBEX ABORT operation.
-
-The function sends the OBEX abort command to the remote machine if a multi-packet
-operation (i.e. PUT or GET) is in progress. An operation in progress will
-complete with KErrAbort.
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::Abort()
- {
- LOG_LINE
- LOG_FUNC
-
- if(iPendingRequest &&(iCurrentOperation == EOpPut
- || iCurrentOperation == EOpGet || iCurrentOperation == EOpGetResponse))
- {
- // We have two phase abort, async. abort request, followed by async. response
- // To achive this without extra members we use extra operations in TOperation
- // EOpAbortNoFBit for the asynchronous request
- // EOpAbort for waiting for the response
- iCurrentOperation = EOpAbortNoFBit;
- }
- }
-
-/**
-This function can be called following the successful completion of a Put,
-and will return a reference to a CObexHeaderSet containing all the headers
-that were contained in the final Put response packet returned from the
-peer Obex server.
-
-The headers in the header set will be deleted by any subsequent call to
-CObexClient functions that trigger Obex commands (ie. Connect, Disconnect,
-Put, Get, SetPath).
-
-The reference should not be retained beyond the end of the lifetime of the
-CObexClient object.
-
-@publishedAll
-@released
-
-@return const reference to a Headerset containing headers returned in final
-Put response packet.
-*/
-EXPORT_C const CObexHeaderSet& CObexClient::GetPutFinalResponseHeaders()
- {
- LOG_LINE
- LOG_FUNC
-
- return *iHeaderSet;
- }
-
-/** Sets a final packet observer.
-
-This replaces any previous observer. The observer will receive a callback
-when a final packet for a put or get request begins to be sent and
-another when the send completes. Although the start and finish callbacks
-are guaranteed to be in order, no guarantees are made about the ordering
-with respect to the completion of the put or get request.
-
-This does not transfer ownership.
-
-@publishedAll
-@released
-@param aObserver The observer to receive packet process events. This may
- be NULL.
-*/
-EXPORT_C void CObexClient::SetFinalPacketObserver(MObexFinalPacketObserver* aObserver)
- {
- iPacketProcessSignaller->SetFinalPacketObserver(aObserver);
- }
-
-/** Get last server response code
-This method returns the last received OBEX response code.
-The method must not be called prior to a response notification being received by the
-client application. If the method is called a panic will be raised.
-
-@return The last received OBEX response code.
-@panic ENoResponseCodeToReturn Panics if the method is called prior to a response being received from the OBEX server.
-@publishedAll
-@released
-*/
-EXPORT_C TObexResponse CObexClient::LastServerResponseCode() const
- {
- LOG_LINE
- LOG_FUNC
- // If the last received response code has not been set (i.e., no response has been received) then panic
- // the client.
- __ASSERT_ALWAYS(iLastReceivedResponseOpcode != KUnpopulatedResponseCode, IrOBEXUtil::Panic(ENoResponseCodeToReturn));
- return iLastReceivedResponseOpcode;
- }
-
-/** Sets the Command Idle Time-out.
-
-This function sets the timer period to be observed during the progress of
-all OBEX commands. If the OBEX server does not respond within the set period
-the current OBEX command will be completed with an error of KErrIrObexRespTimedOut
-and the transport will be disconnected.
-
-Setting a time-out value of 0, all OBEX commands will be allowed to continue
-indefinitely.
-
-@param aTimeOut The time-out period in Microseconds.
-@publishedAll
-@released
-*/
-EXPORT_C void CObexClient::SetCommandTimeOut(TTimeIntervalMicroSeconds32 aTimeOut)
- {
- LOG_LINE
- LOG_FUNC
- iCmdTimeOutDuration = aTimeOut;
- }
-
-TBool CObexClient::AlreadyActive(TRequestStatus& aStatus)
-//can't do more than one request at atime
- {
- if(iPendingRequest)
- {
- TRequestStatus* tempStatus = &aStatus;
- User::RequestComplete(tempStatus,KErrAccessDenied);
- return ETrue;
- }
- return EFalse;
- }
-
-void CObexClient::ResetConnectionID()
- {
- iConnectionID = KConnIDInvalid;
- iConnectionIdSet = EFalse;
- }
-
-void CObexClient::SetConnectionID(TUint32 aConnectionID)
- {
- iConnectionID = aConnectionID;
- iConnectionIdSet = ETrue;
- }
-
-void CObexClient::ClientCommandL(TOperation aOp, TAny* aParam, TRequestStatus& aStatus)
- {
- LOG_LINE
- LOG_FUNC
-
- // Note: Function Calls to this method must be enclosed with an if statement utilising
- // CObexClient::AlreadyActive
-
- SetRequest(aStatus, aOp);
- if(aOp != EOpConnect &&(GetConnectState() != EConnObex || iTransportController == NULL))
- {
- SET_LAST_ERROR(EDisconnected);
- LEAVEIFERRORL(KErrDisconnected);
- }
-
- switch(aOp)
- {
- case EOpConnect:
- {
- switch(GetConnectState())
- {
- case EConnIdle:
- {
- // Don t start the Packet timer, It will be done once the Transport is up(see :onTransportUp)
- ResetConnectionID(); //set connection ID to invalid and flag to EFalse
- iCurrentObject = static_cast(aParam);
- TRAPD(err, iTransportController->ConnectL());
- if (err != KErrNone)
- {
- SET_LAST_ERROR(ETransportUpFailed);
- LEAVEIFERRORL(err);
- }
- }
- break;
- case EConnTransport:
- iCurrentObject = static_cast(aParam);
- //Transport is already connected just do the connection
- //Previously TransportUp was called. However the transport is already connected
- //thus the only required actions are the following.
- OnTransportUp();
- iTransportController->Receive();
- break;
- default:
- SET_LAST_ERROR(EAlreadyConnected);
- CompleteRequest(KErrAlreadyExists);
- }
- }
- break;
- case EOpDisconnect:
- {
- iTransportController->SendPacket().Init(TUint8(EOpDisconnect));
- iTransportController->SendPacket().SetFinal();
-
- // Insert the ConnectionID if necessary
- if (iConnectionIdSet)
- {
-
- TObexInternalHeader connectionID;
- connectionID.Set(TObexInternalHeader::EConnectionID, iConnectionID);
-
- if(!iTransportController->SendPacket().InsertData(connectionID))
- {
- LEAVEIFERRORL(KErrOverflow);
- }
- }
- SendRequestPacket();
- }
- break;
- case EOpPut:
- case EOpGet:
- // The Put and Get "request" state machines are identical
- // and live inside the object streamer.
- {
- //
- // For 'Get' the params are what to 'Get' and where to put it
- // For 'Put' the params are what to put
- // Either way we need to send a request based on the params
- iCurrentObject = static_cast(aParam);
-
- // Initialise the object ready for sending
- TInt err = iCurrentObject->InitSend(TObexOpcode(aOp));
- if (err != KErrNone)
- {
- SET_LAST_ERROR(ECannotInitialiseObject);
- LEAVEIFERRORL(err);
- }
-
- //if a ConnectionID was added then it's important to add the Connection ID
- //header here, allow it to be processed by PrepareNextSendPacket
- if ( iConnectionIdSet )
- {
- FLOG(_L("\tiConnectionIdSet is true"));
- TRAPD(err, iCurrentObject->SetConnectionIdL(iConnectionID));
- if (err != KErrNone)
- {
- SET_LAST_ERROR(ECannotSetConnectionId);
- LEAVEIFERRORL(err);
- }
- }
-
- // If we can...
- if(iCurrentObject->PrepareNextSendPacket(iTransportController->SendPacket()) != CObexBaseObject::EError)
- {
- iTransportController->SendPacket().AddPacketProcessEvents(EObexFinalPacketStarted | EObexFinalPacketFinished);
-
- // ...send the first request packet
- FLOG(_L("\tsending first request packet..."));
- SendRequestPacket();
- }
- else
- {
- FLOG(_L("\tleaving..."));
- SET_LAST_ERROR(ECannotPreparePacket);
- LEAVEIFERRORL(KErrGeneral);
- }
- }
- break;
-
- case EOpSetPath:
- {// Build up a setinfo packet and send it.
- TSetPathInfo* info = static_cast(aParam);
-
- iTransportController->SendPacket().Init(TUint8(aOp));
- iTransportController->SendPacket().SetFinal();
-
- TObexSetPathData data;
- data.iFlags = info->iFlags;
- data.iConstants = info->iConstants;
- if(!iTransportController->SendPacket().InsertData(data))
- {
- LEAVEIFERRORL(KErrOverflow);
- }
-
- //insert the ConnectionID if necessary
- if ( iConnectionIdSet )
- {
-
- TObexInternalHeader connectionID;
- connectionID.Set(TObexInternalHeader::EConnectionID, iConnectionID);
-
- if(!iTransportController->SendPacket().InsertData(connectionID))
- {
- LEAVEIFERRORL(KErrOverflow);
- }
- }
- if(info->iNamePresent)
- {
- TObexInternalHeader name;
- name.Set(TObexInternalHeader::EName, info->iName);
- if(!iTransportController->SendPacket().InsertData(name))
- {
- LEAVEIFERRORL(KErrOverflow);
- }
- }
- SendRequestPacket();
- break;
- }
- default:
- IrOBEXUtil::Fault(EClientCommandOpUnrecognised);
- }
-
- }
-
-void CObexClient::OnPacketReceive(CObexPacket& aPacket)
- {
- LOG_LINE
- LOG_FUNC
-
- //Cancel the timer
- if (iPacketTimer->IsActive())
- {
- iPacketTimer->Cancel();
- }
-
- // Store the response code including the 'final bit'.
- iLastReceivedResponseOpcode = static_cast(aPacket.Opcode() | (aPacket.IsFinal() ? KObexPacketFinalBit : 0));
-
- if(iTransportController->IsWriteActive())
- {
- FLOG(_L("OnPacketReceive received request whilst writing... dropping connection\r\n"));
- SET_LAST_ERROR(EResponseWhileWriting);
- CompleteRequest(KErrNone);
- ControlledTransportDown();
- return;
- }
-
- // Initialise the send packet to ensure that we do not
- // accidentally send the same packet as last time!
- iTransportController->SendPacket().Init(0);
-
- switch(iCurrentOperation)
- {
- case EOpConnect:
- {
- FLOG(_L("CObexClient::OnPacketReceive Connect OpCode\r\n"));
- if(ParseConnectPacket(aPacket) == KErrNone)
- {
- FLOG(_L("OnPacketReceive Connect Packet parsed \r\n"));
-
- //the request is only completed if now connected
- if(GetConnectState() == EConnObex)
- {
- SET_LAST_ERROR(ENoError);
- CompleteRequest(KErrNone);
- }
- else //otherwise still some outstanding issues
- {
- iTransportController->SendPacket().Init(EOpConnect);
- TInt err = PrepareConnectPacket(iTransportController->SendPacket());
- if( err == KErrNone )
- {
- FLOG(_L("OnPacketReceive PrepareConnectPacket SUCCESS\r\n"));
-
- iTransportController->SendPacket().SetFinal();
- SendRequestPacket();
- }
- else if ( GetConnectState() != EWaitForUserInput )
- {
- FLOG(_L("OnPacketReceive PrepareConnectPacket FAILED\r\n"));
- // Last underlying error already set in PrepareConnectPacket().
- Error(err);
- }
- }
- }
- else
- {
- FLOG(_L("OnPacketReceive Connect Packet Parse FAILED\r\n"));
- // Last underlying error already set in ParseConnectPacket().
- Error(KErrAbort);
- }
- }
- break;
- case EOpDisconnect:
- {
- FLOG(_L("CObexClient::OnPacketReceive DisConnect OpCode\r\n"));
- switch (aPacket.Opcode())
- {
- case ERespSuccess:
- {
- SET_LAST_ERROR(ENoError);
- CompleteRequest(KErrNone);
- }
- break;
- case ERespServiceUnavailable:
- {
- SET_LAST_ERROR(EBadConnectionId);
- CompleteRequest(KErrDisconnected);
- }
- break;
- default:
- {
- SET_LAST_ERROR(EErrorResponseFromServer);
- CompleteRequest(KErrDisconnected);
- }
- }
-
- ControlledTransportDown(); // Bring down the transport anyway, otherwise we could end up in a situation where we can't
- }
- break;
- case EOpPut:
- {
- FLOG(_L("CObexClient::OnPacketReceive Put OpCode\r\n"));
- if(!aPacket.IsFinal())
- {// Multipacket responses not allowed.
- SET_LAST_ERROR(EMultipacketResponse);
- Error(KErrCommsOverrun);
- break;
- }
- if(aPacket.Opcode() != ERespContinue
- && aPacket.Opcode() != ERespSuccess
- && aPacket.Opcode() != ERespPartialContent)
- {// Server has returned an OBEX error response. Deal with it...
- TInt err = IrOBEXUtil::EpocError(aPacket.Opcode());
- LOG1(_L8("Put error: %d"), err);
- SET_LAST_ERROR(EErrorResponseFromServer);
- CompleteRequest(err);
- break;
- }
-
- {
- CObexBaseObject::TProgress progress =
- iCurrentObject->PrepareNextSendPacket(iTransportController->SendPacket());
- iTransportController->SendPacket().AddPacketProcessEvents(EObexFinalPacketStarted | EObexFinalPacketFinished);
-
- // Work around for a problem both with some DoCoMo phones and Windows 2000:
- // Their server sends "Success" when it should actually send "Continue",
- // so we accept either here.
- if (((progress == CObexBaseObject::EContinue || progress == CObexBaseObject::ELastPacket)
- && (aPacket.Opcode () == ERespContinue || aPacket.Opcode () == ERespSuccess))||
- (progress == CObexBaseObject::EComplete
- && (aPacket.Opcode() == ERespContinue )))
- {// More stuff to send.
- SendRequestPacket();
- }
- else if(progress == CObexBaseObject::EComplete
- && (aPacket.Opcode() == ERespSuccess || aPacket.Opcode() == ERespPartialContent ))
- {// We've completed okay.
- // There may be headers to extract from this final put response
- TObexInternalHeader header;
-
- while(aPacket.ExtractData(header))
- {
- FLOG(_L("OnPacketReceive Extracting header from final Put Response"));
- TInt err=IrOBEXHeaderUtil::ParseHeader(header, *iHeaderSet);
- if(err != KErrNone)
- {
- SET_LAST_ERROR(ECannotExtractFinalPutHeader);
- Error(err);
- }
- }
- TInt err = IrOBEXUtil::EpocError(aPacket.Opcode());
- if (err == KErrNone)
- {
- SET_LAST_ERROR(ENoError);
- }
- else
- {
- SET_LAST_ERROR(EErrorResponseFromServer);
- }
- CompleteRequest(err);
- }
- else
- {// We're out of sync with server. Give up.
- SET_LAST_ERROR(EPutOutOfSync);
- Error(KErrGeneral);
- }
- }
- break;
- }
- case EOpGet:
- {
- FLOG(_L("CObexClient::OnPacketReceive Get OpCode\r\n"));
- if(!aPacket.IsFinal())
- {
- SET_LAST_ERROR(EMultipacketResponse);
- Error(KErrCommsOverrun); //??? WTF? Comms overrun?
- break;
- }
-
- // There's only two valid responses to a 'Get' Request...
- TUint8 respCode = aPacket.Opcode();
- if( respCode != ERespContinue &&
- respCode != ERespSuccess )
- // ... and if we didn't get one of them...
- {
- // ...there's not much else we can do
- SET_LAST_ERROR(EErrorResponseFromServer);
- CompleteRequest(IrOBEXUtil::EpocError(respCode));
- break;
- }
-
- // Now we know the response was probably valid, see if we need
- // to send another request packet
- CObexBaseObject::TProgress progress;
- progress = iCurrentObject->PrepareNextSendPacket(iTransportController->SendPacket());
-
- if( progress != CObexBaseObject::EComplete &&
- progress != CObexBaseObject::ELastPacket)
- // We're not done sending the request yet.
- {
- // So we'd better not have got a 'Success' from the remote end
- if( progress == CObexBaseObject::EContinue &&
- respCode == ERespContinue)
- {
- iTransportController->SendPacket().AddPacketProcessEvents(EObexFinalPacketStarted | EObexFinalPacketFinished);
-
- // Not finished sending the request yet, so send the next packet
- SendRequestPacket();
- }
- else
- {
- // Something went wrong - can't continue.
- SET_LAST_ERROR(EGetPrematureSuccess);
- CompleteRequest(KErrGeneral);
- }
-
- // We're done with this packet
- break;
- }
-
- // Still here? We MUST have got an EComplete from the sending state
- // machine. That means that the response we're handling RIGHT NOW is
- // the first packet of the thing we are 'Get'ting.
-
- // Must initialise the object to receive the data from the server
- iCurrentObject->InitReceive();
- // Change state so we handle the next response properly
- iCurrentOperation = EOpGetResponse;
- }
- // ** NB ** NO BREAK - DROP THROUGH TO HANDLE THE RESPONSE
- case EOpGetResponse:
- // Expecting a possibly multi-packet 'Get' response
- {
- FLOG(_L("CObexClient::OnPacketReceive GetResponse OpCode"));
-
- if(iCurrentObject->ParseNextReceivePacket(aPacket) == CObexBaseObject::EError)
- {
- SET_LAST_ERROR(EGetResponseParseError);
- Error(KErrGeneral);
- break;
- }
- if(aPacket.Opcode() == ERespContinue)
- {
- // Send a blank 'Get' request to solicit the next bit of the response
- SendRequestPacket(EOpGet);
- FTRACE(iTransportController->SendPacket().Dump());
- }
- else
- {
- // Got all of the response, give it to the user
- if (aPacket.Opcode() == ERespSuccess)
- {
- SET_LAST_ERROR(ENoError);
- }
- else
- {
- SET_LAST_ERROR(EErrorResponseFromServer);
- }
- CompleteRequest(IrOBEXUtil::EpocError(aPacket.Opcode()));
- }
- }
- break;
- case EOpSetPath:
- FLOG(_L("CObexClient::OnPacketReceive Set Path OpCode\r\n"));
- if (aPacket.Opcode() == ERespSuccess)
- {
- SET_LAST_ERROR(ENoError);
- }
- else
- {
- SET_LAST_ERROR(EErrorResponseFromServer);
- }
- CompleteRequest(IrOBEXUtil::EpocError(aPacket.Opcode()));
- break;
- case EOpAbortNoFBit:
- FLOG(_L("CObexClient::OnPacketReceive Abort NoFBit OpCode\r\n"));
- SendRequestPacket(EOpAbort);
- iCurrentOperation = EOpAbort;
- break;
- case EOpAbort:
- {
- FLOG(_L("CObexClient::OnPacketReceive Abort OpCode\r\n"));
-
- SET_LAST_ERROR(EAborted);
- if(aPacket.IsFinal() && aPacket.Opcode() == ERespSuccess)
- {// Just complete the put/get with code aborted
- CompleteRequest(KErrAbort);
- }
- else
- {// Report an error while aborting -> causes a disconnect
- Error(KErrAbort);
- }
- }
- break;
- default:
-// FPrint(_L("CObexClient::OnPacketReceive unknown opcode 0x%X!"),
-// iCurrentOperation);
- break;
- }
-
- // Client has finished with the read packet so queue the next read (if necessary)
- if(iConnectState >= EConnTransport)
- {
- iTransportController->Receive();
- }
-
- }
-
-TInt CObexClient::ParseConnectPacket(CObexPacket& aPacket)
- {
- TInt retValue = KErrNone;
- TConnectState nextState = EDropLink;
-
- if(!iTransportController || !iTransportController->ExtractRemoteConnectInfo(aPacket, iRemoteInfo.iVersion, iRemoteInfo.iFlags))
- {
- FLOG(_L("CObexClient::ParseConnectPacket Extract Remote Info FAILED\r\n"));
- SET_LAST_ERROR(ECannotExtractConnectInfo);
- return KErrGeneral;
- }
- FLOG(_L("CObexClient::ParseConnectPacket Extract Remote Info Success\r\n"));
-
- TObexInternalHeader hdr;
-
- if ( aPacket.Opcode() == ERespSuccess )
- {
- FLOG(_L("ParseConnectPacket ERespSuccess Opcode\r\n"));
-
- //if a simple connect was originally requested
- //then a simple ERespSuccess without any headers is enough
- if ( GetConnectState() == ESimpleConnRequest )
- nextState = EConnObex;
- //if responding to a chall from the server
- if (( GetConnectState() == EWaitForFinalResponse)&&(!iChallenge))
- nextState = EConnObex;
- while(aPacket.ExtractData(hdr))
- {
- switch(hdr.HI())
- {
- case TObexInternalHeader::EWho:
- {
- FLOG(_L("ParseConnectPacket Extracting EWHO header\r\n"));
- iRemoteInfo.iWho.Copy(hdr.HVByteSeq(), hdr.HVSize() > iRemoteInfo.iWho.MaxSize() ? iRemoteInfo.iWho.MaxSize() : hdr.HVSize());
- }
- break;
- case TObexInternalHeader::EConnectionID:
- {
- FLOG(_L("ParseConnectPacket Extracting EConnectionID header\r\n"));
-
- TUint32 newConnectionID = ((hdr.HVByteSeq()[0] << 24) + (hdr.HVByteSeq()[1] << 16) + (hdr.HVByteSeq()[2] << 8) + (hdr.HVByteSeq()[3]));
- SetConnectionID(newConnectionID);
-
- if ( GetConnectState() == ESimpleConnRequest )
- {
- nextState = EConnObex;
- }
- }
- break;
- case TObexInternalHeader::EAuthResponse:
- {
- if (iChallenge)
- {
- FLOG(_L("ParseConnectPacket Extracting EAuthResponse header\r\n"));
- //extract the response into it's constituent parts
- TRAPD(err, ProcessChallResponseL(hdr));
- if ( err == KErrNone )
- {
- FLOG(_L("ParseConnectPacket ProcessChallResponse Success\r\n"));
-
- if ((GetConnectState() == EChallConnRequested) || ( GetConnectState() == EWaitForFinalResponse))
- {
- nextState = EConnObex;
- }
- else
- {
- SET_LAST_ERROR(EUnexpectedChallengeResponse);
- nextState = EDropLink;
- retValue = KErrGeneral;
- }
- }
- else
- {
- FLOG(_L("ParseConnectPacket ProcessChallResponse FAILED\r\n"));
- SET_LAST_ERROR(ECannotProcessChallenge);
- nextState = EDropLink;
- retValue = KErrGeneral;
- }
- }
- else
- {
- // if no challenge was issued, then receiving a challenge response means the peer is badly
- // behaved. For this case we simply ignore the header, anything else would be too drastic.
- FLOG(_L("ParseConnectPacket Chall Response received when no Chall issued\r\n"));
- }
- }
- break;
- default:
- break;
- }//end switch
- }//end while
- }
- else if (aPacket.Opcode() == ERespUnauthorized )
- {
- FLOG(_L("ParseConnectPacket ERespUnauthorized Opcode\r\n"));
- // Only valid header here is AuthChallenge, if it's absent then authentication failed.
- TBool challengeAbsent = ETrue;
- while(aPacket.ExtractData(hdr))
- {
- switch(hdr.HI())
- {
- case TObexInternalHeader::EAuthChallenge:
- {
- FLOG(_L("ParseConnectPacket Extracting EAuthChallenge header\r\n"));
- challengeAbsent = EFalse;
- TRAPD(err, ProcessChallengeL(hdr));
- if ( !err )
- {
- nextState = EConnChallRxed;
- retValue = KErrNone;
- }
- else
- {
- SET_LAST_ERROR(ECannotProcessChallenge);
- retValue = KErrGeneral;
- }
-#ifdef TEST_CLIENT_CHANGES_ITS_MIND_ABOUT_CHALLENGE
- //this will force the client to challenge the server
- //even if it didn't challenge initially
- //this is not standard behaviour for our client
- //but the server must be capable of handling this situation
- iChallenge = ETrue;
-#endif
- }
- break;
- default:
- break;
- }//end switch
- }//end while
-
- if (challengeAbsent)
- {
- SET_LAST_ERROR(EChallengeAbsent);
- retValue = KErrGeneral;
- }
- }
- else
- {
- FLOG(_L("ParseConnectPacket Unknown Opcode Opcode\r\n"));
- SET_LAST_ERROR(EBadOpcodeInConnectPacket);
- retValue = KErrGeneral;
- }
-
-
- SetConnectState(nextState);
- return(retValue);
- }
-
-void CObexClient::OnError(TInt aError)
- {
- LOG1(_L8("CObexClient::OnError(%d)"), aError);
- CompleteRequest(aError);
-
- // Don't reset the Obex link for a normal disconnection, as
- // technically there is no real error requiring such drastic
- // action. In the case of USB, stalling the IN endpoint will
- // cause another round of alternate interface changes which
- // appears to confuse either Obex or the USB connector.
-
- // In other words the error KErrDisconnected occurs as a
- // result of the transport coming down, so there's no need to
- // signal a transport error in this case.
-
- // If this is called during construction, iTransportController could be NULL
- if(aError!=KErrDisconnected && iTransportController)
- {
- iTransportController->SignalTransportError();
- }
- }
-
-
-
-TInt CObexClient::PrepareConnectPacket(CObexPacket& aPacket)
- {
- TInt retValue = KErrNone;
- TConnectState nextState = EDropLink;
-
- if (!iTransportController->InsertLocalConnectInfo(aPacket, iLocalInfo.iVersion, iLocalInfo.iFlags))
- {
- FLOG(_L("CObexClient::PrepareConnectPacket local data insertion FAILED\r\n"));
- SET_LAST_ERROR(ECannotInsertConnectInfo);
- return(KErrGeneral);
- }
- FLOG(_L("CObexClient::PrepareConnectPacket local data inserted Succesfully\r\n"));
-
- //iCurrentObject could be NULL if Connect with no headers was requested
- if ( iCurrentObject )
- iCurrentObject->PrepareConnectionHeader(iTransportController->SendPacket());
-
-
- if (( iChallenge )&&(!retValue)) //if a challenge is to be sent
- {
- FLOG(_L("PrepareConnectPacket Generating challenge\r\n"));
-
- retValue = GenerateChallenge(aPacket);
- if ( retValue == KErrNone)
- {
- nextState = EChallConnRequested;
- }
- else
- {
- nextState = EDropLink;
- }
- }
-
-
- //check the state of the connect instruction
- if ( GetConnectState() == EConnTransport ) //first time round the loop
- {
- //it's going to be a simple challenge unless
- //it's already been decides it's a EChallConnRequested
- if ( nextState == EDropLink )
- nextState = ESimpleConnRequest;
- }
- else if (GetConnectState() == EConnChallRxed)
- {
- if (iCallBack )
- {
- FLOG(_L("PrepareConnectPacket requesting password from user\r\n"));
-
- //ask the user for a password
- //the callback does happens in the method OnPacketReceive()
- nextState = EWaitForUserInput;
- retValue = KErrGeneral; //mustn't send yet wait for reply from user
- }
- else
- {
- FLOG(_L("PrepareConnectPacket chall rxed but can't ask for password dropping link\r\n"));
- SET_LAST_ERROR(EChallengeRejected);
- retValue = KErrIrObexConnectChallRejected;
- nextState = EDropLink;
- }
- } //or drop the link
- else
- {
- FLOG(_L("PrepareConnectPacket unknown connect state\r\n"));
- SET_LAST_ERROR(EPrepareConnectPacketIncorrectState);
- retValue = KErrGeneral;
- nextState = EDropLink;
- }
- SetConnectState(nextState);
-
- return(retValue);
- }
-
-void CObexClient::OnTransportUp()
- {
- FLOG(_L("CObexClient::OnTransportUp\r\n"));
- ResetConnectionID();
-
- iTransportController->SendPacket().Init(EOpConnect);
- if (PrepareConnectPacket(iTransportController->SendPacket()) == KErrNone)
- {
- FLOG(_L("OnTransportUp PrepareConnectPacket Succesfull\r\n"));
-
- iTransportController->SendPacket().SetFinal();
- FTRACE(iTransportController->SendPacket().Dump());
- SendRequestPacket();
- }
- }
-
-void CObexClient::OnTransportDown()
- {
- LOG_LINE
- LOG_FUNC
-
- // Cancel the timer
- if (iPacketTimer->IsActive())
- {
- iPacketTimer->Cancel();
- }
- // If there's an outstanding request, an error has occured
- // But don't do anything if an error has already been set (due to e.g. packet timer timeout)
- if(iPendingRequest && !iIsLastErrorSet)
- {
- SET_LAST_ERROR(EOpOutstandingOnTransportDown);
- Error(KErrIrObexClientPutPeerAborted); //extended error for IrObex,("Other IR device aborted the transfer")
- }
- }
-
-/** Signals an event has ocurred.
-
-@released
-@internalComponent
-@param aEvent The event that has ocurred (TObexPacketProcessEvent)
-*/
-void CObexClient::SignalPacketProcessEvent(TInt aEvent)
- {
- if(aEvent & KObexPacketSignallerInterestingClientEvents)
- {
- // Currently all notifications are related to writes, so only need to
- // clear events from the SendPacket.
- iTransportController->SendPacket().RemovePacketProcessEvents(aEvent);
-
- iPacketProcessSignaller->Signal(static_cast(aEvent));
- }
- }
-
-void CObexClient::SetRequest(TRequestStatus& aStatus, TOperation aOperation)
- {
- aStatus = KRequestPending;
- iPendingRequest = &aStatus;
- iCurrentOperation = aOperation;
- }
-
-void CObexClient::CompleteRequest(const TInt aCompletion)
- {
- LOG_LINE
- LOG_FUNC
-
- if(iPendingRequest)
- {
- // Some errors, particularly IR, only come up through OnError().
- // Thus the setting of underlying error happens here.
- switch (aCompletion)
- {
- case KErrIrObexRespTimedOut:
- {
- SET_LAST_ERROR(EResponseTimeout);
- }
- break;
- case KErrDisconnected:
- {
- // There are at least two ways of getting here.
- // The first is disruption to the transport (e.g. IrDA beam blocked)
- // and the second is attempting an operation other than connect when
- // there is no connection (see CObexClient::ClientCommandL()).
- // We don't want to set the last error twice in the second case,
- // so check that the last error is not set before setting it here.
- if (!iIsLastErrorSet)
- {
- SET_LAST_ERROR(EOpOutstandingOnTransportDown);
- }
- }
- break;
- case KErrCompletion:
- {
- // This is an error from the destructor.
- // Operation is complete, successfully or otherwise.
- // Since the operation is still outstanding and the interruption
- // was initiated locally, the operation is effectively aborted.
- SET_LAST_ERROR(EAborted);
- }
- break;
- case KErrNotReady:
- {
- // This error occurs when the BT link times out.
- SET_LAST_ERROR(EOpOutstandingOnTransportDown);
- }
- break;
- case KErrCouldNotConnect:
- {
- // BT could not connect.
- SET_LAST_ERROR(EOpOutstandingOnTransportDown);
- }
- break;
- case KErrGeneral:
- {
- // Since Obex also uses this error elsewhere, only set a last error
- // if none has been set previously.
- if (!iIsLastErrorSet)
- {
- SET_LAST_ERROR(EOpOutstandingOnTransportDown);
- }
- }
- break;
- default:
- {
- // If an error has not yet been set, then set the last error as appropriate.
- if (!iIsLastErrorSet)
- {
- // For all other errors.
- SET_LAST_ERROR(EOpOutstandingOnTransportDown);
- }
- }
- }
- CHECK_LAST_ERROR_IS_SET;
- User::RequestComplete(iPendingRequest, aCompletion);// Sets iPendingRequest = NULL
- }
- iPendingRequest=NULL;
- iCurrentOperation = EOpIdle;
-
- if (iPacketTimer)
- {
- iPacketTimer->Cancel();
- }
- }
-
-void CObexClient::EmptyHeaderSet()
- {
- LOG_LINE
- LOG_FUNC
-
- iHeaderSet->First();
- while(iHeaderSet->This(iHeader) == KErrNone)
- {
- iHeaderSet->DeleteCurrentHeader();
- }
- }
-
-void CObexClient::TimeOutCompletion()
- {
- LOG_LINE
- LOG_FUNC
-
- CompleteRequest(KErrIrObexRespTimedOut);
- // Disconnect transport to prevent the client entering an invalid state
- ForcedTransportDown();
- }
-
-void CObexClient::SendRequestPacket()
- {
- //Send the request.
- iTransportController->Send();
-
- //Set the Timer.
- iPacketTimer->SetTimer(iCmdTimeOutDuration);
- }
-
-void CObexClient::SendRequestPacket(TObexOpcode aObexOpcode)
- {
- //Send the request.
- iTransportController->Send(aObexOpcode);
-
- //Set the Timer.
- iPacketTimer->SetTimer(iCmdTimeOutDuration);
- }
-
-/**
-Provides additional interfaces for CObexClient.
-
-@param aUid The UID of the interface that is required.
-@return A pointer to an instance implementing the interface represented by aUid.
-*/
-EXPORT_C TAny* CObexClient::ExtensionInterface(TUid aUid)
- {
- TAny* ret = NULL;
-
- if (aUid == KObexClientErrorResolverInterface)
- {
- ret = static_cast(iErrorEngine);
- }
-
- return ret;
- }
-
-
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexconstants.cpp
--- a/obex/obexprotocol/obex/src/obexconstants.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,175 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexconstantsinternal.h"
-#include
-#include "logger.h"
-
-#ifdef __FLOG_ACTIVE
-_LIT8(KLogComponent, "OBEX");
-#endif
-
-/**
-@file
-@internalComponent
-*/
-
-/**
-Sets up class with default values
-@publishedAll
-@released
-*/
-EXPORT_C TObexProtocolPolicy::TObexProtocolPolicy ()
- {
- LOG_LINE
- LOG_FUNC
-
- // Default set-up for version 0
- // This is set for backwards compatibility, so change with caution!
- iVersion = 0;
- iReceiveMtu = KObexPacketDefaultSize;
- iTransmitMtu = KObexPacketDefaultSize;
- }
-
-/**
-Sets the maximum size of the receive packet buffer for the policy.
-For the IrDA transport, if the new receive buffer size is different to
-KObexPacketDefaultSize the receive packet size is set to equal the new
-buffer size. Otherwise the packet size is set to the protocol defined limit.
-@param aReceiveMtu The new buffer size
-@return KErrNone on success. KErrArgument if the packet size is not supported
-@publishedAll
-@released
-*/
-EXPORT_C TInt TObexProtocolPolicy::SetReceiveMtu ( TUint16 aReceiveMtu )
- {
- LOG_LINE
- LOG_FUNC
- LOG1(_L8("\taReceiveMtu = %d"), aReceiveMtu);
-
- // Can't set size greater than the maximum, so only check if it's too small
- if ( aReceiveMtu >= KObexPacketMinSize )
- iReceiveMtu = aReceiveMtu;
-
- TInt ret = ( iReceiveMtu == aReceiveMtu ) ? KErrNone : KErrArgument;
- LOG1(_L8("\tret = %d"), ret);
- return ret;
- }
-
-/**
-Sets the maximum size of the transmit packet buffer for the policy
-@param aTransmitMtu The new buffer size
-@return KErrNone on success. KErrArgument if the packet size is not supported
-@publishedAll
-@released
-*/
-EXPORT_C TInt TObexProtocolPolicy::SetTransmitMtu ( TUint16 aTransmitMtu )
- {
- LOG_LINE
- LOG_FUNC
- LOG1(_L8("\taTransmitMtu = %d"), aTransmitMtu);
-
- // Can't set size greater than the maximum, so only check if it's too small
- if ( aTransmitMtu >= KObexPacketMinSize )
- iTransmitMtu = aTransmitMtu;
-
- TInt ret = ( iTransmitMtu == aTransmitMtu ) ? KErrNone : KErrArgument;
- LOG1(_L8("\tret = %d"), ret);
- return ret;
- }
-
-/**
-Gets the version of the protocol policy format that this class supports
-@return Protocol policy version
-@publishedAll
-@released
-*/
-EXPORT_C TUint16 TObexProtocolPolicy::Version () const
- {
- LOG_LINE
- LOG_FUNC
-
- LOG1(_L8("\tiVersion = %d"), iVersion);
- return iVersion;
- }
-
-/**
-Gets the policy's receive packet buffer size
-@return Receive packet buffer size
-@publishedAll
-@released
-*/
-EXPORT_C TUint16 TObexProtocolPolicy::ReceiveMtu () const
- {
- LOG_LINE
- LOG_FUNC
-
- LOG1(_L8("\tiReceiveMtu = %d"), iReceiveMtu);
- return iReceiveMtu;
- }
-
-/**
-Gets the policy's transmit packet buffer size
-@return Transmit packet buffer size
-@publishedAll
-@released
-*/
-EXPORT_C TUint16 TObexProtocolPolicy::TransmitMtu () const
- {
- LOG_LINE
- LOG_FUNC
-
- LOG1(_L8("\tiTransmitMtu = %d"), iTransmitMtu);
- return iTransmitMtu;
- }
-
-// TObexConnectInfo
-/**
-@publishedAll
-@released
-*/
-EXPORT_C TObexConnectInfo::TObexConnectInfo()
- {
- LOG_LINE
- LOG_FUNC
-
- iVersion = KObexVersion;
- iFlags = 0;
- }
-
-/**
-@publishedAll
-@released
-*/
-EXPORT_C TUint8 TObexConnectInfo::VersionMajor() const
- {
- LOG_LINE
- LOG_FUNC
-
- return(STATIC_CAST(TUint8,(iVersion & 0xF0) >> 4));
- }
-
-/**
-@publishedAll
-@released
-*/
-EXPORT_C TUint8 TObexConnectInfo::VersionMinor() const
- {
- LOG_LINE
- LOG_FUNC
-
- return(STATIC_CAST(TUint8,(iVersion & 0x0F)));
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexerrorengine.cpp
--- a/obex/obexprotocol/obex/src/obexerrorengine.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,117 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include "obexerrorengine.h"
-#include "OBEXUTIL.H"
-
-CObexErrorEngine* CObexErrorEngine::NewL()
- {
- CObexErrorEngine* self = new (ELeave) CObexErrorEngine;
- return self;
- }
-
-CObexErrorEngine::CObexErrorEngine()
- {
- iLastError = ENoError;
- }
-
-/**
-Function used to retreive an extended error code for the last completed client operation.
-
-@param aErrorSet The set of errors that the resolved error will lie within.
-@return An extended error code that lies within the error set specified.
-*/
-TUint CObexErrorEngine::LastError(TObexClientErrorResolutionSetType aErrorSet) const
- {
- TUint ret = 0;
-
- if (aErrorSet == EObexClientBasicErrorResolutionSet)
- {
- switch (iLastError)
- {
- case ENoError:
- {
- ret = EObexRequestAccepted;
- }
- break;
-
- case EAlreadyConnected:
- case EChallengeRejected:
- case EChallengeAbsent:
- case EBadConnectionId:
- case EErrorResponseFromServer:
- {
- ret = EObexRequestNotAccepted;
- }
- break;
-
- case EResponseTimeout:
- {
- ret = EObexRequestTimeout;
- }
- break;
-
- case ECannotInsertConnectInfo:
- case EPrepareConnectPacketIncorrectState:
- case EResponseWhileWriting:
- case ECannotExtractConnectInfo:
- case ECannotProcessChallenge:
- case EUnexpectedChallengeResponse:
- case EBadOpcodeInConnectPacket:
- case EAborted:
- case ECannotInitialiseObject:
- case ECannotSetConnectionId:
- case ECannotPreparePacket:
- case EMultipacketResponse:
- case ECannotExtractFinalPutHeader:
- case EPutOutOfSync:
- case EGetPrematureSuccess:
- case EGetResponseParseError:
- {
- ret = EObexRequestLocalInterruption;
- }
- break;
-
- case ETransportUpFailed:
- case EOpOutstandingOnTransportDown:
- case EDisconnected:
- {
- ret = EObexRequestLinkInterruption;
- }
- break;
-
- default:
- {
- IrOBEXUtil::Fault(EUnderlyingErrorUnrecognised);
- }
- }
- }
- else
- {
- IrOBEXUtil::Fault(EErrorSetUnrecognised);
- }
-
- return ret;
- }
-
-void CObexErrorEngine::SetLastError(TObexClientUnderlyingError aError)
- {
- iLastError = aError;
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexfilewriter.cpp
--- a/obex/obexprotocol/obex/src/obexfilewriter.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include "obexfilewriter.h"
-
-/**
-Destructor
-*/
-MObexFileWriter::~MObexFileWriter()
- {
- }
-
-//
-// End of file
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexheader.cpp
--- a/obex/obexprotocol/obex/src/obexheader.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,678 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include
-#include
-#include "obexunderlyingheader.h"
-#include "OBEXUTIL.H"
-#include "logger.h"
-
-#define BAD_HEADER_ACTION IrOBEXUtil::Panic(EHeaderAsBadType)
-
-#if ( defined __FLOG_ACTIVE && defined __LOG_FUNCTIONS__ )
-_LIT8(KLogComponent, "OBEX");
-#endif
-
-/**
-Standard constructor
-
-@internalComponent
- */
-CRefCounted::CRefCounted()
- {
- iCount = 0;
- }
-
-/**
-Increments the object's reference count.
-
-@internalComponent
-*/
-void CRefCounted::Open() const
- {
- iCount++;
- }
-
-/**
-Decrements the object's reference count and deletes the object when count goes to zero.
-
-@internalComponent
-*/
-void CRefCounted::Close() const
- {
- iCount--;
- if (iCount == 0)
- {
- delete this;
- }
- }
-
-/**
-@panic ObexFault ERefCountNonZero Panics if there are still references to this object or if the reference count is negative.
-
-@internalComponent
-*/
-CRefCounted::~CRefCounted()
- {
- __ASSERT_ALWAYS(iCount == 0, IrOBEXUtil::Fault(ERefCountNonZero));
- }
-
-EXPORT_C CObexHeader* CObexHeader::NewL()
- {
- LOG_LINE
- LOG_STATIC_FUNC_ENTRY
-
- CObexHeader* self = new(ELeave) CObexHeader();
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(self);
- return self;
- }
-
-/**
-Return a pointer to a copy of this object. This must be used instead
-of merely copying the pointer to the initial CObexHeader object as
-reference counting is used to keep track of instances of the header.
-The underlying data is not cloned, so any change to the data pointed to
-by this pointer could change the underlying data.
-
-@publishedAll
-@released
-*/
-EXPORT_C CObexHeader* CObexHeader::CopyL() const
- {
- LOG_LINE
- LOG_FUNC
-
- CObexHeader* copy = new(ELeave) CObexHeader(iHeader);
- copy->iHeader->Open();
- return copy;
- }
-
-/**
-@internalComponent
-Standard constructor.
-
-@see CObexHeaderSet
-*/
-CObexHeader::CObexHeader()
- {
- }
-
-/**
-Standard constructor, taking a pointer to an underlying object.
-
-@internalComponent
-*/
-CObexHeader::CObexHeader(CObexUnderlyingHeader* aHeader)
- : iHeader(aHeader)
- {
- }
-
-/**
-Sets this object to use the same underlying header as the parameter.
-This performs essentially the same function as the CopyL() function,
-but does not allocate a new object.
-The underlying data is not cloned, so any change to the data pointed to
-by this pointer could change the underlying data.
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeader::Set(CObexHeader* aHeader)
- {
- LOG_LINE
- LOG_FUNC
-
- Reset();
- iHeader = aHeader->iHeader;
- iHeader->Open();
- }
-
-/**
-Resets the contents of this header, discarding the underlying data.
-This is only called by the last instance of the header.
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeader::Reset()
- {
- LOG_LINE
- LOG_FUNC
-
- iHeader->Close();
- iHeader = 0;
- }
-
-/**
-Phase two constructor.
-Create the underlying header object. This is reference counted
-so ownership passes to itself.
-
-@internalComponent
-*/
-void CObexHeader::ConstructL()
- {
- iHeader = CObexUnderlyingHeader::NewL();
- iHeader->Open();
- }
-
-/**
-Standard destructor.
-
-@publishedAll
-@released
-*/
-CObexHeader::~CObexHeader()
- {
- if (iHeader != 0)
- {
- iHeader->Close();
- }
- }
-
-/**
-Resets and destroys all header attributes.
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeader::ResetContents()
- {
- LOG_LINE
- LOG_FUNC
-
- iHeader->ResetContents();
- }
-
-/**
-Sets the attibutes of this header.
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeader::SetAttributes(TUint16 aAttr)
- {
- LOG_LINE
- LOG_FUNC
-
- iHeader->SetAttributes(aAttr);
- }
-
-/**
-Return the attibute set currently in force.
-
-@publishedAll
-@released
-*/
-EXPORT_C TUint16 CObexHeader::Attributes() const
- {
- LOG_LINE
- LOG_FUNC
-
- return iHeader->Attributes();
- }
-
-/**
-Return the type of this header.
-
-@publishedAll
-@released
-*/
-EXPORT_C CObexHeader::THeaderType CObexHeader::Type() const
-
- {
- LOG_LINE
- LOG_FUNC
-
- return iHeader->Type();
- }
-
-/**
-Returns the header identifier.
-
-@publishedAll
-@released
-*/
-EXPORT_C TUint8 CObexHeader::HI() const
- {
- // Don't log this function as it's too verbose.
- //LOG_LINE
- //LOG_FUNC
-
- return iHeader->HI();
- }
-
-/**
-Returns this header as a byte value.
-@return The value of this header.
-@panic Obex EHeaderAsBadType Panics builds if header is of incorrect type.
-
-@publishedAll
-@released
-*/
-EXPORT_C TUint8 CObexHeader::AsByte() const
- {
- LOG_LINE
- LOG_FUNC
-
- return iHeader->AsByte();
- }
-
-/**
-Returns this header as a four-byte value.
-@return The value of this header.
-@panic Obex EHeaderAsBadType Panics if header is of incorrect type.
-
-@publishedAll
-@released
-*/
-EXPORT_C TUint32 CObexHeader::AsFourByte() const
- {
- LOG_LINE
- LOG_FUNC
-
- return iHeader->AsFourByte();
- }
-
-/**
-Returns this header as a byte sequence.
-@return The value of this header.
-@panic Obex EHeaderAsBadType Panics if header is of incorrect type.
-
-@publishedAll
-@released
-*/
-EXPORT_C const TDesC8& CObexHeader::AsByteSeq() const
- {
- LOG_LINE
- LOG_FUNC
-
- return iHeader->AsByteSeq();
- }
-
-/**
-Returns this header as an Unicode string.
-@return The value of this header.
-@panic Obex EHeaderAsBadType Panics in debug builds if header is of incorrect type.
-
-@publishedAll
-@released
-*/
-EXPORT_C const TDesC16& CObexHeader::AsUnicode() const
- {
- LOG_LINE
- LOG_FUNC
-
- return iHeader->AsUnicode();
- }
-
-/**
-Sets this header to represent a byte value.
-Forces header type to be a byte (which may therefore change the HI
-value).
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeader::SetByte(const TUint8 aHI, const TUint8 aByte)
- {
- LOG_LINE
- LOG_FUNC
-
- iHeader->SetByte(aHI, aByte);
- }
-
-/**
-Sets this header to represent a four-byte value.
-Forces header type to be a four-byte (which may therefore change
-the HI value).
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeader::SetFourByte(const TUint8 aHI, const TUint32 aFourByte)
- {
- LOG_LINE
- LOG_FUNC
-
- iHeader->SetFourByte(aHI, aFourByte);
- }
-
-/**
-Sets this header to represent a byte sequence.
-Forces header type to be a byte sequence (which may therefore change
-the HI value).
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeader::SetByteSeqL(const TUint8 aHI, const TDesC8& aByteSeq)
- {
- LOG_LINE
- LOG_FUNC
-
- iHeader->SetByteSeqL(aHI, aByteSeq);
- }
-
-/**
-Forces header type to be a byte (which may therefore change the HI
-value).
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeader::SetUnicodeL(const TUint8 aHI, const TDesC16& aUnicode)
- {
- LOG_LINE
- LOG_FUNC
-
- iHeader->SetUnicodeL(aHI, aUnicode);
- }
-
-/**
-@return The encoded size of this header in bytes, including the
-HI byte and the HV body.
-
-@publishedAll
-@released
-*/
-EXPORT_C TInt CObexHeader::EncodedSize() const
- {
- LOG_LINE
- LOG_FUNC
-
- return iHeader->EncodedSize();
- }
-
-// ----------------------------------------------------------------------
-// Now the real code. CObexHeader is just a facade, passing requests on
-// to an underlying reference counted object. This is where the real
-// work goes on.
-// ----------------------------------------------------------------------
-
-/**
-@internalComponent
-NewL method
-*/
-CObexUnderlyingHeader* CObexUnderlyingHeader::NewL()
- {
- CObexUnderlyingHeader* self = new(ELeave) CObexUnderlyingHeader();
- return self;
- }
-
-/**
-@internalComponent
-Standard constructor.
-*/
-CObexUnderlyingHeader::CObexUnderlyingHeader()
- {
- }
-
-/**
-@internalComponent
-Standard destructor.
-*/
-CObexUnderlyingHeader::~CObexUnderlyingHeader()
- {
- ResetContents();
- }
-
-/**
-@internalComponent
-Resets and destroys all header attributes.
-*/
-void CObexUnderlyingHeader::ResetContents()
- {
- // If a byte sequence or Unicode string header, destroy
- // the underlying HBufC.
- switch (Type())
- {
- case CObexHeader::EByteSeq:
- delete iHV.iByteSeq;
- break;
-
- case CObexHeader::EUnicode:
- delete iHV.iUnicode;
- break;
-
- default:
- // Not a pointer, nothing required
- {}
- }
-
- iAttributes = 0;
- iHI = 0;
- // Resetting the fourbyte data, will explicitly reset all the data
- // stored in the union (so no need to reset unicode, byte, byteseq)
- iHV.iFourByte = 0;
- }
-
-/**
-@internalComponent
-Sets the attibutes of this header.
-*/
-void CObexUnderlyingHeader::SetAttributes(TUint16 aAttr)
- {
- iAttributes = aAttr;
- }
-
-/**
-@internalComponent
-Return the attibute set currently in force.
-*/
-TUint16 CObexUnderlyingHeader::Attributes() const
- {
- return iAttributes;
- }
-
-/**
-@internalComponent
-Return the type of this header.
-*/
-CObexHeader::THeaderType CObexUnderlyingHeader::Type() const
- {
- // Call the internal inline. Just in case the header representation
- // changes!
- return static_cast(ObexHeaderType(iHI));
- }
-
-/**
-@internalComponent
-Returns the header identifier.
-*/
-TUint8 CObexUnderlyingHeader::HI() const
- {
- return iHI;
- }
-
-/**
-@internalComponent
-Returns this header as a byte value.
-@return The value of this header.
-@leave KErrNotSupported (release builds only) if this header is of
-incorrect type.
-@panic Obex EHeaderAsBadType Panics in debug builds if header is of incorrect type.
-*/
-TUint8 CObexUnderlyingHeader::AsByte() const
- {
- __ASSERT_ALWAYS((ObexHeaderType(iHI) == CObexHeader::EByte), BAD_HEADER_ACTION);
-
- return iHV.iByte;
- }
-
-/**
-@internalComponent
-Returns this header as a four-byte value.
-@return The value of this header.
-@leave KErrNotSupported (release builds only) if this header is of
-incorrect type.
-@panic Obex EHeaderAsBadType Panics in debug builds if header is of incorrect type.
-*/
-TUint32 CObexUnderlyingHeader::AsFourByte() const
- {
- __ASSERT_ALWAYS((ObexHeaderType(iHI) == CObexHeader::EFourByte), BAD_HEADER_ACTION);
-
- return iHV.iFourByte;
- }
-
-/**
-@internalComponent
-Returns this header as a byte sequence.
-@return The value of this header.
-@leave KErrNotSupported (release builds only) if this header is of
-incorrect type.
-@panic Obex EHeaderAsBadType Panics in debug builds if header is of incorrect type.
-*/
-const TDesC8& CObexUnderlyingHeader::AsByteSeq() const
- {
- __ASSERT_ALWAYS((ObexHeaderType(iHI) == CObexHeader::EByteSeq), BAD_HEADER_ACTION);
-
- if (iHV.iByteSeq)
- return *(iHV.iByteSeq);
- else
- return KNullDesC8();
- }
-
-/**
-@internalComponent
-Returns this header as an Unicode string.
-@return The value of this header.
-@leave KErrNotSupported (release builds only) if this header is of
-incorrect type.
-@panic Obex EHeaderAsBadType Panics in debug builds if header is of incorrect type.
-*/
-const TDesC16& CObexUnderlyingHeader::AsUnicode() const
- {
- __ASSERT_ALWAYS((ObexHeaderType(iHI) == CObexHeader::EUnicode), BAD_HEADER_ACTION);
-
- if (iHV.iUnicode)
- return *(iHV.iUnicode);
- else
- return KNullDesC16();
- }
-
-/**
-@internalComponent
-Sets this header to represent a byte value.
-Forces header type to be a byte (which may therefore change the HI
-value).
-*/
-void CObexUnderlyingHeader::SetByte(const TUint8 aHI, const TUint8 aByte)
- {
- __ASSERT_ALWAYS((ObexHeaderType(aHI) == CObexHeader::EByte), BAD_HEADER_ACTION);
-
- if ((iHI & KObexHeaderTypeMask) != (aHI & KObexHeaderTypeMask))
- ResetContents();
-
- iHI = aHI;
- iHV.iByte = aByte;
- }
-
-/**
-@internalComponent
-Sets this header to represent a four-byte value.
-Forces header type to be a four-byte (which may therefore change
-the HI value).
-*/
-void CObexUnderlyingHeader::SetFourByte(const TUint8 aHI, const TUint32 aFourByte)
- {
- __ASSERT_ALWAYS((ObexHeaderType(aHI) == CObexHeader::EFourByte), BAD_HEADER_ACTION);
-
- if ((iHI & KObexHeaderTypeMask) != (aHI & KObexHeaderTypeMask))
- ResetContents();
-
- iHI = aHI;
- iHV.iFourByte = aFourByte;
- }
-
-/**
-@internalComponent
-Sets this header to represent a byte sequence.
-Forces header type to be a byte sequence (which may therefore change
-the HI value).
-*/
-void CObexUnderlyingHeader::SetByteSeqL(const TUint8 aHI, const TDesC8& aByteSeq)
- {
- __ASSERT_ALWAYS((ObexHeaderType(aHI) == CObexHeader::EByteSeq), BAD_HEADER_ACTION);
-
- HBufC8* tmp = aByteSeq.AllocL();
- if ((iHI & KObexHeaderTypeMask) != (aHI & KObexHeaderTypeMask))
- ResetContents();
-
- iHI = aHI;
- delete iHV.iByteSeq;
- iHV.iByteSeq = tmp;
- }
-
-/**
-@internalComponent
-Sets this header to represent a byte value.
-Forces header type to be a byte (which may therefore change the HI
-value).
-*/
-void CObexUnderlyingHeader::SetUnicodeL(const TUint8 aHI, const TDesC16& aUnicode)
- {
- __ASSERT_ALWAYS((ObexHeaderType(aHI) == CObexHeader::EUnicode), BAD_HEADER_ACTION);
-
- HBufC16* tmp = aUnicode.AllocL();
- if ((iHI & KObexHeaderTypeMask) != (aHI & KObexHeaderTypeMask))
- ResetContents();
-
- iHI = aHI;
- delete iHV.iUnicode;
- iHV.iUnicode = tmp;
- }
-
-TInt CObexUnderlyingHeader::EncodedSize() const
- {
- const TInt KHIByteSize=1;
- const TInt KLengthEncoding=2;
- const TInt KOneByteHeaderEncodedSize=1+KHIByteSize;
- const TInt KFourByteHeaderEncodedSize=4+KHIByteSize;
-
- TInt encodedSize=0;
-
- switch(Type())
- {
-
- case CObexHeader::EUnicode:
- encodedSize=KHIByteSize+KLengthEncoding+AsUnicode().Size();
- if(AsUnicode().Size()>0)
- encodedSize+=2; // Two extra byes for null terminator
- break;
-
- case CObexHeader::EByteSeq:
- encodedSize=KHIByteSize+KLengthEncoding+AsByteSeq().Size();
- break;
-
- case CObexHeader::EByte:
- encodedSize=KOneByteHeaderEncodedSize;
- break;
-
- case CObexHeader::EFourByte:
- encodedSize=KFourByteHeaderEncodedSize;
- break;
-
- }
-
- return encodedSize;
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexheaderset.cpp
--- a/obex/obexprotocol/obex/src/obexheaderset.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,467 +0,0 @@
-// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include
-#include "OBEXUTIL.H"
-#include "logger.h"
-
-#ifdef __FLOG_ACTIVE
-_LIT8(KLogComponent, "OBEX");
-#endif
-
-/**
-Called in response to First() being called on the iterator object.
-The default implementation does nothing---some implementations may
-wish to reset state variables.
-
-@publishedAll
-@released
-*/
-EXPORT_C void MObexHeaderCheck::Reset()
- {
- LOG_LINE
- LOG_FUNC
- }
-
-/**
-This virtual function allows the M- classes to be extended in future in a binary
-compatible way by providing a method that clients can override in future to
-allow extra callbacks to be made via aObject.
-*/
-EXPORT_C void MObexHeaderCheck::MOHC_ExtensionInterfaceL(TUid /*aInterface*/, void*& aObject)
- {
- aObject = NULL;
- }
-
-/**
-@return ETrue if this header is the requested one.
-
-@publishedAll
-@released
-*/
-EXPORT_C TBool TObexMatchHeader::Interested(TUint8 aHI)
- {
- LOG_LINE
- LOG_FUNC
-
- return (aHI == iHI);
- }
-
-/**
-Sets the header identifier required.
-@code : iHI = aHI;
-@publishedAll
-@released
-*/
-EXPORT_C void TObexMatchHeader::SetHeader(TUint8 aHI)
- {
- LOG_LINE
- LOG_FUNC
-
- iHI = aHI;
- }
-
-/**
-@return ETrue if this header is of the requested type.
-@publishedAll
-@released
-*/
-EXPORT_C TBool TObexMatchHeaderType::Interested(TUint8 aHI)
- {
- LOG_LINE
- LOG_FUNC
-
- return (ObexHeaderType(aHI) == iType);
- }
-
-/**
-Set the header type required.
-@code : iType = aType;
-@publishedAll
-@released
-*/
-EXPORT_C void TObexMatchHeaderType::SetType(CObexHeader::THeaderType aType)
- {
- LOG_LINE
- LOG_FUNC
-
- iType = aType;
- }
-
-/**
-Creates an empty CObexHeaderSet object.
-@publishedAll
-@released
-*/
-EXPORT_C CObexHeaderSet* CObexHeaderSet::NewL()
- {
- LOG_LINE
- LOG_STATIC_FUNC_ENTRY
-
- CObexHeaderSet* self = new(ELeave) CObexHeaderSet();
- return self;
- }
-
-/**
-Copies an existing CObexHeaderSet to populate a new object.
-@return A new CObexHeaderSet object populated with the headers.
- This method returns ownership of the new object.
-@publishedAll
-@released
-*/
-EXPORT_C CObexHeaderSet* CObexHeaderSet::CopyL()
- {
- LOG_LINE
- LOG_FUNC
-
- CObexHeaderSet* newHeaderSet = new(ELeave) CObexHeaderSet();
- CleanupStack::PushL(newHeaderSet);
-
- TInt maxHeader = iHeaders.Count();
- for (TInt pos = 0; pos < maxHeader; pos++)
- {
- CObexHeader* newHeader = iHeaders[pos]->CopyL();
- CleanupStack::PushL(newHeader);
- LEAVEIFERRORL(newHeaderSet->iHeaders.Append(newHeader));
- CleanupStack::Pop(newHeader);
- }
-
- CleanupStack::Pop(newHeaderSet);
- return newHeaderSet;
- }
-
-/**
-Copies interesting headers from an existing CObexHeaderSet to populate a new object.
-@param aHeaderCheck The object to use to filter headers of interest.
-@return A new CObexHeaderSet object with the desired headers.
- This method returns ownership of the new object.
-@publishedAll
-@released
-*/
-EXPORT_C CObexHeaderSet* CObexHeaderSet::CopyL(MObexHeaderCheck& aHeaderCheck)
- {
- LOG_LINE
- LOG_FUNC
-
- CObexHeaderSet* newHeaderSet = new(ELeave) CObexHeaderSet();
- CleanupStack::PushL(newHeaderSet);
-
- aHeaderCheck.Reset();
-
- TInt maxHeader = iHeaders.Count();
- for (TInt pos = 0; pos < maxHeader; pos++)
- {
- CObexHeader* header = iHeaders[pos];
-
- if (aHeaderCheck.Interested(header->HI()))
- {
- CObexHeader* newHeader = header->CopyL();
- CleanupStack::PushL(newHeader);
- LEAVEIFERRORL(newHeaderSet->iHeaders.Append(newHeader));
- CleanupStack::Pop(newHeader);
- }
- }
-
- CleanupStack::Pop(newHeaderSet);
- return newHeaderSet;
- }
-
-/**
-Constructor
-*/
-CObexHeaderSet::CObexHeaderSet()
- {
- }
-
-/**
-Destructor
-This method deletes each individual item that the pointer array
-points at.
-
-@internalComponent
-*/
-CObexHeaderSet::~CObexHeaderSet()
- {
- iHeaders.ResetAndDestroy();
- }
-
-/**
-Adds a header to the set.
-@param aHeader pointer to the header to be added. Ownership is transferred on a
- successful addition.
-@return A standard error code giving the results of the insertion.
-
-@publishedAll
-@released
-*/
-EXPORT_C TInt CObexHeaderSet::AddHeader(CObexHeader* aHeader)
- {
- LOG_LINE
- LOG_FUNC
-
- TInt ret = iHeaders.Append(aHeader);
-
- return ret;
- }
-
-/**
-Deletes the current header from the headerset.
-
-@publishedAll
-@released
- */
-EXPORT_C void CObexHeaderSet::DeleteCurrentHeader()
- {
- LOG_LINE
- LOG_FUNC
-
- if ((iPos >= 0) && (iPos < iHeaders.Count()))
- {
- delete iHeaders[iPos];
- iHeaders.Remove(iPos);
- }
-
- First();
- }
-
-/**
-Sets a header mask. Functions will only return values which the
-mask claims are interesting. The only 'accessor' functions which
-ignore this mask are the NewL overloads which copy an existing
-header set.
-
-The object defaults to a mask where all headers are considered
-interesting. Passing in a null parameter reverts to this behaviour.
-
-@param aMask The mask to use.
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeaderSet::SetMask(MObexHeaderCheck* aMask)
- {
- LOG_LINE
- LOG_FUNC
-
- iMask = aMask;
- First();
- }
-
-/**
-Removes from this header set any headers which the mask claims are
-not interesting. The position of the iterator is reset to the first
-remaining header.
-The mask will get reset to zero at the end of this method.
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeaderSet::DeleteMasked()
- {
- LOG_LINE
- LOG_FUNC
-
- First();
-
- if (!iMask)
- {
- return;
- }
-
- TInt count = iHeaders.Count();
- for (TInt pos = 0; pos < count; /*no iterative step*/)
- {
- TUint8 hi = iHeaders[pos]->HI();
- if (!iMask->Interested(hi))
- {
- delete iHeaders[pos];
- iHeaders.Remove(pos);
- //do not increment pos as old [pos+1] element is now stored in [pos]
- count--;
- }
- else
- {
- pos++;
- }
- }
-
- iMask = 0;
-
- First();
- }
-
-/**
-Resets the mask, then advances the iterator to the first interesting header.
-
-@publishedAll
-@released
-*/
-EXPORT_C void CObexHeaderSet::First() const
- {
- LOG_LINE
- LOG_FUNC
-
- iPos = 0;
-
- if (iMask)
- {
- iMask->Reset();
- }
-
- if (Next(0) == KErrNotFound)
- {
- iPos = -1;
- }
- }
-
-/**
-Links the supplied header to the same underlying header that is used by the
-iterator's current header.
-@param aHeader The header object to populate.
-@return KErrNotFound if the iterator is not currently pointing to a valid
- header.
-@publishedAll
-@released
-*/
-EXPORT_C TInt CObexHeaderSet::This(CObexHeader* aHeader) const
- {
- LOG_LINE
- LOG_FUNC
-
- if (iPos < 0)
- {
- return KErrNotFound;
- }
-
- aHeader->Set(iHeaders[iPos]);
- return KErrNone;
- }
-
-/**
-Advances the iterator to the next interesting header, skipping over the current header before
-starting to search.
-@return KErrNotFound if there are no more interesting headers in the set.
-@publishedAll
-@released
-*/
-EXPORT_C TInt CObexHeaderSet::Next() const
- {
- return Next(1);
- }
-
-/**
-Advances the iterator to the next interesting header, skipping over aSkip headers before
-starting to search.
-@param aSkip The minimum number of headers to move on from the current position,
-independant of whether a mask has been set or not.
-A value of zero therefore makes Next() essentially a no-op but presents the current
-header to the header filter again.
-@return KErrNotFound if there are no more interesting headers in the set.
-@publishedAll
-@released
-*/
-EXPORT_C TInt CObexHeaderSet::Next(TInt aSkip) const
- {
- // Don't log this function as it's too verbose.
- //LOG_LINE
- //LOG_FUNC
-
- iPos += aSkip;
- TInt count = iHeaders.Count();
-
- if (iMask)
- {
- for (; iPos < count; iPos++)
- {
- TUint8 hi = iHeaders[iPos]->HI();
- if (iMask->Interested(hi))
- break;
- }
- }
-
- if (iPos >= count)
- {
- iPos = -1;
- }
-
- return (iPos < 0) ? KErrNotFound : KErrNone;
- }
-
-/**
-Returns the total number of headers in this set, ie. ignores the mask.
-@return Count of the total number of headers (masked and unmasked) in this set.
-@released
-*/
-EXPORT_C TInt CObexHeaderSet::Count() const
- {
- LOG_LINE
- LOG_FUNC
-
- return iHeaders.Count();
- }
-
-/**
-Returns the first instance of the header with the required HI value
-by inserting it into the supplied CObexHeader object. This uses the
-standard iterator functionality, so is limited by the current mask, and
-starts from the current iterator position.
-@param aHI The header to search for. Consult the Obex specification for values.
-@param aHeader The header object to populate.
-@return KErrNotFound if the header was not present.
-*/
-EXPORT_C TInt CObexHeaderSet::Find(TUint8 aHI, CObexHeader& aHeader) const
- {
- LOG_LINE
- LOG_FUNC
-
- if (iPos >= iHeaders.Count())
- {
- // Already searched all available headers
- return KErrNotFound;
- }
-
- if (iPos >= 0)
- {
- TUint8 hi = iHeaders[iPos]->HI();
- TInt err = KErrNone;
- while ((err == KErrNone) &&
- (hi != aHI))
- {
- err = Next();
- if (err == KErrNone)
- {
- hi = iHeaders[iPos]->HI();
- }
- }
-
- if (hi == aHI)
- {
- aHeader.Set(iHeaders[iPos]);
- return KErrNone;
- }
- else
- {
- return KErrNotFound;
- }
- }
- else
- {
- return KErrNotFound;
- }
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexheaderutil.cpp
--- a/obex/obexprotocol/obex/src/obexheaderutil.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,209 +0,0 @@
-// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include
-#include
-#include "obexheaderutil.h"
-
-/**
-This function wraps the potential leaving CreateAndSetUnicodeHeaderL function in a
-handy TRAP, because all the functions that call it are non-leavers.
-
-@param aHI is the Header Information byte for this new header (2 MSBits should indicate a Unicode header)
-@param aUnicode is the Header Value for this new header
-
-@return A pointer to a new CObexHeader, or NULL if the construction failed.
-*/
-CObexHeader* IrOBEXHeaderUtil::CreateAndSetUnicodeHeader(const TUint8 aHI, const TDesC16& aUnicode)
- {
- CObexHeader* header = NULL;
- TRAP_IGNORE(header = CreateAndSetUnicodeHeaderL(aHI, aUnicode));
- return header;
- }
-
-/**
-Creates a new Unicode header, with value as specified by aHI and aUnicode. This function will
-leave if construction of the header fails.
-
-@param aHI is the Header Information byte for this new header (2 MSBits should indicate a Unicode header)
-@param aUnicode is the Header Value for this new header
-
-@return A pointer to a new CObexHeader.
-*/
-CObexHeader* IrOBEXHeaderUtil::CreateAndSetUnicodeHeaderL(const TUint8 aHI, const TDesC16& aUnicode)
- {
- CObexHeader* header = CObexHeader::NewL();
- CleanupStack::PushL(header);
- header->SetUnicodeL(aHI, aUnicode);
- CleanupStack::Pop(header);
- return header;
- }
-
-/**
-This function wraps the potential leaving CreateAndSetByteSeqHeaderL function in a
-handy TRAP, because all the functions that call it are non-leavers.
-
-@param aHI is the Header Information byte for this new header (2 MSBits should indicate a Unicode header)
-@param aByteSeq is the Header Value for this new header
-
-@return A pointer to a new CObexHeader, or NULL if the construction failed.
-*/
-CObexHeader* IrOBEXHeaderUtil::CreateAndSetByteSeqHeader(const TUint8 aHI, const TDesC8& aByteSeq)
- {
- CObexHeader* header = NULL;
- TRAP_IGNORE(header = CreateAndSetByteSeqHeaderL(aHI, aByteSeq));
- return header;
- }
-
-/**
-Creates a new Byte Sequence header, with value as specified by aHI and aByteSeq. This function will
-leave if construction of the header fails.
-
-@param aHI is the Header Information byte for this new header (2 MSBits should indicate a Unicode header)
-@param aByteSeq is the Header Value for this new header
-
-@return A pointer to a new CObexHeader.
-*/
-CObexHeader* IrOBEXHeaderUtil::CreateAndSetByteSeqHeaderL(const TUint8 aHI, const TDesC8& aByteSeq)
- {
- CObexHeader* header = CObexHeader::NewL();
- CleanupStack::PushL(header);
- header->SetByteSeqL(aHI, aByteSeq);
- CleanupStack::Pop(header);
- return header;
- }
-
-TInt IrOBEXHeaderUtil::ParseHeader(TObexInternalHeader& aHeader, CObexHeaderSet& aHeaderSet)
- {
- TUint headerType = aHeader.HIType();
-
- switch (headerType)
- {
- case (TObexInternalHeader::EUnicode) :
- {
- HBufC* newHeader = HBufC::New(aHeader.HVSize());
- if (!newHeader)
- {
- return KErrNoMemory;
- }
- //else
- TPtr ptr(newHeader->Des());
-
- if(aHeader.GetHVText(ptr) == KErrNone)
- {
- CObexHeader* unicodeHeader = NULL;
-
- unicodeHeader = IrOBEXHeaderUtil::CreateAndSetUnicodeHeader(aHeader.HI(), *newHeader);
-
- if (!unicodeHeader)
- {
- delete newHeader;
- newHeader = NULL;
- return KErrNoMemory;
- }
-
- //Transfer ownership of pointer to CObexHeaderSet
- if (aHeaderSet.AddHeader(unicodeHeader) != KErrNone)
- {
- delete newHeader;
- newHeader = NULL;
- delete unicodeHeader;
- unicodeHeader = NULL;
- return KErrNoMemory;
- }
- }
- delete newHeader;
- newHeader = NULL;
-
- break;
- }
-
- case (TObexInternalHeader::EByteSeq) :
- {
- TPtrC8 src(aHeader.HVByteSeq(), aHeader.HVSize());
-
- CObexHeader* byteseqHeader = NULL;
-
- byteseqHeader = IrOBEXHeaderUtil::CreateAndSetByteSeqHeader(aHeader.HI(), src);
- if (!byteseqHeader)
- {
- return KErrNoMemory;
- }
-
- //Transfer ownership of pointer to CObexHeaderSet
- if (aHeaderSet.AddHeader(byteseqHeader) != KErrNone)
- {
- delete byteseqHeader;
- byteseqHeader = NULL;
- return KErrNoMemory;
- }
-
- break;
- }
-
- case (TObexInternalHeader::E1Byte) :
- {
- CObexHeader* byteHeader = NULL;
- TRAPD(err, byteHeader=CObexHeader::NewL());
- if (err)
- {
- return err;
- }
-
- byteHeader->SetByte(aHeader.HI(), (static_cast(aHeader.HVInt())));
- //Transfer ownership of pointer to CObexHeaderSet
- if(aHeaderSet.AddHeader(byteHeader) != KErrNone)
- {
- delete byteHeader;
- byteHeader = NULL;
- return KErrNoMemory;
- }
- break;
- }
-
- case (TObexInternalHeader::E4Byte) :
- {
- CObexHeader* fourByteHeader = NULL;
- TRAPD(err, fourByteHeader = CObexHeader::NewL());
- if (err)
- {
- return err;
- }
-
- fourByteHeader->SetFourByte(aHeader.HI(), aHeader.HVInt());
- //Transfer ownership of pointer to CObexHeaderSet
- if(aHeaderSet.AddHeader(fourByteHeader) != KErrNone)
- {
- delete fourByteHeader;
- fourByteHeader = NULL;
- return KErrNoMemory;
- }
- break;
- }
-
- default :
- {
- break;
- }
-
- } // End of switch
-
- return KErrNone;
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexnotifyhandlerbase.cpp
--- a/obex/obexprotocol/obex/src/obexnotifyhandlerbase.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,66 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-#include
-#include "obexnotifyhandlerbase.h"
-
-/**
-@file
-@released
-@internalComponent
-*/
-
-/** Constructor.
-
-@param aObex The object to pass notifications to.
-*/
-CObexNotifyHandlerBase::CObexNotifyHandlerBase(CObex& aObex)
- : iObex(aObex)
- {
- }
-
-/** Passes on Process notification.
-
-@param aPacket The packet to pass on to the CObex that will
- handle this notification.
-*/
-void CObexNotifyHandlerBase::Process(CObexPacket& aPacket)
- {
- iObex.NotifyProcess(aPacket);
- }
-
-/** Passes on Error notification.
-
-@param aError The error to pass on to the CObex that will
- handle this notification.
-*/
-void CObexNotifyHandlerBase::Error(TInt aError)
- {
- iObex.NotifyError(aError);
- }
-
-/** Passes on TransportUp notification.
-*/
-void CObexNotifyHandlerBase::TransportUp()
- {
- iObex.NotifyTransportUp();
- }
-
-/** Passes on TransportDown notification.
-*/
-void CObexNotifyHandlerBase::TransportDown(TBool aForceTransportDeletion)
- {
- iObex.NotifyTransportDown(aForceTransportDeletion);
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexnotifyhandlerclient.cpp
--- a/obex/obexprotocol/obex/src/obexnotifyhandlerclient.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @released
- @internalComponent
-*/
-
-#include "obexnotifyhandlerclient.h"
-
-/** Constructor.
-
-@param aObex The CObexClient to pass notifications onto.
-*/
-CObexNotifyHandlerClient::CObexNotifyHandlerClient(CObexClient& aObex)
- : CObexNotifyHandlerBase(aObex)
- {
- }
-
-/** Signals that a packet process event has occurred.
-
-@param aEvent The event that has occurred.
-*/
-void CObexNotifyHandlerClient::SignalPacketProcessEvent(TObexPacketProcessEvent aEvent)
- {
- (static_cast(iObex)).SignalPacketProcessEvent(aEvent);
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexnotifyhandlerserver.cpp
--- a/obex/obexprotocol/obex/src/obexnotifyhandlerserver.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @released
- @internalComponent
-*/
-
-#include "obexnotifyhandlerserver.h"
-
-/** Constructor.
-
-@param aObex The CObexServer to pass notifications onto.
-*/
-CObexNotifyHandlerServer::CObexNotifyHandlerServer(CObexServer& aObex)
- : CObexNotifyHandlerBase(aObex)
- {
- }
-
-/** Signals that a packet process event has occurred.
-
-@param aEvent The event that has occurred.
-*/
-void CObexNotifyHandlerServer::SignalPacketProcessEvent(TObexPacketProcessEvent aEvent)
- {
- (static_cast(iObex)).SignalPacketProcessEvent(aEvent);
- }
diff -r 866b4af7ffbe -r 4dc88a4ac6f4 obex/obexprotocol/obex/src/obexobjectexpandedbaseobject.cpp
--- a/obex/obexprotocol/obex/src/obexobjectexpandedbaseobject.cpp Tue Sep 28 20:14:08 2010 +0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2361 +0,0 @@
-// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
-// All rights reserved.
-// This component and the accompanying materials are made available
-// under the terms of "Eclipse Public License v1.0"
-// which accompanies this distribution, and is available
-// at the URL "http://www.eclipse.org/legal/epl-v10.html".
-//
-// Initial Contributors:
-// Nokia Corporation - initial contribution.
-//
-// Contributors:
-//
-// Description:
-//
-
-/**
- @file
- @internalComponent
-*/
-
-#include
-#include
-#include