OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/arc/test/fake_bluetooth_instance.h" | |
6 | |
7 namespace arc { | |
8 | |
9 FakeBluetoothInstance::FakeBluetoothInstance() {} | |
10 FakeBluetoothInstance::~FakeBluetoothInstance() {} | |
11 | |
12 FakeBluetoothInstance::GattDBResult::GattDBResult( | |
13 mojom::BluetoothAddressPtr&& remote_addr, | |
14 mojo::Array<mojom::BluetoothGattDBElementPtr>&& db) | |
15 : remote_addr_(std::move(remote_addr)), db_(std::move(db)) {} | |
16 | |
17 FakeBluetoothInstance::GattDBResult::~GattDBResult() {} | |
18 | |
19 FakeBluetoothInstance::LEDeviceFoundData::LEDeviceFoundData( | |
20 mojom::BluetoothAddressPtr&& addr, | |
21 int32_t rssi, | |
22 mojo::Array<mojom::BluetoothAdvertisingDataPtr>&& adv_data) | |
23 : addr_(std::move(addr)), rssi_(rssi), adv_data_(std::move(adv_data)) {} | |
24 | |
25 FakeBluetoothInstance::LEDeviceFoundData::~LEDeviceFoundData() {} | |
26 | |
27 void FakeBluetoothInstance::Init(mojom::BluetoothHostPtr host_ptr) {} | |
28 | |
29 void FakeBluetoothInstance::OnAdapterProperties( | |
30 mojom::BluetoothStatus status, | |
31 mojo::Array<mojom::BluetoothPropertyPtr> properties) {} | |
32 | |
33 void FakeBluetoothInstance::OnRemoteDeviceProperties( | |
34 mojom::BluetoothStatus status, | |
35 mojom::BluetoothAddressPtr address, | |
36 mojo::Array<mojom::BluetoothPropertyPtr> properties) {} | |
37 | |
38 void FakeBluetoothInstance::OnDeviceFound( | |
rkc
2016/06/19 18:45:43
What does the actual OnDeviceFound method do? This
puthik_chromium
2016/06/22 23:38:54
It's will send the list of known device to Android
| |
39 mojo::Array<mojom::BluetoothPropertyPtr> properties) { | |
40 device_found_data_.emplace_back(std::move(properties)); | |
41 } | |
42 | |
43 void FakeBluetoothInstance::OnDiscoveryStateChanged( | |
44 mojom::BluetoothDiscoveryState state) {} | |
45 | |
46 void FakeBluetoothInstance::OnBondStateChanged( | |
47 mojom::BluetoothStatus status, | |
48 mojom::BluetoothAddressPtr remote_addr, | |
49 mojom::BluetoothBondState state) {} | |
50 | |
51 void FakeBluetoothInstance::OnAclStateChanged( | |
52 mojom::BluetoothStatus status, | |
53 mojom::BluetoothAddressPtr remote_addr, | |
54 mojom::BluetoothAclState state) {} | |
55 | |
56 void FakeBluetoothInstance::OnLEDeviceFound( | |
57 mojom::BluetoothAddressPtr addr, | |
58 int32_t rssi, | |
59 mojo::Array<mojom::BluetoothAdvertisingDataPtr> adv_data) { | |
60 le_device_found_data_.emplace_back( | |
61 new LEDeviceFoundData(std::move(addr), rssi, std::move(adv_data))); | |
62 } | |
63 | |
64 void FakeBluetoothInstance::OnLEConnectionStateChange( | |
65 mojom::BluetoothAddressPtr remote_addr, | |
66 bool connected) {} | |
67 | |
68 void FakeBluetoothInstance::OnSearchComplete( | |
69 mojom::BluetoothAddressPtr remote_addr, | |
70 mojom::BluetoothGattStatus status) {} | |
71 | |
72 void FakeBluetoothInstance::OnGetGattDB( | |
73 mojom::BluetoothAddressPtr remote_addr, | |
74 mojo::Array<mojom::BluetoothGattDBElementPtr> db) { | |
75 gatt_db_result_.emplace_back( | |
76 new GattDBResult(std::move(remote_addr), std::move(db))); | |
77 } | |
78 | |
79 void FakeBluetoothInstance::OnServicesRemoved( | |
80 mojom::BluetoothAddressPtr remote_addr, | |
81 uint16_t start_handle, | |
82 uint16_t end_handle) {} | |
83 | |
84 void FakeBluetoothInstance::OnServicesAdded( | |
85 mojom::BluetoothAddressPtr remote_addr, | |
86 mojo::Array<mojom::BluetoothGattDBElementPtr> db) {} | |
87 | |
88 } // namespace arc | |
OLD | NEW |