B2G/Bluetooth/WebBluetooth-v2/BluetoothPairingEvent: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 5: Line 5:
  interface BluetoothPairingEvent : Event
  interface BluetoothPairingEvent : Event
  {
  {
   readonly attribute DOMString address;
   readonly attribute BluetoothDevice device;
   readonly attribute unsigned long passkey;
   readonly attribute unsigned long? passkey;
  DOMRequest? setPasskey(DOMString aPasskey);
  DOMRequest? setPairingConfirmation(boolean aConfirm);
  };
  };


== Properties ==
== Properties ==
* [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothPairingEvent#address BluetoothPairingEvent.address]
* [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothPairingEvent#device BluetoothPairingEvent.device]
* [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothPairingEvent#passkey BluetoothPairingEvent.passkey]
* [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothPairingEvent#passkey BluetoothPairingEvent.passkey]


=== address ===
=== device ===
; Description
; Description
: The address of remote pairing bluetooth device.
: The remote pairing bluetooth device.


; Value type
; Value type
: DOMString
: [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice BluetoothDevice]


=== passkey ===
=== passkey ===
; Description
; Description
: A passkey may be generated during the pairing process when both devices support secure simple pairing(SSP). Although BluetoothPairingEvent would be used in several event handlers, only the one fired with adapter.ondisplaypasskeyreq() will have passkey being set. For other cases, this value should be set to null.
: The passkey generated during the pairing process when both devices support secure simple pairing (SSP). The valid values of passkey are decimal 000000 - 999999.
: Numeric value (passkey) entered by user. Valid values are decimal 000000 - 999999.


; Value type
; Value type
: unsigned long
: unsigned long
; Default value
: 0
== Methods ==
* [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothPairingEvent#setPasskey.28DOMString_aPasskey.29 BluetoothPairingEvent.setPasskey(DOMString aPasskey)]
* [https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothPairingEvent#setPairingConfirmation.28boolean_aConfirm.29 BluetoothPairingEvent.setPairingConfirmation(boolean aConfirm)]
=== setPasskey(DOMString aPasskey) ===
; Description
: The method replies the requested passkey when the device's adapter is pairing with a remote device.
; Parameter
: ''aPasskey''
:: A DOMString representing the passkey code set by user.
; Return
: A DOMRequest object to handle the success or error of the operation. In case of success, it means that the setPasskey operation has completed.
=== setPairingConfirmation(boolean aConfirm) ===
; Description
: The method replies the pairing confirmation when the device's adapter is pairing with a remote device.
; Parameter
: ''aConfirm''
:: A boolean indicating whether user confirms pairing with the remote device (true) or not (false).
; Return
: A DOMRequest object to handle the success or error of the operation. In case of success, it means that the setPairingConfirmation operation has completed.
Confirmed users
891

edits

Navigation menu