| Index: extensions/common/api/bluetooth_private.idl
|
| diff --git a/extensions/common/api/bluetooth_private.idl b/extensions/common/api/bluetooth_private.idl
|
| index 7d7d2448ffbde60c654434878cd0eabaf929934d..0ef9bc2ac362ee19e02c167def88841eb83377a2 100644
|
| --- a/extensions/common/api/bluetooth_private.idl
|
| +++ b/extensions/common/api/bluetooth_private.idl
|
| @@ -43,6 +43,20 @@ namespace bluetoothPrivate {
|
| complete
|
| };
|
|
|
| + // Results for connect(). See function declaration for details.
|
| + enum ConnectResultType {
|
| + success,
|
| + unknownError,
|
| + inProgress,
|
| + alreadyConnected,
|
| + failed,
|
| + authFailed,
|
| + authCanceled,
|
| + authRejected,
|
| + authTimeout,
|
| + unsupportedDevice
|
| + };
|
| +
|
| // Valid pairing responses.
|
| enum PairingResponse {
|
| confirm, reject, cancel
|
| @@ -105,6 +119,7 @@ namespace bluetoothPrivate {
|
| };
|
|
|
| callback VoidCallback = void();
|
| + callback ConnectCallback = void(ConnectResultType result);
|
|
|
| // These functions all report failures via chrome.runtime.lastError.
|
| interface Functions {
|
| @@ -124,6 +139,12 @@ namespace bluetoothPrivate {
|
| static void setDiscoveryFilter(DiscoveryFilter discoveryFilter,
|
| optional VoidCallback callback);
|
|
|
| + // Connects to the given device. This will only throw an error if the
|
| + // device address is invalid or the device is already connected. Otherwise
|
| + // this will succeed and invoke |callback| with ConnectResultType.
|
| + static void connect(DOMString deviceAddress,
|
| + optional ConnectCallback callback);
|
| +
|
| // Pairs the given device.
|
| static void pair(DOMString deviceAddress, optional VoidCallback callback);
|
| };
|
|
|