bluetoothcommsprofiles/btpan/bnep/CBnepChannelController.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2004-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 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef __CBNEPCHANNELCONTROLLER_H
       
    22 #define __CBNEPCHANNELCONTROLLER_H 
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32def.h>
       
    26 #include "MLinkManager.h"
       
    27 #include "BnepTypes.h"
       
    28 #include "RBnepNotUnderstoodResponseControl.h"
       
    29 #include "CMultiAddrFilterTable.h"
       
    30 #include "CNetTypeFilterTable.h"
       
    31 #include "panroles.h"
       
    32 #include "pancommon.h"
       
    33 
       
    34 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
    35 #include <elements/nm_node.h>
       
    36 #include <comms-infras/ss_common.h>
       
    37 #include <comms-infras/ss_nodeinterfaces.h>
       
    38 #endif
       
    39 
       
    40 class CBnepLink;
       
    41 class RBnepSetupConnectionResponseControl;
       
    42 class RBnepSetupConnectionRequestControl;
       
    43 class CBnepBridge;
       
    44 class RBnepFilterMultiAddrResponseControl;
       
    45 class RBnepFilterMultiAddrSetRequestControl;
       
    46 class RBnepFilterNetTypeResponseControl;
       
    47 class RBnepFilterNetTypeSetRequestControl;
       
    48 class RInternalSocket;
       
    49 
       
    50 
       
    51 /**
       
    52 Provides a controller to a BNEP channel to a single remote device.
       
    53 @internalComponent
       
    54 */
       
    55 NONSHARABLE_CLASS(CBnepChannelController) : public CBase,
       
    56 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
    57     public Messages::ASimpleNodeIdBase,
       
    58 #endif
       
    59     public MBnepChannelControl, 
       
    60     public MLinkManager 
       
    61     {
       
    62 public:
       
    63 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
    64     static CBnepChannelController* NewL (CBnepBridge& aBridge, RInternalSocket& aConnectedSocket, const Messages::TNodeId& aNotify, CPacketDriverOwner& aPktDrvOwner);
       
    65 #else
       
    66     static CBnepChannelController* NewL (CBnepBridge& aBridge, RInternalSocket& aConnectedSocket, MPanConnectionNotify& aNotify);
       
    67 #endif
       
    68 
       
    69     ~CBnepChannelController();
       
    70 
       
    71     void BnepRoleRequestFromLocalDevice (TBluetoothPanRole aRequestedLocalRole, TBluetoothPanRole aRequestedRemoteRole);
       
    72     void BnepRoleResponseFromLocalDevice (TBnepSetupConnectionResponseMessage aRoleResponseCode);
       
    73     void Close ();
       
    74     void Execute (RBnepControl* aControl);
       
    75     void RemoteDeviceDisconnect (TInt aError);
       
    76 	void SetUplinkAccessAllowedForBnepLink(TBool aAllowed);
       
    77 
       
    78 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
    79 protected:
       
    80     // From ESock::MCFNode, via ESock::ACFNodeIdBase
       
    81 	void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aCFMessage);
       
    82 #endif
       
    83 	
       
    84 private:
       
    85 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
    86     CBnepChannelController (const Messages::TNodeId& aNotify, CPacketDriverOwner& aPktDrvOwner);
       
    87 #else
       
    88     CBnepChannelController (MPanConnectionNotify& aNotify);
       
    89 #endif
       
    90     void ConstructL (CBnepBridge& aBridge, RInternalSocket& aConnectedSocket);
       
    91 
       
    92     void Handle (RBnepSetupConnectionRequestControl* aSetupRequest);
       
    93     void Handle (RBnepSetupConnectionResponseControl* aSetupResponse);
       
    94     void Handle (RBnepFilterNetTypeSetRequestControl* aFilterNetTypeSetRequest);
       
    95     void Handle (RBnepFilterNetTypeResponseControl* aFilterNetTypeResponse);
       
    96     void Handle (RBnepFilterMultiAddrSetRequestControl* aFilterMultiAddrSetRequest);
       
    97     void Handle (RBnepFilterMultiAddrResponseControl* aFilterMultiAddrResponse);
       
    98     void HandleUnknownCommandPacket (RBnepControl* aControl);
       
    99 
       
   100 	void CreateAndQueueConnectionSetupRequestL(TBluetoothPanRole aRequestedLocalRole, TBluetoothPanRole aRequestedRemoteRole);
       
   101 	void CreateAndQueueConnectionSetupResponseL(TBnepSetupConnectionResponseMessage aRoleResponseCode);
       
   102 	void CreateAndQueueNotUnderstoodResponseL(TUint8 aControlType);
       
   103 	void CreateAndQueueFilterNetTypeResponseL(TFilterNetTypeResponse aResponse);
       
   104 	void CreateAndQueueFilterMultiAddrResponseL(TFilterMultiAddrResponse aResponse);
       
   105 
       
   106 private: 
       
   107 #ifdef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY
       
   108     Messages::TNodeId iPanConnectionNotify;
       
   109 	CPacketDriverOwner& iPktDrvOwner;
       
   110 #else
       
   111     MPanConnectionNotify& iNotify;
       
   112 #endif
       
   113 	
       
   114 	static TInt ProceedCb(TAny* aPtr);
       
   115 	void Proceed();
       
   116 
       
   117 private:
       
   118     CBnepLink* 			iLink;
       
   119 	CAsyncCallBack*		iProceedCallBack;
       
   120     };
       
   121 
       
   122 #endif
       
   123