OLD | NEW |
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 "device/bluetooth/public/interfaces/device.mojom"; | 7 import "device/bluetooth/public/interfaces/device.mojom"; |
8 | 8 |
9 struct AdapterInfo { | 9 struct AdapterInfo { |
10 string address; | 10 string address; |
(...skipping 20 matching lines...) Expand all Loading... |
31 // Sets the client that listens for the adapter's events. | 31 // Sets the client that listens for the adapter's events. |
32 SetClient(AdapterClient client); | 32 SetClient(AdapterClient client); |
33 }; | 33 }; |
34 | 34 |
35 interface AdapterClient { | 35 interface AdapterClient { |
36 // Called the first time a device is discovered. | 36 // Called the first time a device is discovered. |
37 DeviceAdded(DeviceInfo device); | 37 DeviceAdded(DeviceInfo device); |
38 | 38 |
39 // Called after the device hasn't been seen for 3 minutes. | 39 // Called after the device hasn't been seen for 3 minutes. |
40 DeviceRemoved(DeviceInfo device); | 40 DeviceRemoved(DeviceInfo device); |
| 41 |
| 42 // Called when one of the following properties of a device changes: |
| 43 // Address, appearance, Bluetooth class, Inquiry RSSI, Inquiry TX Power, |
| 44 // Service UUIDs, Connectionable state, Connection state, Pairing state, |
| 45 // Trustable state. |
| 46 // Generally called for each advertisement packet recevied, but this is not |
| 47 // guaranteed on ChromeOS or Linux. Because the RSSI is always changing, |
| 48 // it's very likely this will be called for each advertising packet. |
| 49 DeviceChanged(DeviceInfo device); |
41 }; | 50 }; |
42 | 51 |
43 interface AdapterFactory { | 52 interface AdapterFactory { |
44 // Gets an Adapter interface. Returns null if Bluetooth is not supported. | 53 // Gets an Adapter interface. Returns null if Bluetooth is not supported. |
45 GetAdapter() => (Adapter? adapter); | 54 GetAdapter() => (Adapter? adapter); |
46 }; | 55 }; |
OLD | NEW |