|
1 // Copyright (c) 2005-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 #ifndef _CodMan_H |
|
17 #define _CodMan_H |
|
18 |
|
19 #include <btdevice.h> |
|
20 |
|
21 |
|
22 static const TUint16 KBTCodBitsRegdFlag = 0x8000; |
|
23 static const TUint KBTMaxCodServices = 11; |
|
24 static const TUint KBTCodServiceOffset = 13; // require left shift for processing |
|
25 static const TUint KBTCodServiceLSB = 1; |
|
26 static const TUint KBTCodValidServiceBits = 0x7F9; // the valid Service class, when shifted down |
|
27 static const TUint KBTCodDeviceField = 0x1FFF; // the lower 13 bits are Device class |
|
28 static const TUint32 KBTCodMask = 0x00FFFFFF; // mask for lower 3 bytes |
|
29 |
|
30 |
|
31 class CLinkMgrProtocol; |
|
32 |
|
33 /*************************************************************************** |
|
34 CoD Service Manager. |
|
35 Manages the Service bit settings in the composite CoD word. |
|
36 ***************************************************************************/ |
|
37 NONSHARABLE_CLASS(CBTCodServiceMan) : public CBase |
|
38 { |
|
39 public: |
|
40 static CBTCodServiceMan* NewL(); |
|
41 ~CBTCodServiceMan(); |
|
42 void Initialise(); |
|
43 TInt RegisterCodService(TUint16 aCodService); |
|
44 TInt RemoveCodService(TUint16 aCodService); |
|
45 TInt PandSCodHandler(TUint32 aCod); |
|
46 CLinkMgrProtocol* iLinkMgr; |
|
47 |
|
48 private: |
|
49 CBTCodServiceMan(); |
|
50 void ConstructL(); |
|
51 TUint16 ResolveServiceBits(); |
|
52 void WriteCoDL(); |
|
53 |
|
54 TUint32 iPandSCod; // P&S record of Cod |
|
55 TFixedArray <TUint,KBTMaxCodServices> iServRefCount; // Each Service bit has a counter |
|
56 }; |
|
57 |
|
58 _LIT(KBTCodPanic, "BT CoD Service Manager"); |
|
59 enum TBTCodPanic |
|
60 { |
|
61 EBTCodBadCount, |
|
62 EBTCodServiceBits, |
|
63 EBTCodBadLinkmgr, |
|
64 EBTCodBadDeregister, |
|
65 }; |
|
66 |
|
67 |
|
68 #endif //_CodMan_H |