epoc32/include/bluetooth/btbaseband.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/bluetooth/btbaseband.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,118 @@
     1.4 +// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef BTBASEBAND_H
    1.20 +#define BTBASEBAND_H
    1.21 +
    1.22 +/** 
    1.23 +@file
    1.24 +@internalTechnology
    1.25 +@released
    1.26 +*/
    1.27 +
    1.28 +#include <e32base.h>
    1.29 +#include <es_sock.h>
    1.30 +#include <btsockaddr.h>
    1.31 +#include <bttypes.h>
    1.32 +#include <btbasebandpolicy.h>
    1.33 +#include <bluetooth/lmoptions.h>
    1.34 +
    1.35 +NONSHARABLE_CLASS(RBTBaseband)
    1.36 +/** API useful for Bluetooth as seen from a single physical link perspective
    1.37 +@internalTechnology
    1.38 +@released
    1.39 +WARNING: For internal use ONLY. Compatibility is not guaranteed in future releases.
    1.40 +*/
    1.41 +	{
    1.42 +public:
    1.43 +	RBTBaseband();
    1.44 +	//API useful for Bluetooth as seen from a single physical link perspective
    1.45 +	TInt Open(RSocketServ& aSocketServ, RSocket& aSocket);
    1.46 +	TInt Open(RSocketServ& aSocketServ, const TBTDevAddr& aDevAddr);
    1.47 +	void Close();
    1.48 +	TInt PhysicalLinkState(TUint32& aState);
    1.49 +	TInt BasebandState(TUint32& aState); 
    1.50 +	TInt PreventRoleSwitch();
    1.51 +	TInt AllowRoleSwitch();
    1.52 +	TInt RequestMasterRole();
    1.53 +	TInt RequestSlaveRole();
    1.54 +	TInt PreventLowPowerModes(TUint32 aLowPowerModes);
    1.55 +	TInt AllowLowPowerModes(TUint32 aLowPowerModes);
    1.56 +	TInt ActivateSniffRequester();
    1.57 +	TInt ActivateParkRequester();
    1.58 +	TInt CancelLowPowerModeRequester();
    1.59 +	TInt RequestExplicitActiveMode(TBool aActive);
    1.60 +	TInt RequestChangeSupportedPacketTypes(TUint16 aPacketTypes);
    1.61 +	//THE TWO NOTIFY METHODS BELOW MUST NOT BE CALLED CONCURRENTLY
    1.62 +	//Method to be used if only the next event should be notified
    1.63 +	void ActivateNotifierForOneShot(TBTBasebandEvent& aEventNotification, 
    1.64 +		                            TRequestStatus& aStatus, 
    1.65 +									TUint32 aEventMask);
    1.66 +	//Method to be used if it is intended to call it again 
    1.67 +	//(or call CancelNextBasebandChangeEventNotifier) when it completes 
    1.68 +	// - this sets up a continuous monitoring of events on the server.
    1.69 +	//Each time ActivateNotifierForOneShot is called it will either return
    1.70 +	//the next event in the servers notification queue or if the
    1.71 +	//queue is empty it will await the next event. 
    1.72 +	void ActivateNotifierForRecall(TBTBasebandEvent& aEventNotification, 
    1.73 +		                           TRequestStatus& aStatus, 
    1.74 +								   TUint32 aEventMask);
    1.75 +	void ReadNewPhysicalLinkMetricValue(TRequestStatus& aStatus,
    1.76 +								TDes8& aData,
    1.77 +								TBTLMIoctls aIoctl);
    1.78 +	void CancelPhysicalLinkMetricUpdate();
    1.79 +	void CancelNextBasebandChangeEventNotifier();
    1.80 +	TInt Authenticate();
    1.81 +	
    1.82 +	//API useful for Bluetooth as seen from a device perspective
    1.83 +	TInt Open(RSocketServ& aSocketServ);
    1.84 +	void Connect(const TBTDevAddr& aDevAddr, TRequestStatus& aStatus);
    1.85 +	void Connect(const TPhysicalLinkQuickConnectionToken& aToken, TRequestStatus& aStatus);
    1.86 +	TInt Broadcast(const TDesC8& aData); // testing broadcast writes
    1.87 +	TInt ReadRaw(TDes8& aData);
    1.88 +	TInt Enumerate(RBTDevAddrArray& aBTDevAddrArray, TUint aMaxNumber);
    1.89 +	void TerminatePhysicalLink(TInt aReason);
    1.90 +	void TerminatePhysicalLink(TInt aReason, TRequestStatus& aStatus);
    1.91 +	void TerminatePhysicalLink(TInt aReason, const TBTDevAddr& aDevAddr, TRequestStatus& aStatus);
    1.92 +	void ShutdownPhysicalLink(TRequestStatus& aStatus);
    1.93 +	void TerminateAllPhysicalLinks(TInt aReason);
    1.94 +	void TerminateAllPhysicalLinks(TInt aReason, TRequestStatus& aStatus);
    1.95 +	TInt SubSessionHandle() const;
    1.96 +	
    1.97 +private:
    1.98 +	TInt RequestRole(TBTLMOptions aRole);
    1.99 +	void LocalComplete(TRequestStatus& aStatus, TInt aErr);
   1.100 +	void SetClientPending(TRequestStatus& aStatus);
   1.101 +	void DoConnect(TRequestStatus& aStatus);
   1.102 +	TInt Enumerate(TDes8& aData);
   1.103 +	TInt Construct();
   1.104 +		
   1.105 +private:
   1.106 +	TAny*					iUnusedPointer;
   1.107 +	RSocket					iSocket;
   1.108 +
   1.109 +	TRequestStatus*							iClientRequestStatus;
   1.110 +	TBTSockAddr								iSocketAddress;				
   1.111 +	TPhysicalLinkQuickConnectionTokenBuf	iConnectToken;
   1.112 +	TBuf8<1>								iConnectInData; // not used yet - needed tho!
   1.113 +	TBuf8<1>								iDummySCOShutdownDescriptor;
   1.114 +	
   1.115 +	// This data padding has been added to help prevent future binary compatibility breaks	
   1.116 +	// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
   1.117 +	TUint32     iPadding1; 
   1.118 +	TUint32     iPadding2; 	
   1.119 +	};
   1.120 +
   1.121 +#endif // BTBASEBAND_H