Chromium Code Reviews| Index: device/bluetooth/public/interfaces/adapter.mojom |
| diff --git a/device/bluetooth/public/interfaces/adapter.mojom b/device/bluetooth/public/interfaces/adapter.mojom |
| index 50042ae7a27e94750df7fc1c09967588dcf20f58..88c0f92d86fcd4f6a60258098cf953e7b24782a3 100644 |
| --- a/device/bluetooth/public/interfaces/adapter.mojom |
| +++ b/device/bluetooth/public/interfaces/adapter.mojom |
| @@ -39,10 +39,21 @@ struct AdapterInfo { |
| bool discovering; |
| }; |
| -interface Adapter { |
| - // Gets basic information about the adapter. |
| - GetInfo() => (AdapterInfo info); |
| +interface DiscoverySession { |
| + // Returns true if the session is active, false otherwise. If false, the |
| + // adapter might still be discovering as there might still be other active |
| + // sessions; this just means that this instance no longer has a say in |
| + // whether or not discovery should continue. In this case, a new |
| + // DiscoverySession should be started to make sure that device discovery |
| + // continues. |
| + IsActive() => (bool active); |
| + |
| + // Requests this discovery session instance to stop. If this instance is |
| + // active, the session will stop. Returns false if this session is inactive. |
| + Stop() => (bool success); |
|
scheib
2017/01/05 01:02:20
Copy more of the comment from bluetooth_discovery_
mbrunson
2017/01/05 01:19:14
Ok. I've copied the original comment from bluetoot
|
| +}; |
| +interface Adapter { |
| // Creates a GATT connection to the device with |address| and returns a |
| // Device if the connection was succesful. The GATT connection is tied to the |
| // the lifetime of the Device message pipe. |
| @@ -53,17 +64,24 @@ interface Adapter { |
| // during a classic or low-energy scan. |
| GetDevices() => (array<DeviceInfo> devices); |
| + // Gets basic information about the adapter. |
| + GetInfo() => (AdapterInfo info); |
| + |
| // Sets the client that listens for the adapter's events. |
| SetClient(AdapterClient client); |
| + |
| + // Requests the adapter to start a new discovery session. Returns null if |
| + // session not created successfully. |
| + StartDiscoverySession() => (DiscoverySession? session); |
| }; |
| interface AdapterClient { |
| + // Called when the discovering state of the adapter changes. |
| + DiscoveringChanged(bool discovering); |
| + |
| // Called the first time a device is discovered. |
| DeviceAdded(DeviceInfo device); |
| - // Called after the device hasn't been seen for 3 minutes. |
| - DeviceRemoved(DeviceInfo device); |
| - |
| // Called when one of the following properties of a device changes: |
| // Address, appearance, Bluetooth class, Inquiry RSSI, Inquiry TX Power, |
| // Service UUIDs, Connectionable state, Connection state, Pairing state, |
| @@ -72,6 +90,10 @@ interface AdapterClient { |
| // guaranteed on ChromeOS or Linux. Because the RSSI is always changing, |
| // it's very likely this will be called for each advertising packet. |
| DeviceChanged(DeviceInfo device); |
| + |
| + // Called after the device hasn't been seen for 3 minutes. |
| + DeviceRemoved(DeviceInfo device); |
| + |
| }; |
| interface AdapterFactory { |