williamr@4
|
1 |
// Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@4
|
2 |
// All rights reserved.
|
williamr@4
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@4
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@4
|
7 |
//
|
williamr@4
|
8 |
// Initial Contributors:
|
williamr@4
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@4
|
10 |
//
|
williamr@4
|
11 |
// Contributors:
|
williamr@4
|
12 |
//
|
williamr@4
|
13 |
// Description:
|
williamr@4
|
14 |
//
|
williamr@4
|
15 |
|
williamr@4
|
16 |
#ifndef BTBASEBAND_H
|
williamr@4
|
17 |
#define BTBASEBAND_H
|
williamr@4
|
18 |
|
williamr@4
|
19 |
/**
|
williamr@4
|
20 |
@file
|
williamr@4
|
21 |
@internalTechnology
|
williamr@4
|
22 |
@released
|
williamr@4
|
23 |
*/
|
williamr@4
|
24 |
|
williamr@4
|
25 |
#include <e32base.h>
|
williamr@4
|
26 |
#include <es_sock.h>
|
williamr@4
|
27 |
#include <btsockaddr.h>
|
williamr@4
|
28 |
#include <bttypes.h>
|
williamr@4
|
29 |
#include <btbasebandpolicy.h>
|
williamr@4
|
30 |
#include <bluetooth/lmoptions.h>
|
williamr@4
|
31 |
|
williamr@4
|
32 |
NONSHARABLE_CLASS(RBTBaseband)
|
williamr@4
|
33 |
/** API useful for Bluetooth as seen from a single physical link perspective
|
williamr@4
|
34 |
@internalTechnology
|
williamr@4
|
35 |
@released
|
williamr@4
|
36 |
WARNING: For internal use ONLY. Compatibility is not guaranteed in future releases.
|
williamr@4
|
37 |
*/
|
williamr@4
|
38 |
{
|
williamr@4
|
39 |
public:
|
williamr@4
|
40 |
RBTBaseband();
|
williamr@4
|
41 |
//API useful for Bluetooth as seen from a single physical link perspective
|
williamr@4
|
42 |
TInt Open(RSocketServ& aSocketServ, RSocket& aSocket);
|
williamr@4
|
43 |
TInt Open(RSocketServ& aSocketServ, const TBTDevAddr& aDevAddr);
|
williamr@4
|
44 |
void Close();
|
williamr@4
|
45 |
TInt PhysicalLinkState(TUint32& aState);
|
williamr@4
|
46 |
TInt BasebandState(TUint32& aState);
|
williamr@4
|
47 |
TInt PreventRoleSwitch();
|
williamr@4
|
48 |
TInt AllowRoleSwitch();
|
williamr@4
|
49 |
TInt RequestMasterRole();
|
williamr@4
|
50 |
TInt RequestSlaveRole();
|
williamr@4
|
51 |
TInt PreventLowPowerModes(TUint32 aLowPowerModes);
|
williamr@4
|
52 |
TInt AllowLowPowerModes(TUint32 aLowPowerModes);
|
williamr@4
|
53 |
TInt ActivateSniffRequester();
|
williamr@4
|
54 |
TInt ActivateParkRequester();
|
williamr@4
|
55 |
TInt CancelLowPowerModeRequester();
|
williamr@4
|
56 |
TInt RequestExplicitActiveMode(TBool aActive);
|
williamr@4
|
57 |
TInt RequestChangeSupportedPacketTypes(TUint16 aPacketTypes);
|
williamr@4
|
58 |
//THE TWO NOTIFY METHODS BELOW MUST NOT BE CALLED CONCURRENTLY
|
williamr@4
|
59 |
//Method to be used if only the next event should be notified
|
williamr@4
|
60 |
void ActivateNotifierForOneShot(TBTBasebandEvent& aEventNotification,
|
williamr@4
|
61 |
TRequestStatus& aStatus,
|
williamr@4
|
62 |
TUint32 aEventMask);
|
williamr@4
|
63 |
//Method to be used if it is intended to call it again
|
williamr@4
|
64 |
//(or call CancelNextBasebandChangeEventNotifier) when it completes
|
williamr@4
|
65 |
// - this sets up a continuous monitoring of events on the server.
|
williamr@4
|
66 |
//Each time ActivateNotifierForOneShot is called it will either return
|
williamr@4
|
67 |
//the next event in the servers notification queue or if the
|
williamr@4
|
68 |
//queue is empty it will await the next event.
|
williamr@4
|
69 |
void ActivateNotifierForRecall(TBTBasebandEvent& aEventNotification,
|
williamr@4
|
70 |
TRequestStatus& aStatus,
|
williamr@4
|
71 |
TUint32 aEventMask);
|
williamr@4
|
72 |
void ReadNewPhysicalLinkMetricValue(TRequestStatus& aStatus,
|
williamr@4
|
73 |
TDes8& aData,
|
williamr@4
|
74 |
TBTLMIoctls aIoctl);
|
williamr@4
|
75 |
void CancelPhysicalLinkMetricUpdate();
|
williamr@4
|
76 |
void CancelNextBasebandChangeEventNotifier();
|
williamr@4
|
77 |
TInt Authenticate();
|
williamr@4
|
78 |
|
williamr@4
|
79 |
//API useful for Bluetooth as seen from a device perspective
|
williamr@4
|
80 |
TInt Open(RSocketServ& aSocketServ);
|
williamr@4
|
81 |
void Connect(const TBTDevAddr& aDevAddr, TRequestStatus& aStatus);
|
williamr@4
|
82 |
void Connect(const TPhysicalLinkQuickConnectionToken& aToken, TRequestStatus& aStatus);
|
williamr@4
|
83 |
TInt Broadcast(const TDesC8& aData); // testing broadcast writes
|
williamr@4
|
84 |
TInt ReadRaw(TDes8& aData);
|
williamr@4
|
85 |
TInt Enumerate(RBTDevAddrArray& aBTDevAddrArray, TUint aMaxNumber);
|
williamr@4
|
86 |
void TerminatePhysicalLink(TInt aReason);
|
williamr@4
|
87 |
void TerminatePhysicalLink(TInt aReason, TRequestStatus& aStatus);
|
williamr@4
|
88 |
void TerminatePhysicalLink(TInt aReason, const TBTDevAddr& aDevAddr, TRequestStatus& aStatus);
|
williamr@4
|
89 |
void ShutdownPhysicalLink(TRequestStatus& aStatus);
|
williamr@4
|
90 |
void TerminateAllPhysicalLinks(TInt aReason);
|
williamr@4
|
91 |
void TerminateAllPhysicalLinks(TInt aReason, TRequestStatus& aStatus);
|
williamr@4
|
92 |
TInt SubSessionHandle() const;
|
williamr@4
|
93 |
|
williamr@4
|
94 |
private:
|
williamr@4
|
95 |
TInt RequestRole(TBTLMOptions aRole);
|
williamr@4
|
96 |
void LocalComplete(TRequestStatus& aStatus, TInt aErr);
|
williamr@4
|
97 |
void SetClientPending(TRequestStatus& aStatus);
|
williamr@4
|
98 |
void DoConnect(TRequestStatus& aStatus);
|
williamr@4
|
99 |
TInt Enumerate(TDes8& aData);
|
williamr@4
|
100 |
TInt Construct();
|
williamr@4
|
101 |
|
williamr@4
|
102 |
private:
|
williamr@4
|
103 |
TAny* iUnusedPointer;
|
williamr@4
|
104 |
RSocket iSocket;
|
williamr@4
|
105 |
|
williamr@4
|
106 |
TRequestStatus* iClientRequestStatus;
|
williamr@4
|
107 |
TBTSockAddr iSocketAddress;
|
williamr@4
|
108 |
TPhysicalLinkQuickConnectionTokenBuf iConnectToken;
|
williamr@4
|
109 |
TBuf8<1> iConnectInData; // not used yet - needed tho!
|
williamr@4
|
110 |
TBuf8<1> iDummySCOShutdownDescriptor;
|
williamr@4
|
111 |
|
williamr@4
|
112 |
// This data padding has been added to help prevent future binary compatibility breaks
|
williamr@4
|
113 |
// Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
|
williamr@4
|
114 |
TUint32 iPadding1;
|
williamr@4
|
115 |
TUint32 iPadding2;
|
williamr@4
|
116 |
};
|
williamr@4
|
117 |
|
williamr@4
|
118 |
#endif // BTBASEBAND_H
|