|
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 #include <btextnotifiers.h> |
|
17 #include <bluetooth/logger.h> |
|
18 #include <btextnotifierspartner.h> |
|
19 |
|
20 #ifdef __FLOG_ACTIVE |
|
21 _LIT8(KLogComponent, LOG_COMPONENT_BTNOTIFIERS); |
|
22 #endif |
|
23 |
|
24 /** |
|
25 Constructor. |
|
26 Sets iValidDeviceClass and iValidUuid to EFalse. |
|
27 **/ |
|
28 EXPORT_C TBTDeviceSelectionParams::TBTDeviceSelectionParams() |
|
29 { |
|
30 iValidDeviceClass=EFalse; |
|
31 iValidUuid=EFalse; |
|
32 } |
|
33 |
|
34 /** |
|
35 Sets the UUID to aUUID. |
|
36 @param aUUID "The UUID" |
|
37 **/ |
|
38 EXPORT_C void TBTDeviceSelectionParams::SetUUID(const TUUID& aUUID) |
|
39 { |
|
40 iSdpUuid=aUUID; |
|
41 iValidUuid=ETrue; |
|
42 } |
|
43 |
|
44 /** |
|
45 Sets the device class to aClass. |
|
46 @param aClass "The device class" |
|
47 **/ |
|
48 EXPORT_C void TBTDeviceSelectionParams::SetDeviceClass(TBTDeviceClass aClass) |
|
49 { |
|
50 iDeviceClass=aClass; |
|
51 iValidDeviceClass=ETrue; |
|
52 } |
|
53 |
|
54 /** |
|
55 Returns the UUID contained within these params. |
|
56 @return The UUID. The reference will remain valid while this object is in scope. |
|
57 **/ |
|
58 EXPORT_C const TUUID& TBTDeviceSelectionParams::UUID() |
|
59 { |
|
60 return iSdpUuid; |
|
61 } |
|
62 |
|
63 /** |
|
64 Returns the device class contained within these params. |
|
65 @return The device class. |
|
66 **/ |
|
67 EXPORT_C TBTDeviceClass TBTDeviceSelectionParams::DeviceClass() |
|
68 { |
|
69 return iDeviceClass; |
|
70 } |
|
71 |
|
72 /** |
|
73 Returns ETrue if the device class has been set using SetDeviceClass(.). |
|
74 @return ETrue if the device class has been set, EFalse if not. |
|
75 **/ |
|
76 EXPORT_C TBool TBTDeviceSelectionParams::IsValidDeviceClass() |
|
77 { |
|
78 return iValidDeviceClass; |
|
79 } |
|
80 |
|
81 /** |
|
82 Returns ETrue if the UUID has been set using SetUUID(.). |
|
83 @return ETrue if the UUID has been set, EFalse if not. |
|
84 **/ |
|
85 EXPORT_C TBool TBTDeviceSelectionParams::IsValidUUID() |
|
86 { |
|
87 return iValidUuid; |
|
88 } |
|
89 |
|
90 /** |
|
91 Constructor. |
|
92 Sets iValidBDAddr, iValidDeviceName and iValidDeviceClass to EFalse; |
|
93 **/ |
|
94 EXPORT_C TBTDeviceResponseParams::TBTDeviceResponseParams() |
|
95 { |
|
96 iValidBDAddr=EFalse; |
|
97 iValidDeviceName=EFalse; |
|
98 iValidDeviceClass=EFalse; |
|
99 } |
|
100 |
|
101 /** |
|
102 Sets the device address to aBDAddr. |
|
103 @param aBDAddr "The device address" |
|
104 **/ |
|
105 EXPORT_C void TBTDeviceResponseParams::SetDeviceAddress(const TBTDevAddr& aBDAddr) |
|
106 { |
|
107 iBDAddr=aBDAddr; |
|
108 iValidBDAddr=ETrue; |
|
109 } |
|
110 |
|
111 /** |
|
112 Sets the device name to aName. |
|
113 @param aName "The device name" |
|
114 **/ |
|
115 EXPORT_C void TBTDeviceResponseParams::SetDeviceName(const TDesC& aName) |
|
116 { |
|
117 iDeviceName=aName; |
|
118 iValidDeviceName=ETrue; |
|
119 } |
|
120 |
|
121 /** |
|
122 Sets the device class to aClass. |
|
123 @param aClass "The device class" |
|
124 **/ |
|
125 EXPORT_C void TBTDeviceResponseParams::SetDeviceClass(TBTDeviceClass aClass) |
|
126 { |
|
127 iDeviceClass=aClass; |
|
128 iValidDeviceClass=ETrue; |
|
129 } |
|
130 |
|
131 |
|
132 /** |
|
133 Returns the device address contained within these params. |
|
134 @return The device address. The reference will be valid while this object is in scope. |
|
135 **/ |
|
136 EXPORT_C const TBTDevAddr& TBTDeviceResponseParams::BDAddr() const |
|
137 { |
|
138 return iBDAddr; |
|
139 } |
|
140 |
|
141 /** |
|
142 Returns the device name contained within these params. |
|
143 @return The device name. The reference will be valid while this object is in scope. |
|
144 **/ |
|
145 EXPORT_C const TDesC& TBTDeviceResponseParams::DeviceName() const |
|
146 { |
|
147 return iDeviceName; |
|
148 } |
|
149 |
|
150 /** |
|
151 Returns the device class contained within these params. |
|
152 @return The device class. |
|
153 **/ |
|
154 EXPORT_C TBTDeviceClass TBTDeviceResponseParams::DeviceClass() |
|
155 { |
|
156 return iDeviceClass; |
|
157 } |
|
158 |
|
159 /** |
|
160 Returns ETrue if the device address has been set using SetDeviceAddress. |
|
161 @return ETrue if the device address has been set, EFalse if not. |
|
162 **/ |
|
163 EXPORT_C TBool TBTDeviceResponseParams::IsValidBDAddr() const |
|
164 { |
|
165 return iValidBDAddr; |
|
166 } |
|
167 |
|
168 /** |
|
169 Returns ETrue if the device name has been set using SetDeviceName. |
|
170 @return ETrue if the device name has been set, EFalse if not. |
|
171 **/ |
|
172 EXPORT_C TBool TBTDeviceResponseParams::IsValidDeviceName() const |
|
173 { |
|
174 return iValidDeviceName; |
|
175 } |
|
176 |
|
177 /** |
|
178 Returns ETrue if the device class has been set using SetDeviceClass(.). |
|
179 @return ETrue if the device class has been set, EFalse if not. |
|
180 **/ |
|
181 EXPORT_C TBool TBTDeviceResponseParams::IsValidDeviceClass() |
|
182 { |
|
183 return iValidDeviceClass; |
|
184 } |
|
185 |
|
186 EXPORT_C TBTDeviceList::TBTDeviceList() : |
|
187 iPtr(iDevices), iKNullDevAddr(MAKE_TINT64(0x0000, 0x00000000)) |
|
188 /** |
|
189 |
|
190 */ |
|
191 { |
|
192 iDevices.Reset(); |
|
193 iPosition = 0; |
|
194 } |
|
195 |
|
196 EXPORT_C TInt TBTDeviceList::AddDevice(const TBTDevAddr& aDevAddr) |
|
197 /** |
|
198 Add a new device to the list |
|
199 @note This always appends the new device to the end of the list |
|
200 @return KErrNone if successful; KErrOverflow if there is no space left in the array |
|
201 */ |
|
202 { |
|
203 for(TInt i=0; i < iDevices.Count(); ++i) |
|
204 { |
|
205 if(iDevices[i] == iKNullDevAddr) |
|
206 { |
|
207 iDevices[i] = aDevAddr; |
|
208 return KErrNone; |
|
209 } |
|
210 } |
|
211 return KErrOverflow; |
|
212 } |
|
213 |
|
214 EXPORT_C TInt TBTDeviceList::GetDevice(TBTDevAddr& aDevAddr) |
|
215 /** |
|
216 Get the next device address from the list |
|
217 @note This method is stateful, and advances automatically to the next device address each time |
|
218 */ |
|
219 { |
|
220 if(iDevices[iPosition]!=iKNullDevAddr) |
|
221 { |
|
222 aDevAddr = iDevices[iPosition]; |
|
223 ++iPosition; |
|
224 return KErrNone; |
|
225 } |
|
226 else |
|
227 { |
|
228 return KErrEof; |
|
229 } |
|
230 } |
|
231 |
|
232 EXPORT_C void TBTDeviceList::Reset() |
|
233 /** |
|
234 Reset the contents of the array |
|
235 */ |
|
236 { |
|
237 iDevices.Reset(); |
|
238 iPosition = 0; |
|
239 } |
|
240 |
|
241 EXPORT_C TBTDeviceList::operator const TDesC8&() |
|
242 { |
|
243 return iPtr; |
|
244 } |
|
245 |
|
246 EXPORT_C TBTDeviceList::operator TDes8&() |
|
247 { |
|
248 return iPtr; |
|
249 } |
|
250 |
|
251 EXPORT_C TUint TBTDeviceList::MaxNumberOfDevices() |
|
252 { |
|
253 return KMaxDevicesForSimultaneousSelection; |
|
254 } |
|
255 |
|
256 /** |
|
257 Constructor. |
|
258 Sets iRealmTruncated, iValidRealm, iValidRemoteAddr to EFalse; |
|
259 **/ |
|
260 EXPORT_C TPbapAuthNotifierParams::TPbapAuthNotifierParams() |
|
261 { |
|
262 iRealmTruncated = EFalse; |
|
263 iValidRealm = EFalse; |
|
264 iValidRemoteAddr = EFalse; |
|
265 } |
|
266 |
|
267 /** |
|
268 Sets the realm to aRealm. If the length of aRealm is greater than the maximum |
|
269 length of iRealm then aRealm will be truncated. |
|
270 @param aRealm "The Realm" |
|
271 **/ |
|
272 EXPORT_C void TPbapAuthNotifierParams::SetRealm(const TDesC& aRealm) |
|
273 { |
|
274 iRealm = aRealm.Left(KPbapAuthRealmLength); |
|
275 iValidRealm = ETrue; |
|
276 |
|
277 // check if iRealm was truncated |
|
278 iRealmTruncated = (aRealm.Length() > KPbapAuthRealmLength) ? ETrue : EFalse; |
|
279 } |
|
280 |
|
281 /** |
|
282 Sets the remote device address to aBDAddr. |
|
283 @param aBDAddr "The remote device address" |
|
284 **/ |
|
285 EXPORT_C void TPbapAuthNotifierParams::SetRemoteAddr(const TBTDevAddr& aBDAddr) |
|
286 { |
|
287 iRemoteAddr = aBDAddr; |
|
288 iValidRemoteAddr = ETrue; |
|
289 } |
|
290 |
|
291 /** |
|
292 Returns the realm contained within these params. |
|
293 @return The realm. The reference will be valid while this object is in scope. |
|
294 **/ |
|
295 EXPORT_C const TDesC& TPbapAuthNotifierParams::Realm() const |
|
296 { |
|
297 return iRealm; |
|
298 } |
|
299 |
|
300 /** |
|
301 Returns ETrue if the realm was truncated during call to SetRealm. |
|
302 @return ETrue if the realm was truncated during call to SetRealm, EFalse if not. |
|
303 **/ |
|
304 EXPORT_C TBool TPbapAuthNotifierParams::RealmTruncated() const |
|
305 { |
|
306 return iRealmTruncated; |
|
307 } |
|
308 |
|
309 /** |
|
310 Returns the remote device address contained within these params. |
|
311 @return The remote device address. The reference will be valid while this object is in scope. |
|
312 **/ |
|
313 EXPORT_C const TBTDevAddr& TPbapAuthNotifierParams::RemoteAddr() const |
|
314 { |
|
315 return iRemoteAddr; |
|
316 } |
|
317 |
|
318 /** |
|
319 Returns ETrue if the realm has been set. |
|
320 @return ETrue if the realm has been set, EFalse if not. |
|
321 **/ |
|
322 EXPORT_C TBool TPbapAuthNotifierParams::IsValidRealm() const |
|
323 { |
|
324 return iValidRealm; |
|
325 } |
|
326 |
|
327 /** |
|
328 Returns ETrue if the remote device address has been set. |
|
329 @return ETrue if the remote device address has been set, EFalse if not. |
|
330 **/ |
|
331 EXPORT_C TBool TPbapAuthNotifierParams::IsValidRemoteAddr() const |
|
332 { |
|
333 return iValidRemoteAddr; |
|
334 } |
|
335 |
|
336 |
|
337 /** |
|
338 Constructor. |
|
339 Sets iValidPassword to EFalse; |
|
340 **/ |
|
341 EXPORT_C TPbapAuthNotifierResponse::TPbapAuthNotifierResponse() |
|
342 { |
|
343 iValidPassword = EFalse; |
|
344 } |
|
345 |
|
346 /** |
|
347 Sets the password to aPassword. If the length of aPassword is greater than the maximum |
|
348 length of iPassword then the password will not be set and EFalse will be returned. |
|
349 @param aPassword "The Authentication Password" |
|
350 @return ETrue if the password was successfully set, EFalse if not. |
|
351 **/ |
|
352 EXPORT_C TBool TPbapAuthNotifierResponse::SetPassword(const TDesC& aPassword) |
|
353 { |
|
354 if (aPassword.Length() <= KPbapAuthPasswordLength) |
|
355 { |
|
356 iPassword = aPassword; |
|
357 iValidPassword = ETrue; |
|
358 } |
|
359 else |
|
360 { |
|
361 iPassword.Zero(); |
|
362 iValidPassword = EFalse; |
|
363 } |
|
364 |
|
365 return iValidPassword; |
|
366 } |
|
367 |
|
368 /** |
|
369 Clears any password contained within these params. |
|
370 **/ |
|
371 EXPORT_C void TPbapAuthNotifierResponse::ResetPassword() |
|
372 { |
|
373 iPassword.Zero(); |
|
374 iValidPassword = EFalse; |
|
375 } |
|
376 |
|
377 /** |
|
378 Returns the password contained within these params. |
|
379 @return The password. The reference will be valid while this object is in scope. |
|
380 **/ |
|
381 EXPORT_C const TDesC& TPbapAuthNotifierResponse::Password() const |
|
382 { |
|
383 return iPassword; |
|
384 } |
|
385 |
|
386 /** |
|
387 Returns ETrue if the password has been set. |
|
388 @return ETrue if the password has been set, EFalse if not. |
|
389 **/ |
|
390 EXPORT_C TBool TPbapAuthNotifierResponse::IsValidPassword() const |
|
391 { |
|
392 return iValidPassword; |
|
393 } |
|
394 |
|
395 |
|
396 // |
|
397 // TPanConnection |
|
398 // |
|
399 EXPORT_C TPanConnection::TPanConnection(TBTDevAddr& aRemoteDeviceAddress, |
|
400 TBool aUplinkAccessAllowed) |
|
401 : iRemoteDeviceAddress(aRemoteDeviceAddress), |
|
402 iUplinkAccessAllowed(aUplinkAccessAllowed) |
|
403 { |
|
404 } |
|
405 |
|
406 EXPORT_C TPanConnection::TPanConnection() |
|
407 : iRemoteDeviceAddress(0), |
|
408 iUplinkAccessAllowed(EFalse) |
|
409 { |
|
410 } |
|
411 |
|
412 EXPORT_C const TBTDevAddr& TPanConnection::RemoteDeviceAddress() const |
|
413 { |
|
414 return iRemoteDeviceAddress; |
|
415 } |
|
416 |
|
417 EXPORT_C TBool TPanConnection::UplinkAccessAllowed() const |
|
418 { |
|
419 return iUplinkAccessAllowed; |
|
420 } |
|
421 |
|
422 EXPORT_C TBool TPanConnection::IsValid() const |
|
423 { |
|
424 // Check if the address is valid (0x0000 0000 0000 is not a valid address). |
|
425 return (iRemoteDeviceAddress != 0); |
|
426 } |
|
427 |
|
428 |
|
429 // |
|
430 // TPanConnectionList |
|
431 // |
|
432 EXPORT_C TPanConnectionList::TPanConnectionList() |
|
433 : iPosition(0) |
|
434 { |
|
435 } |
|
436 |
|
437 EXPORT_C void TPanConnectionList::AddRemoteConnectionL(const TPanConnection& aRemoteConnection) |
|
438 /** |
|
439 Add a new PAN connection to the list |
|
440 @note This always appends the new connection to the end of the list |
|
441 @leave KErrNone if successful; KErrOverflow if there is no space left in the array |
|
442 */ |
|
443 { |
|
444 TInt err = KErrOverflow; |
|
445 for(TInt i=0;i<KMaxRemoteConnections;i++) |
|
446 { |
|
447 if(!iRemoteConnections[i].IsValid()) |
|
448 { |
|
449 iRemoteConnections[i] = aRemoteConnection; |
|
450 err = KErrNone; |
|
451 break; |
|
452 } |
|
453 } |
|
454 |
|
455 User::LeaveIfError(err); |
|
456 } |
|
457 |
|
458 EXPORT_C const TPanConnection* TPanConnectionList::GetNextRemoteConnection() |
|
459 /** |
|
460 Get the next device address from the list |
|
461 @note This method is stateful, and advances automatically to the next device address each time |
|
462 */ |
|
463 { |
|
464 TPanConnection* panConn = NULL; |
|
465 if(iPosition < KMaxRemoteConnections && iRemoteConnections[iPosition].IsValid()) |
|
466 { |
|
467 panConn = &iRemoteConnections[iPosition++]; |
|
468 } |
|
469 return panConn; |
|
470 } |
|
471 |
|
472 EXPORT_C const TPanConnection* TPanConnectionList::GetFirstRemoteConnection() |
|
473 { |
|
474 // Reset the internal state pointer to start from the begining of the array |
|
475 iPosition = 0; |
|
476 return GetNextRemoteConnection(); |
|
477 } |
|
478 |
|
479 EXPORT_C void TPanConnectionList::SetRequestedConnectionAddr(const TBTDevAddr& aRequestedConnectionAddr) |
|
480 { |
|
481 iRequestedConnectionAddr = aRequestedConnectionAddr; |
|
482 } |
|
483 |
|
484 EXPORT_C const TBTDevAddr* TPanConnectionList::RequestedConnectionAddr() |
|
485 { |
|
486 // Check if the address is valid (0x0000 0000 0000 is not a valid address). |
|
487 if(iRequestedConnectionAddr != 0) |
|
488 { |
|
489 return &iRequestedConnectionAddr; |
|
490 } |
|
491 return NULL; |
|
492 } |
|
493 |
|
494 EXPORT_C const TUUID& TPanConnectionList::CurrentLocalRole() const |
|
495 { |
|
496 return iCurrentLocalRole; |
|
497 } |
|
498 |
|
499 EXPORT_C void TPanConnectionList::SetCurrentLocalRole(const TUUID& aLocalRole) |
|
500 { |
|
501 iCurrentLocalRole = aLocalRole; |
|
502 } |
|
503 |
|
504 |
|
505 EXPORT_C TUint8 TPanConnectionList::MaxNumberOfRemoteConnections() |
|
506 { |
|
507 return KMaxRemoteConnections; |
|
508 } |
|
509 |
|
510 |
|
511 |
|
512 // |
|
513 // Standard Bluetooth Authentication Notifiers |
|
514 // |
|
515 |
|
516 |
|
517 // |
|
518 // TBTNotifierParams2 |
|
519 // |
|
520 |
|
521 /** |
|
522 @internalTechnology |
|
523 */ |
|
524 TBTNotifierParams2::TBTNotifierParams2(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName) |
|
525 : iBDAddr(aDevAddr) |
|
526 , iName(aDeviceName) |
|
527 { |
|
528 LOG_FUNC |
|
529 } |
|
530 |
|
531 /** |
|
532 Default constructor. Required to allow the class to be packaged with the TPckg family of classes. |
|
533 @internalTechnology |
|
534 */ |
|
535 TBTNotifierParams2::TBTNotifierParams2() |
|
536 : iBDAddr(0) |
|
537 , iName(KNullDesC) |
|
538 { |
|
539 LOG_FUNC |
|
540 } |
|
541 |
|
542 /** |
|
543 @return The Bluetooth device address of remote device with which a notifier is associated with. |
|
544 */ |
|
545 EXPORT_C TBTDevAddr TBTNotifierParams2::DeviceAddress() const |
|
546 { |
|
547 LOG_FUNC |
|
548 return iBDAddr; |
|
549 } |
|
550 |
|
551 /** |
|
552 @return The device name of the remote device with which a notifier is associated with. |
|
553 */ |
|
554 EXPORT_C TPtrC TBTNotifierParams2::DeviceName() const |
|
555 { |
|
556 LOG_FUNC |
|
557 return TPtrC(iName); |
|
558 } |
|
559 |
|
560 |
|
561 // |
|
562 // TBTNumericComparisonParams |
|
563 // |
|
564 |
|
565 /** |
|
566 @internalTechnology |
|
567 */ |
|
568 EXPORT_C TBTNumericComparisonParams::TBTNumericComparisonParams(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName, TUint32 aNumericalValue, TBTNumericComparisonParams::TComparisonScenario aComparisonScenario, TBool aLocallyInitiated) |
|
569 : TBTNotifierParams2(aDevAddr, aDeviceName) |
|
570 , iNumericalValue(aNumericalValue) |
|
571 , iComparisonScenario(aComparisonScenario) |
|
572 , iLocallyInitiated(aLocallyInitiated) |
|
573 { |
|
574 LOG_FUNC |
|
575 } |
|
576 |
|
577 /** |
|
578 Default constructor. Required to allow the class to be packaged with the TPckg family of classes. |
|
579 @internalTechnology |
|
580 */ |
|
581 EXPORT_C TBTNumericComparisonParams::TBTNumericComparisonParams() |
|
582 : TBTNotifierParams2() |
|
583 { |
|
584 LOG_FUNC |
|
585 } |
|
586 |
|
587 /** |
|
588 Accessor for the 6 digit decimal numeric value to be used for comparison. |
|
589 @return The numeric value to display to the user for numeric comparison. |
|
590 */ |
|
591 EXPORT_C TUint32 TBTNumericComparisonParams::NumericalValue() const |
|
592 { |
|
593 LOG_FUNC |
|
594 return iNumericalValue; |
|
595 } |
|
596 |
|
597 /** |
|
598 Accessor for the enumeration that indicates the particular numeric comparison scenario |
|
599 that the notifier is indicating. |
|
600 @return The scenario under which the numeric comparison will take place. |
|
601 */ |
|
602 EXPORT_C TBTNumericComparisonParams::TComparisonScenario TBTNumericComparisonParams::ComparisonScenario() const |
|
603 { |
|
604 LOG_FUNC |
|
605 return iComparisonScenario; |
|
606 } |
|
607 |
|
608 /** |
|
609 Accessor for indicating whether the numeric comparison process was initiated by a local request, |
|
610 or whether it was trigger by the remote device. |
|
611 @return EFalse if remote side initiated, otherwise it is locally initiated. |
|
612 */ |
|
613 EXPORT_C TBool TBTNumericComparisonParams::LocallyInitiated() const |
|
614 { |
|
615 LOG_FUNC |
|
616 return iLocallyInitiated; |
|
617 } |
|
618 |
|
619 |
|
620 // |
|
621 // TBTPasskeyDisplayParams |
|
622 // |
|
623 |
|
624 /** |
|
625 @internalTechnology |
|
626 */ |
|
627 EXPORT_C TBTPasskeyDisplayParams::TBTPasskeyDisplayParams(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName, TUint32 aNumericalValue, TBool aLocallyInitiated) |
|
628 : TBTNotifierParams2(aDevAddr, aDeviceName) |
|
629 , iNumericalValue(aNumericalValue) |
|
630 , iLocallyInitiated(aLocallyInitiated) |
|
631 { |
|
632 LOG_FUNC |
|
633 } |
|
634 |
|
635 /** |
|
636 Default constructor. Required to allow the class to be packaged with the TPckg family of classes. |
|
637 @internalTechnology |
|
638 */ |
|
639 EXPORT_C TBTPasskeyDisplayParams::TBTPasskeyDisplayParams() |
|
640 : TBTNotifierParams2() |
|
641 , iNumericalValue(0) |
|
642 { |
|
643 LOG_FUNC |
|
644 } |
|
645 |
|
646 /** |
|
647 Accessor for the 6 digit decimal numeric value to be used for passkey entry. |
|
648 @return The numeric value to display to the user for entry by the keyboard |
|
649 */ |
|
650 EXPORT_C TUint32 TBTPasskeyDisplayParams::NumericalValue() const |
|
651 { |
|
652 LOG_FUNC |
|
653 return iNumericalValue; |
|
654 } |
|
655 |
|
656 /** |
|
657 Accessor for indicating whether the passkey entry process was initiated by a local request, |
|
658 or whether it was trigger by the remote device. |
|
659 @return EFalse if remote side initiated, otherwise it is locally initiated. |
|
660 */ |
|
661 EXPORT_C TBool TBTPasskeyDisplayParams::LocallyInitiated() const |
|
662 { |
|
663 LOG_FUNC |
|
664 return iLocallyInitiated; |
|
665 } |
|
666 |
|
667 |
|
668 // |
|
669 // TBTPinCodeEntryNotifierParams |
|
670 // |
|
671 |
|
672 /** |
|
673 @internalTechnology |
|
674 */ |
|
675 EXPORT_C TBTPinCodeEntryNotifierParams::TBTPinCodeEntryNotifierParams(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName, TUint aPinCodeMinLength, TBool aLocallyInitiated, TBool aStrongPinCodeRequired, TUint aRecommendedPinCodeMinLength) |
|
676 : TBTNotifierParams2(aDevAddr, aDeviceName) |
|
677 , iPinCodeMinLength(aPinCodeMinLength) |
|
678 , iLocallyInitiated(aLocallyInitiated) |
|
679 , iStrongPinCodeRequired(aStrongPinCodeRequired) |
|
680 , iRecommendedPinCodeMinLength(aRecommendedPinCodeMinLength) |
|
681 { |
|
682 LOG_FUNC |
|
683 } |
|
684 |
|
685 |
|
686 /** |
|
687 Default constructor. Required to allow the class to be packaged with the TPckg family of classes. |
|
688 @internalTechnology |
|
689 */ |
|
690 EXPORT_C TBTPinCodeEntryNotifierParams::TBTPinCodeEntryNotifierParams() |
|
691 : TBTNotifierParams2() |
|
692 { |
|
693 LOG_FUNC |
|
694 } |
|
695 |
|
696 /** |
|
697 Accessor for the minimum PIN code length that should be enter into this notifier. |
|
698 @return The minimum PIN code length required. 0 means that there is no length requirement. |
|
699 */ |
|
700 EXPORT_C TUint TBTPinCodeEntryNotifierParams::PinCodeMinLength() const |
|
701 { |
|
702 LOG_FUNC |
|
703 return iPinCodeMinLength; |
|
704 } |
|
705 |
|
706 /** |
|
707 Accessor for the recommended minimum PIN code length that should be entered into this notifier. |
|
708 This is based on the length of the PIN code used in the previous pairing operation (if available), |
|
709 and is always greater than or equal to the required minimum PIN code length (as given by PinCodeMinLength()). |
|
710 If the recommended minimum PIN code length is used, then the strength of the link key used in the previous |
|
711 pairing operation is at least maintained. |
|
712 @return The recommended minimum PIN code length. 0 means that there is no length requirement. |
|
713 */ |
|
714 EXPORT_C TUint TBTPinCodeEntryNotifierParams::RecommendedPinCodeMinLength() const |
|
715 { |
|
716 LOG_FUNC |
|
717 return iRecommendedPinCodeMinLength; |
|
718 } |
|
719 |
|
720 /** |
|
721 Accessor for indicating whether the PIN code entry process was initiated by a local request, |
|
722 or whether it was trigger by the remote device. |
|
723 @return EFalse if remote side initiated, otherwise it is locally initiated. |
|
724 */ |
|
725 EXPORT_C TBool TBTPinCodeEntryNotifierParams::LocallyInitiated() const |
|
726 { |
|
727 LOG_FUNC |
|
728 return iLocallyInitiated; |
|
729 } |
|
730 |
|
731 /** |
|
732 Accessor for determining if a strong PIN code is required. It should be used by a notifier |
|
733 to ensure that a suitably strong PIN code is entered by the user. |
|
734 @return EFalse if a strong PIN code is not required, otherwise a strong PIN code should be entered if possible. |
|
735 */ |
|
736 EXPORT_C TBool TBTPinCodeEntryNotifierParams::StrongPinCodeRequired() const |
|
737 { |
|
738 LOG_FUNC |
|
739 return iStrongPinCodeRequired; |
|
740 } |
|
741 |
|
742 |
|
743 |
|
744 // |
|
745 // TBTNotifierUpdateParams2 |
|
746 // |
|
747 |
|
748 /** |
|
749 @internalTechnology |
|
750 */ |
|
751 TBTNotifierUpdateParams2::TBTNotifierUpdateParams2(TBTNotifierUpdateParams2::TUpdateParamType aType) |
|
752 : iType(aType) |
|
753 { |
|
754 LOG_FUNC |
|
755 } |
|
756 |
|
757 /** |
|
758 Default constructor. Required to allow the class to be packaged with the TPckg family of classes. |
|
759 @internalTechnology |
|
760 */ |
|
761 EXPORT_C TBTNotifierUpdateParams2::TBTNotifierUpdateParams2() |
|
762 { |
|
763 LOG_FUNC |
|
764 } |
|
765 |
|
766 /** |
|
767 Accessor to determine the type of update parameter this instance is. It should be used to determine |
|
768 what concrete update parameter type should be cast to. |
|
769 @return The type of update that is being made. |
|
770 */ |
|
771 EXPORT_C TBTNotifierUpdateParams2::TUpdateParamType TBTNotifierUpdateParams2::Type() const |
|
772 { |
|
773 LOG_FUNC |
|
774 return iType; |
|
775 } |
|
776 |
|
777 |
|
778 // |
|
779 // TBTDeviceNameUpdateParams |
|
780 // |
|
781 |
|
782 /** |
|
783 @internalTechnology |
|
784 */ |
|
785 EXPORT_C TBTDeviceNameUpdateParams::TBTDeviceNameUpdateParams(const TDesC& aDeviceName, TInt aResult) |
|
786 : TBTNotifierUpdateParams2(TBTNotifierUpdateParams2::EDeviceName) |
|
787 , iDeviceName(aDeviceName) |
|
788 , iResult(aResult) |
|
789 { |
|
790 LOG_FUNC |
|
791 } |
|
792 |
|
793 /** |
|
794 Default constructor. Required to allow the class to be packaged with the TPckg family of classes. |
|
795 @internalTechnology |
|
796 */ |
|
797 EXPORT_C TBTDeviceNameUpdateParams::TBTDeviceNameUpdateParams() |
|
798 : TBTNotifierUpdateParams2() |
|
799 { |
|
800 LOG_FUNC |
|
801 } |
|
802 |
|
803 /** |
|
804 @return The device name of the remote device with which a notifier is associated with. |
|
805 */ |
|
806 EXPORT_C TPtrC TBTDeviceNameUpdateParams::DeviceName() const |
|
807 { |
|
808 LOG_FUNC |
|
809 return TPtrC(iDeviceName); |
|
810 } |
|
811 |
|
812 /** |
|
813 @return The result of the attempt to get the device name. |
|
814 */ |
|
815 EXPORT_C TInt TBTDeviceNameUpdateParams::Result() const |
|
816 { |
|
817 LOG_FUNC |
|
818 return iResult; |
|
819 } |
|
820 |
|
821 |
|
822 // |
|
823 // TBTPasskeyDisplayUpdateParams |
|
824 // |
|
825 |
|
826 /** |
|
827 @internalTechnology |
|
828 */ |
|
829 EXPORT_C TBTPasskeyDisplayUpdateParams::TBTPasskeyDisplayUpdateParams(THCIPasskeyEntryNotificationType aNotificationType) |
|
830 : TBTNotifierUpdateParams2(TBTNotifierUpdateParams2::EPasskeyDisplay) |
|
831 , iNotificationType(aNotificationType) |
|
832 { |
|
833 LOG_FUNC |
|
834 } |
|
835 |
|
836 /** |
|
837 Default constructor. Required to allow the class to be packaged with the TPckg family of classes. |
|
838 @internalTechnology |
|
839 */ |
|
840 EXPORT_C TBTPasskeyDisplayUpdateParams::TBTPasskeyDisplayUpdateParams() |
|
841 : TBTNotifierUpdateParams2() |
|
842 { |
|
843 LOG_FUNC |
|
844 } |
|
845 |
|
846 /** |
|
847 Accessor for the keypress notification type that this update type represents. The use of these |
|
848 updates is to allow the UI to show the user the process of the entry of keypresses on a device with a |
|
849 numeric key board but no display. |
|
850 @return The type of keypress notification that has been received from the remote device |
|
851 */ |
|
852 EXPORT_C THCIPasskeyEntryNotificationType TBTPasskeyDisplayUpdateParams::KeypressNotification() const |
|
853 { |
|
854 LOG_FUNC |
|
855 return iNotificationType; |
|
856 } |
|
857 |