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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e46e7a9b89ed12953058d31d1649cb3b4e2cd33f |
| --- /dev/null |
| +++ b/device/bluetooth/public/interfaces/adapter.mojom |
| @@ -0,0 +1,30 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +module bluetooth.mojom; |
| + |
| +struct DeviceInfo { |
| + string? name; |
| + string name_for_display; |
| + string id; |
| + string address; |
| +}; |
| + |
| +interface Adapter { |
| + // Retrieves the list of the devices known by the adapter including Connected |
| + // Devices, GATT Connected Devices, Paired Devices and Devices discovered |
| + // during a classic or low-energy scan. |
| + GetDevices() => (array<DeviceInfo> devices); |
| + |
| + // Sets the client that listens for the adapter's events. |
|
dpapad
2016/10/03 17:51:03
Optional: It is not clear at all that the "client"
mbrunson
2016/10/03 18:56:03
This Mojo interface will not be used exclusively b
|
| + SetClient(AdapterClient client); |
| +}; |
| + |
| +interface AdapterClient { |
| + // 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); |
| +}; |