bluetoothcommsprofiles/btpan/bnep/CBnepLink.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 __CBNEPLINK_H
       
    22 #define __CBNEPLINK_H 
       
    23 
       
    24 #include <e32base.h>
       
    25 #include <e32def.h>
       
    26 #include <comms-infras/eintsock.h>
       
    27 #include "MLinkManager.h"
       
    28 #include "MPanDevice.h"
       
    29 #include "RBnepFrame.h"
       
    30 #include "bneputils.h"
       
    31 
       
    32 class CSocketReader;
       
    33 class CSocketWriter;
       
    34 class CNetTypeFilterTable;
       
    35 class CMultiAddrFilterTable;
       
    36 
       
    37 
       
    38 const TInt KBnepMTU = 1691;
       
    39 const TInt KErrLinkFlowedOff = 1;
       
    40 
       
    41 
       
    42 
       
    43 /**
       
    44    A remote device connected to the bridge by BNEP.
       
    45    There will be zero or more of these linked to the bridge, plus the local device.
       
    46 */
       
    47 NONSHARABLE_CLASS(CBnepLink) : public CBase, 
       
    48                   public MPanDevice  
       
    49     {
       
    50 public:
       
    51     ~CBnepLink();
       
    52     static CBnepLink* NewL (MPanDeviceOwner& aBridge, RInternalSocket& aSocket, MLinkManager& aParser);
       
    53     void Process (RBnepFrame& aFrame);
       
    54     void QueueOnOutput (RBnepControl* aCommand);
       
    55     void ReadComplete (RMBufChain& aChain);
       
    56     void RemoteDeviceDisconnect (TInt aError);
       
    57     void ResumeDataTransfer ();
       
    58 	void RemoteDeviceReady();
       
    59     TInt SendFrame (RBnepFrame& aFrame);
       
    60     void SuspendDataTransfer ();
       
    61     void Install (CMultiAddrFilterTable* aFilterTable);
       
    62     void Install (CNetTypeFilterTable* aFilterTable);
       
    63     void Proceed ();
       
    64     void Stop ();
       
    65     void Invalidate ();
       
    66 	void UpdateOwnerCount(TInt aReceivedCount, TInt aSentCount);
       
    67 
       
    68 	void SetUplinkAccessAllowedForBnepLink(TBool aAllowed);
       
    69 	
       
    70 private:
       
    71     CBnepLink (MPanDeviceOwner& aBridge, RInternalSocket& aSocket, MLinkManager& aParser);
       
    72     void ConstructL ();
       
    73 
       
    74 private:
       
    75     // Data Members for Class Attributes
       
    76     MLinkManager& iLinkManager;
       
    77     TBool iNegotiating;
       
    78     
       
    79 private: 
       
    80     // Data Members for Has Relationships
       
    81     RInternalSocket iSocket;
       
    82     CSocketReader* iReader;
       
    83     CSocketWriter* iWriter;
       
    84     CMultiAddrFilterTable* iMultiAddrFilters;
       
    85     CNetTypeFilterTable* iNetTypeFilters;
       
    86     RBnepFrame iOutgoing;
       
    87     RBnepFrame iIncoming;
       
    88     TBool iInvalid;
       
    89     
       
    90 	TBool iUplinkAccessAllowed;
       
    91     };
       
    92 
       
    93 
       
    94 #endif