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