1 // Copyright (c) 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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
27 #include <btsockaddr.h>
29 #include <btbasebandpolicy.h>
30 #include <bluetooth/lmoptions.h>
32 NONSHARABLE_CLASS(RBTBaseband)
33 /** API useful for Bluetooth as seen from a single physical link perspective
36 WARNING: For internal use ONLY. Compatibility is not guaranteed in future releases.
41 //API useful for Bluetooth as seen from a single physical link perspective
42 TInt Open(RSocketServ& aSocketServ, RSocket& aSocket);
43 TInt Open(RSocketServ& aSocketServ, const TBTDevAddr& aDevAddr);
45 TInt PhysicalLinkState(TUint32& aState);
46 TInt BasebandState(TUint32& aState);
47 TInt PreventRoleSwitch();
48 TInt AllowRoleSwitch();
49 TInt RequestMasterRole();
50 TInt RequestSlaveRole();
51 TInt PreventLowPowerModes(TUint32 aLowPowerModes);
52 TInt AllowLowPowerModes(TUint32 aLowPowerModes);
53 TInt ActivateSniffRequester();
54 TInt ActivateParkRequester();
55 TInt CancelLowPowerModeRequester();
56 TInt RequestExplicitActiveMode(TBool aActive);
57 TInt RequestChangeSupportedPacketTypes(TUint16 aPacketTypes);
58 //THE TWO NOTIFY METHODS BELOW MUST NOT BE CALLED CONCURRENTLY
59 //Method to be used if only the next event should be notified
60 void ActivateNotifierForOneShot(TBTBasebandEvent& aEventNotification,
61 TRequestStatus& aStatus,
63 //Method to be used if it is intended to call it again
64 //(or call CancelNextBasebandChangeEventNotifier) when it completes
65 // - this sets up a continuous monitoring of events on the server.
66 //Each time ActivateNotifierForOneShot is called it will either return
67 //the next event in the servers notification queue or if the
68 //queue is empty it will await the next event.
69 void ActivateNotifierForRecall(TBTBasebandEvent& aEventNotification,
70 TRequestStatus& aStatus,
72 void ReadNewPhysicalLinkMetricValue(TRequestStatus& aStatus,
75 void CancelPhysicalLinkMetricUpdate();
76 void CancelNextBasebandChangeEventNotifier();
79 //API useful for Bluetooth as seen from a device perspective
80 TInt Open(RSocketServ& aSocketServ);
81 void Connect(const TBTDevAddr& aDevAddr, TRequestStatus& aStatus);
82 void Connect(const TPhysicalLinkQuickConnectionToken& aToken, TRequestStatus& aStatus);
83 TInt Broadcast(const TDesC8& aData); // testing broadcast writes
84 TInt ReadRaw(TDes8& aData);
85 TInt Enumerate(RBTDevAddrArray& aBTDevAddrArray, TUint aMaxNumber);
86 void TerminatePhysicalLink(TInt aReason);
87 void TerminatePhysicalLink(TInt aReason, TRequestStatus& aStatus);
88 void TerminatePhysicalLink(TInt aReason, const TBTDevAddr& aDevAddr, TRequestStatus& aStatus);
89 void ShutdownPhysicalLink(TRequestStatus& aStatus);
90 void TerminateAllPhysicalLinks(TInt aReason);
91 void TerminateAllPhysicalLinks(TInt aReason, TRequestStatus& aStatus);
92 TInt SubSessionHandle() const;
95 TInt RequestRole(TBTLMOptions aRole);
96 void LocalComplete(TRequestStatus& aStatus, TInt aErr);
97 void SetClientPending(TRequestStatus& aStatus);
98 void DoConnect(TRequestStatus& aStatus);
99 TInt Enumerate(TDes8& aData);
103 TAny* iUnusedPointer;
106 TRequestStatus* iClientRequestStatus;
107 TBTSockAddr iSocketAddress;
108 TPhysicalLinkQuickConnectionTokenBuf iConnectToken;
109 TBuf8<1> iConnectInData; // not used yet - needed tho!
110 TBuf8<1> iDummySCOShutdownDescriptor;
112 // This data padding has been added to help prevent future binary compatibility breaks
113 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
118 #endif // BTBASEBAND_H