obex/obexprotocol/obex/src/TObexServerStateWaitForUserPassword.cpp
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include <obex.h>
       
    17 #include "obexserverstatemachine.h"
       
    18 
       
    19 /**
       
    20 @file
       
    21 @internalComponent
       
    22 
       
    23 CONNECT Operation Wait State
       
    24 This waits for the authentication state machine to receive a password from the user (CObexServer::UserPasswordL) which is indicated by ConnectionComplete
       
    25 
       
    26 Any OBEX operation will be cause a Protocol Error (which will then cause a reset event)
       
    27 Changing the MObexServerNotifyAsync via CObexServer::Start() will cause a Panic
       
    28 A Reset event (Protocol Error, Server Stop, Transport Down) will cause a transition to Disconnected
       
    29 */
       
    30 
       
    31 TObexServerStateWaitForUserPassword::TObexServerStateWaitForUserPassword()
       
    32 	{
       
    33 #ifdef __FLOG_ACTIVE
       
    34 	_LIT8(KName, "WaitForUserPassword");
       
    35 	iName = KName;
       
    36 #endif
       
    37 	}
       
    38 
       
    39 void TObexServerStateWaitForUserPassword::Connect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
       
    40 	{
       
    41 	// Raise Protocol Error (no way to cancel the password request notification)
       
    42 	aContext.Owner().Error(KErrIrObexPacketDuringWait);
       
    43 	}
       
    44 
       
    45 void TObexServerStateWaitForUserPassword::Disconnect(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
       
    46 	{
       
    47 	// Raise Protocol Error (no way to cancel the password request notification)
       
    48 	aContext.Owner().Error(KErrIrObexPacketDuringWait);
       
    49 	}
       
    50 
       
    51 void TObexServerStateWaitForUserPassword::Put(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
       
    52 	{
       
    53 	// Raise Protocol Error (no way to cancel the password request notification)
       
    54 	aContext.Owner().Error(KErrIrObexPacketDuringWait);
       
    55 	}
       
    56 
       
    57 void TObexServerStateWaitForUserPassword::Get(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
       
    58 	{
       
    59 	// Raise Protocol Error (no way to cancel the password request notification)
       
    60 	aContext.Owner().Error(KErrIrObexPacketDuringWait);
       
    61 	}
       
    62 
       
    63 void TObexServerStateWaitForUserPassword::SetPath(CObexServerStateMachine& aContext, CObexPacket& /*aPacket*/)
       
    64 	{
       
    65 	// Raise Protocol Error (no way to cancel the password request notification)
       
    66 	aContext.Owner().Error(KErrIrObexPacketDuringWait);
       
    67 	}
       
    68 
       
    69 void TObexServerStateWaitForUserPassword::Abort(CObexServerStateMachine& aContext)
       
    70 	{
       
    71 	// Raise Protocol Error (no way to cancel the password request notification)
       
    72 	aContext.Owner().Error(KErrIrObexPacketDuringWait);
       
    73 	}
       
    74 	
       
    75 void TObexServerStateWaitForUserPassword::OverrideRequestHandling(CObexServerStateMachine& aContext, TObexResponse /*aResponse*/)
       
    76 	{
       
    77 	// Raise Protocol Error (no way to cancel the password request notification)
       
    78 	aContext.Owner().Error(KErrIrObexPacketDuringWait);
       
    79 	}
       
    80 
       
    81 void TObexServerStateWaitForUserPassword::Start(CObexServerStateMachine& /*aContext*/)
       
    82 	{
       
    83 	// Panic - trying to change interface during wait
       
    84 	IrOBEXUtil::Panic(EChangeInterfaceDuringWait);
       
    85 	}
       
    86 
       
    87 void TObexServerStateWaitForUserPassword::ConnectionComplete(CObexServerStateMachine& aContext)
       
    88 	{
       
    89 	// Move to Ready
       
    90 	aContext.ChangeState(CObexServerStateMachine::EReady);
       
    91 	}
       
    92