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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef BTEXTNOTIFIERS_H
17 #define BTEXTNOTIFIERS_H
24 #define NOTIFIERS_SUPPORT_PASSKEY_MIN_LENGTH
31 UID to invoke the device selection dialog via the notifier framework.
33 const TUid KDeviceSelectionNotifierUid={0x100069D1};
39 UID of the PBAP authentication notifier
41 const TUid KPbapAuthNotifierUid={0x10282B22};
48 UID to notify the UI that a bluetooth link is currently active.
49 Now deprecated by the publish/subscribe mechanism.
51 const TUid KUidBTBasebandNotification={0x1000A5FB};
53 NONSHARABLE_CLASS(TBTDeviceSelectionParams)
58 Class to allow parameters to be sent to the device selection dialog via the RNotifier API.
62 IMPORT_C TBTDeviceSelectionParams();
63 IMPORT_C void SetUUID(const TUUID& aUUID);
64 IMPORT_C void SetDeviceClass(TBTDeviceClass aClass);
65 IMPORT_C const TUUID& UUID();
66 IMPORT_C TBTDeviceClass DeviceClass();
67 IMPORT_C TBool IsValidDeviceClass();
68 IMPORT_C TBool IsValidUUID();
70 TBTDeviceClass iDeviceClass; /*!< The device class */
71 TUUID iSdpUuid; /*!< The sdp uuid */
72 TBool iValidDeviceClass; /*!< ETrue if iDeviceClass has been set, EFalse if not */
73 TBool iValidUuid; /*!< ETrue if iSdpUuid has be set, EFalse if not */
75 // This data padding has been added to help prevent future binary compatibility breaks
76 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
81 NONSHARABLE_CLASS(TBTDeviceResponseParams)
86 Class to allow parameters to be received from the device selection dialog via the RNotifier API.
90 IMPORT_C TBTDeviceResponseParams();
91 IMPORT_C void SetDeviceAddress(const TBTDevAddr& aBDAddr); ///< Set the address of the device
92 IMPORT_C void SetDeviceName(const TDesC& aName); ///< Set the name of the device
93 IMPORT_C void SetDeviceClass(TBTDeviceClass aClass);
94 IMPORT_C const TBTDevAddr& BDAddr() const; ///< Returns the address of the device
95 IMPORT_C const TDesC& DeviceName() const; ///< Returns the name of the device
96 IMPORT_C TBTDeviceClass DeviceClass();
97 IMPORT_C TBool IsValidBDAddr() const; ///< Has the address of the device been set?
98 IMPORT_C TBool IsValidDeviceName() const; ///< Has the name of the device been set?
99 IMPORT_C TBool IsValidDeviceClass();
101 TBTDevAddr iBDAddr; /*!< The BT address of the remote device */
102 TBuf<KMaxBluetoothNameLen> iDeviceName; /*!< The name given by the remote device */
103 TBTDeviceClass iDeviceClass; /*!< The device class */
104 TBool iValidBDAddr; /*!< ETrue if iBDAddr has been set, EFalse if not */
105 TBool iValidDeviceName; /*!< ETrue if iDeviceName has been set, EFalse if not */
106 TBool iValidDeviceClass; /*!< ETrue if iDeviceClass has been set, EFalse if not */
108 // This data padding has been added to help prevent future binary compatibility breaks
109 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
118 Typedef'ed pckgbuf to send paramaters to the device selection dialog via the notifier framework.
120 typedef TPckgBuf<TBTDeviceSelectionParams> TBTDeviceSelectionParamsPckg;
126 Typedef'ed pckgbuf to retrieve the response from the device selection dialog via the notifier framework.
128 typedef TPckgBuf<TBTDeviceResponseParams> TBTDeviceResponseParamsPckg;
132 Use TBTDeviceList::MaxNumberOfDevices() instead. Note however that
133 you should call this function each time you wish to use this value
134 rather than storing a copy because the actual value is subject to
137 const TUint KMaxPanDevicesForSimultaneousSelection = 8;
139 NONSHARABLE_CLASS(TBTDeviceList)
141 A list of TBTDevAddrs
142 @note Used to pass a list of devices to which to connect.
148 IMPORT_C TBTDeviceList();
150 IMPORT_C TInt AddDevice(const TBTDevAddr& aDevAddr);
151 IMPORT_C TInt GetDevice(TBTDevAddr& aDevAddr);
152 IMPORT_C void Reset();
154 IMPORT_C operator const TDesC8&();
155 IMPORT_C operator TDes8&();
157 IMPORT_C TUint MaxNumberOfDevices();
160 const static TUint KMaxDevicesForSimultaneousSelection = 8;
163 TInt iPosition; // the position within the list for stateful reading
164 TFixedArray<TBTDevAddr, KMaxDevicesForSimultaneousSelection> iDevices;
165 TPckg<TFixedArray<TBTDevAddr, KMaxDevicesForSimultaneousSelection> > iPtr;
167 const TBTDevAddr iKNullDevAddr;
169 // This data padding has been added to help prevent future binary compatibility breaks
170 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
176 /** Maximum length of the Realm text buffer. */
177 const TUint KPbapAuthRealmLength = 256;
179 /** Maximum length of the password text buffer. */
180 const TUint KPbapAuthPasswordLength = 64;
182 NONSHARABLE_CLASS(TPbapAuthNotifierParams)
184 Parameters passed to the PBAP authentication notifier plugin
190 IMPORT_C TPbapAuthNotifierParams();
192 IMPORT_C void SetRealm(const TDesC& aRealm);
193 IMPORT_C void SetRemoteAddr(const TBTDevAddr& aBDAddr);
195 IMPORT_C const TDesC& Realm() const;
196 IMPORT_C TBool RealmTruncated() const;
197 IMPORT_C const TBTDevAddr& RemoteAddr() const;
199 IMPORT_C TBool IsValidRealm() const;
200 IMPORT_C TBool IsValidRemoteAddr() const;
203 TBuf<KPbapAuthRealmLength> iRealm; /*!< The Realm specified by the device requesting authentication. */
204 TBool iRealmTruncated; /*!< Set to ETrue if iRealm has been truncated */
205 TBTDevAddr iRemoteAddr; /*!< The Bluetooth device address of the device requesting authentication. */
207 TBool iValidRealm; /*!< ETrue if iRealm has been set, EFalse if not */
208 TBool iValidRemoteAddr; /*!< ETrue if iRemoteAddr has been set, EFalse if not */
210 // This data padding has been added to help prevent future binary compatibility breaks
211 // iPadding has not been zero'd because they are currently not used
216 Packaged version of <code>TPbapAuthNotifierParams</code> that allows data transfer over process boundaries.
220 typedef TPckgBuf<TPbapAuthNotifierParams> TPbapAuthNotifierParamsPckg;
222 NONSHARABLE_CLASS(TPbapAuthNotifierResponse)
224 Response data from the PBAP authentication notifier plugin
230 IMPORT_C TPbapAuthNotifierResponse();
232 IMPORT_C TBool SetPassword(const TDesC& aPassword);
233 IMPORT_C void ResetPassword();
235 IMPORT_C const TDesC& Password() const;
237 IMPORT_C TBool IsValidPassword() const;
240 /** The password used to create the challenge response. */
241 TBuf<KPbapAuthPasswordLength> iPassword;
243 TBool iValidPassword; /*!< ETrue if iPassword has been set, EFalse if not */
245 // This data padding has been added to help prevent future binary compatibility breaks
246 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
252 Packaged version of <code>TPbapAuthNotifierResponse</code> that allows data transfer over process boundaries.
256 typedef TPckgBuf<TPbapAuthNotifierResponse> TPbapAuthNotifierResponsePckg;
260 A remote device address, and a boolean indicating if the remote device has access
265 NONSHARABLE_CLASS(TPanConnection)
268 IMPORT_C TPanConnection(TBTDevAddr& aRemoteDeviceAddress,
269 TBool aUplinkAccessAllowed);
271 IMPORT_C const TBTDevAddr& RemoteDeviceAddress() const;
272 IMPORT_C TBool UplinkAccessAllowed() const;
273 IMPORT_C TBool IsValid() const;
275 // Non-exported constructor. Allows creation of default NULL instance
279 TBTDevAddr iRemoteDeviceAddress;
280 TBool iUplinkAccessAllowed;
282 // This data padding has been added to help prevent future binary compatibility breaks
283 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
290 A list of TPanConnection instances
295 NONSHARABLE_CLASS(TPanConnectionList)
298 IMPORT_C TPanConnectionList();
300 IMPORT_C void AddRemoteConnectionL(const TPanConnection& aRemoteConnection);
301 IMPORT_C const TPanConnection* GetFirstRemoteConnection();
302 IMPORT_C const TPanConnection* GetNextRemoteConnection();
304 IMPORT_C void SetRequestedConnectionAddr(const TBTDevAddr& aRequestedConnectionAddr);
305 IMPORT_C const TBTDevAddr* RequestedConnectionAddr();
307 IMPORT_C const TUUID& CurrentLocalRole() const;
308 IMPORT_C void SetCurrentLocalRole(const TUUID& aLocalRole);
310 IMPORT_C TUint8 MaxNumberOfRemoteConnections();
313 const static TUint8 KMaxRemoteConnections = 7;
316 TUint8 iPosition; // the position within the list for stateful reading
317 TFixedArray<TPanConnection, KMaxRemoteConnections> iRemoteConnections;
319 TBTDevAddr iRequestedConnectionAddr;
321 TUUID iCurrentLocalRole;
323 // This data padding has been added to help prevent future binary compatibility breaks
324 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
333 Typedef'ed pckgbuf for TPanConnectionList.
335 typedef TPckgBuf<TPanConnectionList> TPanConnectionListPckg;
342 The response from the incoming PAN NAP connection selection dialog.
344 enum TNapConnectionResult
346 EDisallowNewNapConnection,
347 EAcceptNapConnectionAllowUplinkAccess,
348 EAcceptNapConnectionDisallowUplinkAccess,
355 Typedef'ed pckgbuf to retrieve the response from the incoming PAN NAP connection
356 selection dialog via the notifier framework.
358 typedef TPckgBuf<TNapConnectionResult> TNapConnectionResultPckg;
364 // Standard Bluetooth Authentication Notifiers
369 UID of the "Numeric Comparison" confirmation request RNotifier plugin.
371 The notifier will be started with a parameter of type TBTNumericComparisonParamsPckg.
373 The notifier will receive updates of type TBTNotifierUpdateParamsPckg2.
375 @see TBTNotifierUpdateParamsPckg2
380 const TUid KBTNumericComparisonNotifierUid={0x10285AD5};
383 UID of the "Passkey Entry" display RNotifier plugin.
385 The notifier will be started with a parameter of type TBTPasskeyDisplayParamsPckg.
387 The notifier will receive updates of type TBTNotifierUpdateParamsPckg2.
389 @see TBTNotifierUpdateParamsPckg2
394 const TUid KBTPasskeyDisplayNotifierUid={0x10285AD4};
397 UID of the "PIN Code Entry" RNotifier plugin.
399 Note that this is an SSP aware notifier taking the new parameter type. This is
400 intended to replace the deprecated KBTManPinNotifierUid RNotifier plugin.
401 @see KBTManPinNotifierUid
403 The notifier will be started with a parameter of type TBTPinCodeEntryNotifierParamsPckg.
405 The notifier will receive updates of type TBTNotifierUpdateParamsPckg2.
407 @see TBTNotifierUpdateParamsPckg2
412 const TUid KBTPinCodeEntryNotifierUid={0x10285D55};
416 The base parameter for the secure simple pairing notifiers.
421 NONSHARABLE_CLASS(TBTNotifierParams2)
424 IMPORT_C TBTDevAddr DeviceAddress() const;
425 IMPORT_C TPtrC DeviceName() const;
428 TBTNotifierParams2(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName);
429 TBTNotifierParams2();
435 // This data padding has been added to help prevent future binary compatibility breaks
436 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
443 Secure simple pairing "Numeric Comparison" parameters.
444 This class packages the parameters passed to a numeric comparison notifier.
449 NONSHARABLE_CLASS(TBTNumericComparisonParams)
450 : public TBTNotifierParams2
454 This represents the type of comparison that is being performed.
455 It is intended to allow the UI to present the user of the device
456 with suitable information to help them complete the pairing.
458 enum TComparisonScenario
460 ERemoteCannotConfirm, /*!< Only the Symbian device can confirm the displayed numbers are the same. */
461 ERemoteCanConfirm, /*!< Both devices can confirm that the displayed numbers are the same */
465 IMPORT_C TBTNumericComparisonParams(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName, TUint32 aNumericalValue, TComparisonScenario aComparisonScenario, TBool aLocallyInitiated);
466 IMPORT_C TBTNumericComparisonParams();
469 IMPORT_C TUint32 NumericalValue() const;
470 IMPORT_C TComparisonScenario ComparisonScenario() const;
471 IMPORT_C TBool LocallyInitiated() const;
474 TUint32 iNumericalValue;
475 TComparisonScenario iComparisonScenario;
476 TBool iLocallyInitiated;
478 // This data padding has been added to help prevent future binary compatibility breaks
479 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
486 Secure simple pairing "Passkey Entry" display parameters.
487 This class packages the parameters passed to a passkey display notifier.
492 NONSHARABLE_CLASS(TBTPasskeyDisplayParams)
493 : public TBTNotifierParams2
496 IMPORT_C TBTPasskeyDisplayParams(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName, TUint32 aNumericalValue, TBool aLocallyInitiated);
497 IMPORT_C TBTPasskeyDisplayParams();
500 IMPORT_C TUint32 NumericalValue() const;
501 IMPORT_C TBool LocallyInitiated() const;
504 TUint32 iNumericalValue;
505 TBool iLocallyInitiated;
507 // This data padding has been added to help prevent future binary compatibility breaks
508 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
514 Simple secure pairing aware "PIN Code Entry" request parameters.
515 This class packages the parameters passed to a PIN code entry notifier.
520 NONSHARABLE_CLASS(TBTPinCodeEntryNotifierParams)
521 : public TBTNotifierParams2
524 IMPORT_C TBTPinCodeEntryNotifierParams(const TBTDevAddr& aDevAddr, const TDesC& aDeviceName, TUint aPinCodeMinLength, TBool aLocallyInitiated, TBool aStrongPinCodeRequired, TUint aRecommendedPinCodeMinLength);
525 IMPORT_C TBTPinCodeEntryNotifierParams();
528 IMPORT_C TUint PinCodeMinLength() const;
529 IMPORT_C TBool LocallyInitiated() const;
530 IMPORT_C TBool StrongPinCodeRequired() const;
531 IMPORT_C TUint RecommendedPinCodeMinLength() const;
534 TUint iPinCodeMinLength;
535 TBool iLocallyInitiated;
536 TBool iStrongPinCodeRequired;
537 //TUint32 used here as this space was once a padding field.
538 TUint32 iRecommendedPinCodeMinLength;
540 // This data padding has been added to help prevent future binary compatibility breaks
541 // iPadding1 has not been zero'd because it is currently not used
547 The base update parameter for the Bluetooth pairing notifiers.
548 This class is intended to allow multiple different updates parameters to be
549 passed to the Bluetooth notifiers.
554 NONSHARABLE_CLASS(TBTNotifierUpdateParams2)
557 enum TUpdateParamType
564 IMPORT_C TBTNotifierUpdateParams2();
565 IMPORT_C TUpdateParamType Type() const;
568 TBTNotifierUpdateParams2(TBTNotifierUpdateParams2::TUpdateParamType aType);
571 TUpdateParamType iType;
573 // This data padding has been added to help prevent future binary compatibility breaks
574 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
581 Bluetooth device name update parameter.
582 This class provides the parameters to indicate an update to the name of
583 the Bluetooth device for which the notifier is waiting for input.
588 NONSHARABLE_CLASS(TBTDeviceNameUpdateParams)
589 : public TBTNotifierUpdateParams2
592 IMPORT_C TBTDeviceNameUpdateParams(const TDesC& aDeviceName, TInt aResult);
593 IMPORT_C TBTDeviceNameUpdateParams();
596 IMPORT_C TPtrC DeviceName() const;
597 IMPORT_C TInt Result() const;
600 TBTDeviceName iDeviceName;
603 // This data padding has been added to help prevent future binary compatibility breaks
604 // Neither iPadding1 nor iPadding2 have been zero'd because they are currently not used
610 Secure simple pairing "Passkey Entry" display update parameters.
611 This class provides the update parameters associated with a passkey entry
612 display notifier. Notably it provides the notification of keypresses from
618 NONSHARABLE_CLASS(TBTPasskeyDisplayUpdateParams)
619 : public TBTNotifierUpdateParams2
622 IMPORT_C TBTPasskeyDisplayUpdateParams(THCIPasskeyEntryNotificationType aNotificationType);
623 IMPORT_C TBTPasskeyDisplayUpdateParams();
626 IMPORT_C THCIPasskeyEntryNotificationType KeypressNotification() const;
629 THCIPasskeyEntryNotificationType iNotificationType;
636 Typedef'ed pckgbuf to send numeric comparison parameters to the notifier framework.
640 typedef TPckgBuf<TBTNumericComparisonParams> TBTNumericComparisonParamsPckg;
642 Typedef'ed pckgbuf to send passkey entry display parameters to the notifier framework.
646 typedef TPckgBuf<TBTPasskeyDisplayParams> TBTPasskeyDisplayParamsPckg;
648 Typedef'ed pckgbuf to send PIN code entry parameters to the notifier framework.
652 typedef TPckgBuf<TBTPinCodeEntryNotifierParams> TBTPinCodeEntryNotifierParamsPckg;
655 Typedef'ed pckgbuf to represent the base class of Bluetooth update parameters.
659 typedef TPckgBuf<TBTNotifierUpdateParams2> TBTNotifierUpdateParamsPckg2;
661 Typedef'ed pckgbuf to send device name update parameters to the notifier framework.
665 typedef TPckgBuf<TBTDeviceNameUpdateParams> TBTDeviceNameUpdateParamsPckg;
667 Typedef'ed pckgbuf to send passkey entry display update parameters to the notifier framework.
671 typedef TPckgBuf<TBTPasskeyDisplayUpdateParams> TBTPasskeyDisplayUpdateParamsPckg;
673 #endif // BTEXTNOTIFIERS_H