OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 // FakeBluetooth and its related interfaces allow clients to control the global | 7 // FakeBluetooth and its related interfaces allow clients to control the global |
8 // Bluetooth State as well as simulate Bluetooth events including finding new | 8 // Bluetooth State as well as simulate Bluetooth events including finding new |
9 // devices, simulating GATT attributes and its descendants, and simulating | 9 // devices, simulating GATT attributes and its descendants, and simulating |
10 // success and error responses. | 10 // success and error responses. |
11 | 11 |
12 // Indicates the various states of Central. | |
13 enum CentralState { | |
14 ABSENT, | |
15 POWERED_ON, | |
16 POWERED_OFF, | |
17 }; | |
18 | |
12 // FakeBluetooth allows clients to control the global Bluetooth state. | 19 // FakeBluetooth allows clients to control the global Bluetooth state. |
13 interface FakeBluetooth { | 20 interface FakeBluetooth { |
14 // Set it to indicate whether the platform supports BLE. For example, Windows | 21 // Set it to indicate whether the platform supports BLE. For example, Windows |
15 // 7 is a platform that doesn't support Low Energy. On the other hand Windows | 22 // 7 is a platform that doesn't support Low Energy. On the other hand Windows |
16 // 10 is a platform that does support LE, even if there is no Bluetooth radio | 23 // 10 is a platform that does support LE, even if there is no Bluetooth radio |
17 // available. | 24 // available. |
18 SetLESupported(bool available) => (); | 25 SetLESupported(bool available) => (); |
26 | |
27 // Initializes a fake Central with |state| as the initial state. | |
28 SimulateCentral(CentralState state) => (FakeCentral fake_central); | |
19 }; | 29 }; |
30 | |
31 // FakeCentral allows clients to simulate events that a device in the | |
32 // Central/Observer role would receive as well as monitor the operations | |
33 // performed by the device in the Central/Observer role. | |
34 // | |
35 // A Central interface would allow its clients to perform the operations and | |
36 // receive events for two roles defined by the Bluetooth Spec: Observer and | |
37 // Central. See Bluetooth 4.2 Vol 3 Part C 2.2.2 "Roles when Operation over an | |
dcheng
2017/05/04 00:55:04
Operation => Operating?
ortuno
2017/05/04 05:28:24
Done.
| |
38 // LE Physical Transport". | |
39 interface FakeCentral { | |
40 }; | |
OLD | NEW |