bluetoothcommsprofiles/btpan/inc/BnepPacketNotifier.h
changeset 0 29b1cd4cb562
equal deleted inserted replaced
-1:000000000000 0:29b1cd4cb562
       
     1 // Copyright (c) 2006-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  @publishedPartner
       
    19  @released
       
    20 */
       
    21 
       
    22 #ifndef __BNEPPACKETNOTIFIER_H
       
    23 #define __BNEPPACKETNOTIFIER_H
       
    24 
       
    25 #include <bttypes.h>
       
    26 
       
    27 const TUid KUidBnepPacketNotifierV1 = { 0x10282665 };
       
    28 const TUid KUidPanLinkControlV1 = { 0x10282666 };
       
    29 
       
    30 /**
       
    31 Record to store information about amount of data transferred by BNEP
       
    32 */
       
    33 class TBnepBytesTransferred
       
    34 	{
       
    35 public:
       
    36 	/**
       
    37 	Number of Bytes Received on this link since the last call of MbpnBnepDataTransferred
       
    38 	*/
       
    39 	TUint iBytesReceived;
       
    40 
       
    41 	/**
       
    42 	Number of Bytes Sent on this link since the last call of MbpnBnepDataTransferred
       
    43 	*/
       
    44 	TUint iBytesSent;
       
    45 
       
    46 	/**
       
    47 	Bluetooth address of this link
       
    48 	*/
       
    49 	TBTDevAddr iBTDevAddr;
       
    50 	};
       
    51 
       
    52 class MPanLinkControlBase
       
    53 	{
       
    54 public:
       
    55 	/**
       
    56 	Called by the policy DLL to get a pointer to the pan link control interface
       
    57 	implemented by PAN with UID aInterface. This is a mechanism for allowing future 
       
    58 	change to the PAN LPM API without breaking BC in existing (non-updated) 
       
    59 	LPM policy plugins.
       
    60 	@param aInterface UID of the interface to return
       
    61     @return Pointer to the interface
       
    62 */
       
    63 	virtual TAny* MplcbGetInterface(const TUid & aInterface) = 0;
       
    64 	};
       
    65 
       
    66 /**
       
    67 Interface implemented by the PAN profile to control low power mode
       
    68 */
       
    69 class MPanLinkControl: public MPanLinkControlBase
       
    70 	{
       
    71 public:
       
    72 	/**
       
    73 	Called to Request Sniff mode
       
    74 	@param aAddr Bluetooth Device address of the link to be put into sniff mode
       
    75 	@return Error code
       
    76 	*/
       
    77 	virtual TInt MplcRequestSniff(const TBTDevAddr& aAddr) = 0;
       
    78 
       
    79 	/**
       
    80 	Called to Request Active mode
       
    81 	@param aAddr Bluetooth Device address of the link to be put into active mode
       
    82 	@return Error code
       
    83 	*/
       
    84 	virtual TInt MplcRequestActive(const TBTDevAddr& aAddr) = 0;
       
    85 
       
    86 	};
       
    87 
       
    88 class MBnepPacketNotifierBase
       
    89 	{
       
    90 public:
       
    91 	/**
       
    92 	Called by BNEP bridge to get a pointer to an object which implements the 
       
    93 	LPM policy interface with UID aInterace. This is a mechanism for allowing future 
       
    94 	change to the BNEP LPM API without breaking BC in existing (non-updated) 
       
    95 	policies.
       
    96 	@param aInterface UID of interface requested
       
    97 	@return Pointer to the LPM policy interface
       
    98 	*/
       
    99 	virtual TAny* MbpnbGetInterface(const TUid & aInterface) = 0;
       
   100 	
       
   101 	/**
       
   102 	Called by BNEP bridge to signal to the LPM policy that it can be destroyed
       
   103 	*/
       
   104 	
       
   105 	virtual void MbpnbRelease() = 0;
       
   106 	
       
   107 	};
       
   108 /**
       
   109 Interface to be implemented by low power mode policy plugins for PAN
       
   110 */
       
   111 class MBnepPacketNotifier: public MBnepPacketNotifierBase
       
   112 	{
       
   113 public:
       
   114 	/**
       
   115 	Called by BNEP every 2 seconds with information of how much data has been transferred in that time.
       
   116 	If no data is transferred for 20 seconds, this will stop being called.
       
   117 	@param aBnepBytesTransferred Array of TBnepBytesTransferred, with information of number of bytes sent and received to each physical link
       
   118 	*/
       
   119 	virtual void MbpnBnepDataTransferred(const TArray<TBnepBytesTransferred> & aBnepBytesTransferred) = 0;
       
   120 	
       
   121 	/**
       
   122 	Called by BNEP to set the MPanLinkControlBase interface, which can be called to control sniff mode
       
   123 	@param aPanLinkControl Reference to MPanLinkControl which will be implemented by the PAN profile
       
   124 	*/
       
   125 	virtual void MbpnSetLinkControl(MPanLinkControlBase& aPanLinkControl) = 0;
       
   126 	
       
   127 	/**
       
   128 	Called by BNEP when a new device is added
       
   129 	@param aAddr Bluetooth device address for the new device
       
   130 	*/
       
   131 	virtual void MbpnDeviceAdded(const TBTDevAddr& aAddr) = 0;
       
   132 	
       
   133 	/**
       
   134 	Called by BNEP when a device is removed
       
   135 	@param aAddr Bluetooth device address of the removed device
       
   136 	*/
       
   137 	virtual void MbpnDeviceRemoved(const TBTDevAddr& aAddr) = 0;
       
   138 	};
       
   139 
       
   140 
       
   141 
       
   142 #endif