bluetooth/btstack/linkmgr/ACLSAP.cpp
branchRCL_3
changeset 8 2b6718f05bdb
parent 0 29b1cd4cb562
child 22 9f17f914e828
child 32 f72906e669b4
equal deleted inserted replaced
4:28479eeba3fb 8:2b6718f05bdb
    58 	iStates[EWaitForStartError]		=new (ELeave) TACLLinkStateWaitForStartError(*this);
    58 	iStates[EWaitForStartError]		=new (ELeave) TACLLinkStateWaitForStartError(*this);
    59 	iStates[EWaitForStartParked]	=new (ELeave) TACLLinkStateWaitForStartParked(*this);
    59 	iStates[EWaitForStartParked]	=new (ELeave) TACLLinkStateWaitForStartParked(*this);
    60 	iStates[EOpen]					=new (ELeave) TACLLinkStateOpen(*this);
    60 	iStates[EOpen]					=new (ELeave) TACLLinkStateOpen(*this);
    61 	iStates[EOpenParked]			=new (ELeave) TACLLinkStateOpenParked(*this);
    61 	iStates[EOpenParked]			=new (ELeave) TACLLinkStateOpenParked(*this);
    62 	iStates[EClosing]				=new (ELeave) TACLLinkStateClosing(*this);
    62 	iStates[EClosing]				=new (ELeave) TACLLinkStateClosing(*this);
       
    63 	iStates[EAcceptingClosing]		=new (ELeave) TACLLinkStateAcceptingClosing(*this);
    63 	}
    64 	}
    64 
    65 
    65 CACLLinkStateFactory::~CACLLinkStateFactory()
    66 CACLLinkStateFactory::~CACLLinkStateFactory()
    66 	{
    67 	{
    67 	LOG_FUNC
    68 	LOG_FUNC
   430 
   431 
   431 void TACLLinkStateAccepting::Shutdown(CACLLink& aContext, CServProviderBase::TCloseType /*aCloseType*/) const
   432 void TACLLinkStateAccepting::Shutdown(CACLLink& aContext, CServProviderBase::TCloseType /*aCloseType*/) const
   432 	{
   433 	{
   433 	LOG_FUNC
   434 	LOG_FUNC
   434 	// we're not wanted - close
   435 	// we're not wanted - close
   435 	ChangeState(aContext, CACLLinkStateFactory::EClosing);
   436 	ChangeState(aContext, CACLLinkStateFactory::EAcceptingClosing);
   436 	}
   437 	}
   437 
   438 
   438 //----------------------------------------------------------------------------------
   439 //----------------------------------------------------------------------------------
   439 
   440 
   440 
   441 
   495 
   496 
   496 void TACLLinkStateWaitForStart::Shutdown(CACLLink& aContext, CServProviderBase::TCloseType /*aCloseType*/) const
   497 void TACLLinkStateWaitForStart::Shutdown(CACLLink& aContext, CServProviderBase::TCloseType /*aCloseType*/) const
   497 	{
   498 	{
   498 	LOG_FUNC
   499 	LOG_FUNC
   499 	// just go
   500 	// just go
   500 	ChangeState(aContext, CACLLinkStateFactory::EClosing);
   501 	ChangeState(aContext, CACLLinkStateFactory::EAcceptingClosing);
   501 	}
   502 	}
   502 
   503 
   503 //----------------------------------------------------------------------------------
   504 //----------------------------------------------------------------------------------
   504 
   505 
   505 TACLLinkStateWaitForStartError::TACLLinkStateWaitForStartError(CACLLinkStateFactory& aFactory)
   506 TACLLinkStateWaitForStartError::TACLLinkStateWaitForStartError(CACLLinkStateFactory& aFactory)
   864 	// This method is reached by receiving a Disconnection Complete Event with Status field != EOk,
   865 	// This method is reached by receiving a Disconnection Complete Event with Status field != EOk,
   865 	// in this case we don't want to error the socket - so instead it is just closed
   866 	// in this case we don't want to error the socket - so instead it is just closed
   866 	ChangeState(aContext, CACLLinkStateFactory::EClosed);
   867 	ChangeState(aContext, CACLLinkStateFactory::EClosed);
   867 	aContext.Socket()->CanClose();
   868 	aContext.Socket()->CanClose();
   868 	}
   869 	}
       
   870 
       
   871 //----------------------------------------------------------------------------------
       
   872 
       
   873 TACLLinkStateAcceptingClosing::TACLLinkStateAcceptingClosing(CACLLinkStateFactory& aFactory)
       
   874 : TACLLinkState(aFactory)
       
   875 	{
       
   876 	LOG_FUNC
       
   877 	STATENAME("AcceptingClosing");
       
   878 	}
       
   879 
       
   880 void TACLLinkStateAcceptingClosing::Shutdown(CACLLink& /*aContext*/, CServProviderBase::TCloseType /*aCloseType*/) const
       
   881 	{
       
   882 	LOG_FUNC
       
   883 	// we are!  just ignore and continue
       
   884 	}
       
   885 
       
   886 void TACLLinkStateAcceptingClosing::Deletion(CACLLink& aContext) const
       
   887 	{
       
   888 	LOG_FUNC
       
   889 	aContext.ListeningSAP()->RemoveChild(&aContext);
       
   890 	}
       
   891 
       
   892 void TACLLinkStateAcceptingClosing::Error(CACLLink& aContext, TInt /*aError*/) const
       
   893 	{
       
   894 	LOG_FUNC
       
   895 	// This method is reached by receiving a Disconnection Complete Event with Status field != EOk,
       
   896 	// in this case we don't want to error the socket - so instead it is just closed
       
   897 	aContext.ListeningSAP()->RemoveChild(&aContext);
       
   898 	ChangeState(aContext, CACLLinkStateFactory::EClosed);
       
   899 	aContext.Socket()->CanClose();
       
   900 	}
       
   901 
   869 
   902 
   870 //----------------------------------------------------------------------------------
   903 //----------------------------------------------------------------------------------
   871 
   904 
   872 TACLLinkStateClosed::TACLLinkStateClosed(CACLLinkStateFactory& aFactory)
   905 TACLLinkStateClosed::TACLLinkStateClosed(CACLLinkStateFactory& aFactory)
   873 : TACLLinkState(aFactory)
   906 : TACLLinkState(aFactory)