|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Contains BTSU wide definitions. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BT_SERVICE_UTILS_H |
|
20 #define BT_SERVICE_UTILS_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32std.h> |
|
24 |
|
25 // CONSTANTS |
|
26 |
|
27 // Name of this component |
|
28 // |
|
29 _LIT( KBTSUModuleName, "Bluetooth Service Utils" ); |
|
30 |
|
31 const TInt KBTSUArrayGranularity = 1; |
|
32 const TInt KBTSUMaxStringLength = 255; |
|
33 const TInt KBTSUTextBufferMaxSize = 512; |
|
34 const TInt KBTSUDataBufferMaxSize = 102400; // 100K |
|
35 const TInt KBTSUDataBufferExpandSize = 4; |
|
36 const TInt KBTSUEqualStrings = 0; // The ok-result of TDesC::Compare |
|
37 |
|
38 _LIT( KBTSProtocol, "RFCOMM" ); // The Bluetooth transport layer |
|
39 |
|
40 // Obex header HI values |
|
41 // |
|
42 const TUint8 KBTSUNameHeader = 0x01; |
|
43 const TUint8 KBTSUImageHandleHeader = 0x30; |
|
44 const TUint8 KBTSUTypeHeader = 0x42; |
|
45 const TUint8 KBTSULengthHeader = 0xC3; |
|
46 const TUint8 KBTSUTargetHeader = 0x46; |
|
47 const TUint8 KBTSUAppParamsHeader = 0x4C; |
|
48 const TUint8 KBTSUImgDescriptorHeader = 0x71; |
|
49 |
|
50 |
|
51 // DATA TYPES |
|
52 |
|
53 enum TBTSUPanicCode |
|
54 { |
|
55 EBTSUPanicNullPointer = 45000, |
|
56 EBTSUPanicExistingObject, |
|
57 EBTSUPanicObjectActive, |
|
58 EBTSUPanicUnhandledCase, |
|
59 EBTSUPanicInternalError, |
|
60 EBTSUPanicOutOfRange, |
|
61 EBTSUPanicResponseAlreadyPresent, |
|
62 EBTSUPanicNoBufferEvenThoughCountNotZero |
|
63 }; |
|
64 |
|
65 enum TBTServiceStatus |
|
66 { |
|
67 EBTSNoError = 100, |
|
68 EBTSNoFiles, |
|
69 EBTSAbort, |
|
70 EBTSConnectingFailed, |
|
71 EBTSGettingFailed, |
|
72 EBTSPuttingFailed, |
|
73 EBTSNoSuitableProfiles, |
|
74 EBTSUserCancel, |
|
75 EBTSBIPOneNotSend, |
|
76 EBTSBIPSomeSend, |
|
77 EBTSBIPNoneSend |
|
78 }; |
|
79 |
|
80 struct TBTSUImageCap |
|
81 { |
|
82 TDesC* iEncoding; |
|
83 TSize iMinPixelSize; |
|
84 TSize iMaxPixelSize; |
|
85 TInt iMaxByteSize; |
|
86 }; |
|
87 |
|
88 |
|
89 // FUNCTION PROTOTYPES |
|
90 |
|
91 /** |
|
92 * Calls the Symbian OS Panic function specifying this component's name as the |
|
93 * panic category and aPanic as the panic code. |
|
94 * @param aPanic The panic code. |
|
95 * @return None. |
|
96 */ |
|
97 void BTSUPanic( TBTSUPanicCode aPanic ); |
|
98 |
|
99 |
|
100 // CLASS DECLARATION |
|
101 |
|
102 /** |
|
103 * A cleanup template class for objects that need ResetAndDestroy call. |
|
104 */ |
|
105 template <class T> class CleanupResetAndDestroy |
|
106 { |
|
107 public: |
|
108 inline static void PushL( T& aRef ); |
|
109 private: |
|
110 static void ResetAndDestroy( TAny *aPtr ); |
|
111 }; |
|
112 |
|
113 template <class T> inline void CleanupResetAndDestroyPushL( T& aRef ); |
|
114 |
|
115 #include "BTServiceUtils.inl" |
|
116 |
|
117 #endif // BT_SERVICE_UTILS_H |
|
118 |
|
119 // End of File |