B2G/Bluetooth/WebBluetooth-v2/BluetoothPairingListener

From MozillaWiki
Jump to: navigation, search

Overview

BluetoothPairingListener wraps event handlers triggered for different pairing types. These event handlers are available in certified applications only to keep privileged applications from replying other applications' pairing requests.

Interface

[AvailableIn=CertifiedApps, CheckPermissions="bluetooth"]
interface BluetoothPairingListener: EventTarget {
  attribute EventHandler ondisplaypasskeyreq;
  attribute EventHandler onenterpincodereq;
  attribute EventHandler onpairingconfirmationreq;
  attribute EventHandler onpairingconsentreq;
}

Event Handler

ondisplaypasskeyreq

Description
A handler to trigger when a remote bluetooth device requests to display passkey on the screen during pairing process.
Parameter
aPairingEvent
The event is a BluetoothPairingEvent with property deviceName as the remote bluetooth device's name, and property handle that carries the passkey to display.

onenterpincodereq

Description
A handler to trigger when a remote bluetooth device requests user enter PIN code during pairing process.
Parameter
aPairingEvent
The event is a BluetoothPairingEvent with property deviceName as the remote bluetooth device's name, and property handle that carries method setPinCode to reply the PIN code entered by user.

onpairingconfirmationreq

Description
A handler to trigger when a remote bluetooth device requests user confirm passkey during pairing process. Applications may prompt passkey to user for confirmation, or confirm the passkey for user proactively.
Parameter
aPairingEvent
The event is a BluetoothPairingEvent with property deviceName as the remote bluetooth device's name, and property handle that carries the passkey to confirm and method setPairingConfirmation to reply user confirmation.

onpairingconsentreq

Description
A handler to trigger when a remote bluetooth device requests user confirm pairing during pairing process. Applications may prompt user for confirmation or confirm for user proactively.
Parameter
aPairingEvent
The event is a BluetoothPairingEvent with property deviceName as the remote bluetooth device's name.