|
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: Methods for BT notifier |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // INCLUDE FILES |
|
20 |
|
21 #include <eikenv.h> |
|
22 |
|
23 #include "btnauthnotifier.h" // All notifiers |
|
24 #include "btnpinnotifier.h" |
|
25 #include "btninqnotifier.h" |
|
26 #include "btnobexpinnotifier.h" |
|
27 #include "btnpwrnotifier.h" |
|
28 #include "btNotifDebug.h" |
|
29 #include "BTNGenericInfoNotifier.h" |
|
30 #include "BTNGenericQueryNotifier.h" |
|
31 #include "btnpbappinnotifier.h" |
|
32 #include "btnpaireddevsettnotifier.h" |
|
33 #include "btnssppasskeyentrynotifier.h" |
|
34 #include "btnumcmpnotifier.h" |
|
35 #include "btnenterpriseitsecurityinfonotifier.h" |
|
36 |
|
37 // CONSTANTS |
|
38 const TInt KBTNotifierArrayIncrement = 8; |
|
39 |
|
40 |
|
41 // ================= EXPORTED FUNCTIONS ==================== |
|
42 |
|
43 // --------------------------------------------------------- |
|
44 // |
|
45 // Instantiate notifiers |
|
46 // |
|
47 // --------------------------------------------------------- |
|
48 |
|
49 LOCAL_C void CreateBTNotifiersL( CArrayPtrFlat<MEikSrvNotifierBase2>* aNotifiers ) |
|
50 { |
|
51 FLOG(_L("[BTNOTIF]\t CreateBTNotifiersL")); |
|
52 |
|
53 CBTInqNotifier* inquiryNotifier = CBTInqNotifier::NewL(); |
|
54 CleanupStack::PushL( inquiryNotifier ); |
|
55 aNotifiers->AppendL( inquiryNotifier ); |
|
56 CleanupStack::Pop( inquiryNotifier ); |
|
57 |
|
58 CBTPinNotifier* pinNotifier = CBTPinNotifier::NewL(); |
|
59 CleanupStack::PushL( pinNotifier ); |
|
60 aNotifiers->AppendL( pinNotifier ); |
|
61 CleanupStack::Pop( pinNotifier ); |
|
62 |
|
63 CBTAuthNotifier* authNotifier = CBTAuthNotifier::NewL(); |
|
64 CleanupStack::PushL( authNotifier ); |
|
65 aNotifiers->AppendL( authNotifier ); |
|
66 CleanupStack::Pop( authNotifier ); |
|
67 |
|
68 CBTObexPinNotifier* obexNotifier = CBTObexPinNotifier::NewL(); |
|
69 CleanupStack::PushL( obexNotifier ); |
|
70 aNotifiers->AppendL( obexNotifier ); |
|
71 CleanupStack::Pop( obexNotifier ); |
|
72 |
|
73 CBTPwrNotifier* pwrNotifier = CBTPwrNotifier::NewL(); |
|
74 CleanupStack::PushL( pwrNotifier ); |
|
75 aNotifiers->AppendL( pwrNotifier ); |
|
76 CleanupStack::Pop( pwrNotifier ); |
|
77 |
|
78 CBTGenericInfoNotifier* infoNotifier = CBTGenericInfoNotifier::NewL(); |
|
79 CleanupStack::PushL( infoNotifier ); |
|
80 aNotifiers->AppendL( infoNotifier ); |
|
81 CleanupStack::Pop( infoNotifier ); |
|
82 |
|
83 CBTGenericQueryNotifier* queryNotifier = CBTGenericQueryNotifier::NewL(); |
|
84 CleanupStack::PushL( queryNotifier ); |
|
85 aNotifiers->AppendL( queryNotifier ); |
|
86 CleanupStack::Pop( queryNotifier ); |
|
87 |
|
88 CBTPBAPPinNotifier* pbapNotifier = CBTPBAPPinNotifier::NewL(); |
|
89 CleanupStack::PushL( pbapNotifier ); |
|
90 aNotifiers->AppendL( pbapNotifier ); |
|
91 CleanupStack::Pop( pbapNotifier ); |
|
92 |
|
93 CBTPairedDevSettNotifier* pdsNotifier = CBTPairedDevSettNotifier::NewL(); |
|
94 CleanupStack::PushL( pdsNotifier ); |
|
95 aNotifiers->AppendL( pdsNotifier ); |
|
96 CleanupStack::Pop( pdsNotifier ); |
|
97 |
|
98 CBTSSPPasskeyEntryNotifier* sspPinNotifier = CBTSSPPasskeyEntryNotifier::NewL(); |
|
99 CleanupStack::PushL( sspPinNotifier ); |
|
100 aNotifiers->AppendL( sspPinNotifier ); |
|
101 CleanupStack::Pop( sspPinNotifier ); |
|
102 |
|
103 CBTNumCmpNotifier* numCmpNotifier = CBTNumCmpNotifier::NewL(); |
|
104 CleanupStack::PushL(numCmpNotifier); |
|
105 aNotifiers->AppendL( numCmpNotifier ); |
|
106 CleanupStack::Pop( numCmpNotifier ); |
|
107 |
|
108 CBTEnterpriseItSecurityInfoNotifier* enterpriseItSecurityNotifier = CBTEnterpriseItSecurityInfoNotifier::NewL(); |
|
109 CleanupStack::PushL(enterpriseItSecurityNotifier); |
|
110 aNotifiers->AppendL(enterpriseItSecurityNotifier); |
|
111 CleanupStack::Pop(enterpriseItSecurityNotifier); |
|
112 |
|
113 FLOG(_L("[BTNOTIF]\t CreateBTNotifiersL completed")); |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------- |
|
117 // |
|
118 // Lib main entry point: Creates a notifiers array. |
|
119 // |
|
120 // --------------------------------------------------------- |
|
121 |
|
122 EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray() |
|
123 { |
|
124 FLOG(_L("[BTNOTIF]\t NotifierArray")); |
|
125 |
|
126 CArrayPtrFlat<MEikSrvNotifierBase2>* notifiers = NULL; |
|
127 |
|
128 notifiers = |
|
129 new CArrayPtrFlat<MEikSrvNotifierBase2>( KBTNotifierArrayIncrement ); |
|
130 if( notifiers ) |
|
131 { |
|
132 TRAPD( err, CreateBTNotifiersL( notifiers )); |
|
133 if( err ) |
|
134 { |
|
135 FTRACE(FPrint(_L("[BTNOTIF]\t Notifier creation failure! Error code: %d"), err)); |
|
136 TInt count = notifiers->Count(); |
|
137 while(count--) |
|
138 (*notifiers)[count]->Release(); |
|
139 delete notifiers; |
|
140 notifiers = NULL; |
|
141 } |
|
142 |
|
143 FLOG(_L("[BTNOTIF]\t NotifierArray completed")); |
|
144 } |
|
145 return notifiers; |
|
146 } |
|
147 |
|
148 |
|
149 // End of File |
|
150 |
|
151 |
|
152 |