obex/obexprotocol/obexbttransport/inc/ObexRfcommConnector.h
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 #ifndef OBEXRFCOMMCONNECTOR_H
       
    17 #define OBEXRFCOMMCONNECTOR_H
       
    18 
       
    19 #include <bt_sock.h>
       
    20 #include <obex/transport/obexconnector.h>
       
    21 #include "connectobserver.h"
       
    22 
       
    23 class CObexActiveRfcommConnector;
       
    24 class CObexListenerRfcommConnector;
       
    25 class MObexTransportNotify;
       
    26 class TObexBtTransportInfo;
       
    27 
       
    28 NONSHARABLE_CLASS(CObexRfcommConnector) : public CObexConnector,
       
    29 											public MConnectObserver
       
    30 	{
       
    31 public:
       
    32 	static CObexRfcommConnector* NewL(MObexTransportNotify& aOwner, 
       
    33 						 TBTSockAddr& aAddr);
       
    34 	~CObexRfcommConnector();
       
    35 
       
    36 public:
       
    37 	RSocket& GetSocket();
       
    38 
       
    39 private: 
       
    40 	CObexRfcommConnector(MObexTransportNotify& aOwner, 
       
    41 						 TBTSockAddr& aAddr);
       
    42 	void ConstructL();
       
    43 	
       
    44 private: // from CObexConnector
       
    45 	void ConnectL();
       
    46 	void CancelConnect();
       
    47 	void AcceptL();
       
    48 	void CancelAccept();
       
    49 	TBool BringTransportDown();
       
    50 	void SignalTransportError();
       
    51 	
       
    52 private: // from MConnectObserver
       
    53 	void ConnectComplete(TInt aError, TObexConnectionInfo& aSockinfo);
       
    54 
       
    55 private: // owned
       
    56 	CObexActiveRfcommConnector* iConnector;
       
    57 	CObexListenerRfcommConnector* iReceiver;
       
    58 	TBool iTransportUp;
       
    59 	RSocket iSocket;
       
    60 	RSocketServ iSocketServ;
       
    61 	TBTSockAddr& iAddr;
       
    62 	TProtocolDesc iProtocolDesc;
       
    63 	};
       
    64 
       
    65 #endif // OBEXRFCOMMCONNECTOR_H