Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Side by Side Diff: device/bluetooth/public/interfaces/adapter.mojom

Issue 2401193002: bluetooth: Add Device service for chrome://bluetooth-internals. (Closed)
Patch Set: Add log function comment Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 module bluetooth.mojom; 5 module bluetooth.mojom;
6 6
7 import "le_device.mojom";
8
7 struct AdapterInfo { 9 struct AdapterInfo {
8 string address; 10 string address;
9 string name; 11 string name;
10 bool initialized; 12 bool initialized;
11 bool present; 13 bool present;
12 bool powered; 14 bool powered;
13 bool discoverable; 15 bool discoverable;
14 bool discovering; 16 bool discovering;
15 }; 17 };
16 18
17 struct DeviceInfo { 19 interface Adapter {
18 string? name; 20 // Gets the Device service for the device at the given address.
19 string name_for_display; 21 GetDeviceService(string address) => (LEDevice? device);
ortuno 2016/10/10 00:11:20 nit: I would move this below GetDevices() to keep
mbrunson 2016/10/10 19:21:28 Done.
20 string id;
21 string address;
22 };
23 22
24 interface Adapter {
25 // Returns basic information about the adapter. 23 // Returns basic information about the adapter.
26 // Returns null, If no adapter is available.
27 GetInfo() => (AdapterInfo info); 24 GetInfo() => (AdapterInfo info);
28 25
29 // Retrieves the list of the devices known by the adapter including Connected 26 // Retrieves the list of the devices known by the adapter including Connected
30 // Devices, GATT Connected Devices, Paired Devices and Devices discovered 27 // Devices, GATT Connected Devices, Paired Devices and Devices discovered
31 // during a classic or low-energy scan. 28 // during a classic or low-energy scan.
32 GetDevices() => (array<DeviceInfo> devices); 29 GetDevices() => (array<LEDeviceInfo> devices);
33 30
34 // Sets the client that listens for the adapter's events. 31 // Sets the client that listens for the adapter's events.
35 SetClient(AdapterClient client); 32 SetClient(AdapterClient client);
36 }; 33 };
37 34
38 interface AdapterClient { 35 interface AdapterClient {
39 // Called the first time a device is discovered. 36 // Called the first time a device is discovered.
40 DeviceAdded(DeviceInfo device); 37 DeviceAdded(LEDeviceInfo device);
41 38
42 // Called after the device hasn't been seen for 3 minutes. 39 // Called after the device hasn't been seen for 3 minutes.
43 DeviceRemoved(DeviceInfo device); 40 DeviceRemoved(LEDeviceInfo device);
44 }; 41 };
45 42
46 interface AdapterFactory { 43 interface AdapterFactory {
47 // Gets an Adapter interface. Returns null if Bluetooth is not supported. 44 // Gets an Adapter interface. Returns null if Bluetooth is not supported.
48 GetAdapter() => (Adapter? adapter); 45 GetAdapter() => (Adapter? adapter);
49 }; 46 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698