Chromium Code Reviews| 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..0dcb227bbb50ce1315361f815791616763414ed2 100644 |
| --- a/extensions/common/api/bluetooth_private.idl |
| +++ b/extensions/common/api/bluetooth_private.idl |
| @@ -43,6 +43,19 @@ namespace bluetoothPrivate { |
| complete |
| }; |
| + // Results for connect(). See function declaration for details. |
| + enum ConnectResultType { |
| + success, |
| + unknownError, |
| + inProgress, |
| + failed, |
| + authFailed, |
| + authCanceled, |
| + authRejected, |
| + authTimeout, |
| + unsupportedDevice |
| + }; |
| + |
| // Valid pairing responses. |
| enum PairingResponse { |
| confirm, reject, cancel |
| @@ -105,6 +118,7 @@ namespace bluetoothPrivate { |
| }; |
| callback VoidCallback = void(); |
| + callback ConnectCallback = void(ConnectResultType result); |
| // These functions all report failures via chrome.runtime.lastError. |
| interface Functions { |
| @@ -124,6 +138,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 |
|
Devlin
2015/10/29 19:32:08
Hmm... this seems a bit arbitrary. Device address
stevenjb
2015/11/02 20:05:36
So, you're right about already connected, I will m
|
| + // 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); |
| }; |