bluetoothcommsprofiles/btpan/bnep/MPanDevice.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 19 Feb 2010 23:56:55 +0200
branchRCL_3
changeset 8 2b6718f05bdb
parent 0 29b1cd4cb562
permissions -rw-r--r--
Revision: 201001 Kit: 201007

// Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
// which accompanies this distribution, and is available
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
//
// Initial Contributors:
// Nokia Corporation - initial contribution.
//
// Contributors:
//
// Description:
//

/**
 @file
 @internalComponent
*/

#ifndef __MPANDEVICE_H
#define __MPANDEVICE_H 


#include <bttypes.h>
#include "MPanDeviceOwner.h"
#include "RBnepFrame.h"

class MPanDevice 
    {
public:
    const TBTDevAddr& Addr () const;
    TBool ForThisDevice (const TBTDevAddr& aAddr) const;
    const TBTDevAddr& LocalAddr () const;
    virtual void Process (RBnepFrame& aPayload) = 0;
    void SetOwner (MPanDeviceOwner& aBridge);
    virtual void Stop () = 0;
    void SetOwnerCountPtr(TBnepBytesTransferred* aOwnerCountPtr);
public:
    TBTDevAddr iAddr;
protected:
    MPanDeviceOwner *iOwner;
    TBnepBytesTransferred* iOwnerCountPtr;
    };

inline const TBTDevAddr& MPanDevice::Addr () const
    {
    return iAddr;
    }

inline TBool MPanDevice::ForThisDevice (const TBTDevAddr& aAddr) const
    {
    return (iAddr == aAddr);
    }

inline const TBTDevAddr& MPanDevice::LocalAddr () const
    {
    return iOwner->DefaultAddress();
    }

inline void MPanDevice::SetOwner (MPanDeviceOwner& aBridge)
    {
    iOwner = &aBridge;
    }

inline void MPanDevice::SetOwnerCountPtr(TBnepBytesTransferred* aOwnerCountPtr)
	{
 	iOwnerCountPtr = aOwnerCountPtr;
	}
 


#endif