bluetoothcommsprofiles/btpan/bnep/MPanDevice.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 __MPANDEVICE_H
       
    22 #define __MPANDEVICE_H 
       
    23 
       
    24 
       
    25 #include <bttypes.h>
       
    26 #include "MPanDeviceOwner.h"
       
    27 #include "RBnepFrame.h"
       
    28 
       
    29 class MPanDevice 
       
    30     {
       
    31 public:
       
    32     const TBTDevAddr& Addr () const;
       
    33     TBool ForThisDevice (const TBTDevAddr& aAddr) const;
       
    34     const TBTDevAddr& LocalAddr () const;
       
    35     virtual void Process (RBnepFrame& aPayload) = 0;
       
    36     void SetOwner (MPanDeviceOwner& aBridge);
       
    37     virtual void Stop () = 0;
       
    38     void SetOwnerCountPtr(TBnepBytesTransferred* aOwnerCountPtr);
       
    39 public:
       
    40     TBTDevAddr iAddr;
       
    41 protected:
       
    42     MPanDeviceOwner *iOwner;
       
    43     TBnepBytesTransferred* iOwnerCountPtr;
       
    44     };
       
    45 
       
    46 inline const TBTDevAddr& MPanDevice::Addr () const
       
    47     {
       
    48     return iAddr;
       
    49     }
       
    50 
       
    51 inline TBool MPanDevice::ForThisDevice (const TBTDevAddr& aAddr) const
       
    52     {
       
    53     return (iAddr == aAddr);
       
    54     }
       
    55 
       
    56 inline const TBTDevAddr& MPanDevice::LocalAddr () const
       
    57     {
       
    58     return iOwner->DefaultAddress();
       
    59     }
       
    60 
       
    61 inline void MPanDevice::SetOwner (MPanDeviceOwner& aBridge)
       
    62     {
       
    63     iOwner = &aBridge;
       
    64     }
       
    65 
       
    66 inline void MPanDevice::SetOwnerCountPtr(TBnepBytesTransferred* aOwnerCountPtr)
       
    67 	{
       
    68  	iOwnerCountPtr = aOwnerCountPtr;
       
    69 	}
       
    70  
       
    71 
       
    72 
       
    73 #endif