|
1 // Copyright (c) 2001-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 _LINKCONSTS_H_ |
|
17 #define _LINKCONSTS_H_ |
|
18 |
|
19 #include <bt_sock.h> |
|
20 #include <bluetooth/hci/basebandpacketconsts.h> |
|
21 |
|
22 static const TInt KLinkMgrIncomingBufferCountPerLink = 8; |
|
23 |
|
24 // Timers |
|
25 //Timeout for idle timer - used for interval between protocol being ready to close, |
|
26 //and it actually closing |
|
27 const TInt KLinkMgrProtocolIdleTimer = 2*1000000; |
|
28 //Minimum interval allowed between successive AFHHostChannelClassification commands |
|
29 const TInt KAFHHostChannelClassificationIntervalTimer = 1000000; |
|
30 //Timeout to prevent further AFHHostChannelClassification commands |
|
31 //being blocked forever if no command complete is received. |
|
32 const TInt KAFHHostChannelClassificationCommandCompleteTimer = 30000000; |
|
33 |
|
34 // The number of buffers which we'd like to have for buffering data coming |
|
35 // from the L2CAP to HCI for flow control. |
|
36 const TUint KHCIPreferedNumberOfHCIACLDataBuffers=8; |
|
37 |
|
38 // In the HCI we have to account for all the packets pending on each connection |
|
39 // so that we can update our data packet credits accordingly when disconnection |
|
40 // or flush occures. The reason why this is 7 is because we do not need more for |
|
41 // point to point Bluetooth (and we need the memory :-). |
|
42 #ifdef PROXY_COMMUNICATES |
|
43 const TUint KHCIMaxNumberOfACLConnectionRecords=8; // one for broadcast |
|
44 #else |
|
45 const TUint KHCIMaxNumberOfACLConnectionRecords=7; |
|
46 #endif |
|
47 |
|
48 // Maximum number of connection records that the HCI will keep in order to check |
|
49 // on disconnection whether an ACO or ACL connection was dropped. |
|
50 // The maximum number of record is equal to the max number of ACL record x 3 |
|
51 // since the standard allows for three SCO channels per baseband link |
|
52 const TUint KHCIMaxNumberOfConnectionRecords=KHCIMaxNumberOfACLConnectionRecords*3; |
|
53 |
|
54 // For a UART HCTL implementation of the HCI, we need to be able to buffer |
|
55 // HCI Data buffers of at least 255+1+4 bytes, since the HC must guarantee to |
|
56 // be able to accept/buffer data packets of 255 bytes (EXCLUDING the headers). |
|
57 |
|
58 // CSR ignore this bit of the spec, so we may just bin these anyway. |
|
59 |
|
60 const TUint16 KHCIHCTLUartACLHeaderSize=1; |
|
61 const TUint16 KHCIACLPacketHeaderSize=4; |
|
62 const TUint16 KHCIACLMinDataBufferSize=255; |
|
63 const TUint16 KHCIACLMinPacketBufferSize= |
|
64 KHCIHCTLUartACLHeaderSize+KHCIACLPacketHeaderSize+KHCIACLMinDataBufferSize; |
|
65 const TUint KBluetoothMinHCBufs = 5; |
|
66 |
|
67 |
|
68 // |
|
69 // Physical Link Config |
|
70 // |
|
71 |
|
72 const TUint16 KLinkMgrIncomingBufferSize = 672; //L2Cap Default MTU |
|
73 const TUint16 KStackACLBuffersNum = 16; |
|
74 const TUint16 KStackACLBuffersTideMarkNum = 8; |
|
75 |
|
76 #ifdef STACK_SCO_DATA |
|
77 const TUint8 KStackSCOBuffersSize = 255; |
|
78 const TUint16 KStackSCOBuffersNum = 1; |
|
79 #else |
|
80 const TUint8 KStackSCOBuffersSize = 0; |
|
81 const TUint16 KStackSCOBuffersNum = 0; |
|
82 #endif |
|
83 |
|
84 static const THCIScanEnable KHCIDefaultScanMode = EInquiryAndPageScan; |
|
85 |
|
86 static const TUint16 KHCIDefaultAcceptTimeout = 0x1FA0; // time=n*0.625ms |
|
87 static const TUint16 KHCIDefaultPageTimeout = 0x8000; |
|
88 static const TUint16 KHCIMaxSlotsOnePacketType = KDM1Packet | |
|
89 KDH1Packet; |
|
90 static const TUint16 KHCIMaxSlotsThreePacketType = KDM1Packet | |
|
91 KDH1Packet | |
|
92 KDM3Packet | |
|
93 KDH3Packet; |
|
94 static const TUint16 KHCIMaxSlotsFivePacketType = KDM1Packet | |
|
95 KDH1Packet | |
|
96 KDM3Packet | |
|
97 KDH3Packet | |
|
98 KDM5Packet | |
|
99 KDH5Packet; |
|
100 static const TUint16 KHCIDefaultPacketType = KHCIMaxSlotsFivePacketType; |
|
101 static const TUint16 KHCIDefaultSCOPacketType = KHV1Packet | |
|
102 KHV2Packet | |
|
103 KHV3Packet; |
|
104 static const TInt KPhysicalLinkIdleTimeout = 5; |
|
105 static const TInt KMaxPhysicalLinkIdleTimeout = 60; |
|
106 #endif |