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 #include <utility> |
| 8 |
| 9 namespace arc { |
| 10 |
| 11 FakeBluetoothInstance::FakeBluetoothInstance() = default; |
| 12 FakeBluetoothInstance::~FakeBluetoothInstance() = default; |
| 13 |
| 14 FakeBluetoothInstance::GattDBResult::GattDBResult( |
| 15 mojom::BluetoothAddressPtr&& remote_addr, |
| 16 mojo::Array<mojom::BluetoothGattDBElementPtr>&& db) |
| 17 : remote_addr_(std::move(remote_addr)), db_(std::move(db)) {} |
| 18 |
| 19 FakeBluetoothInstance::GattDBResult::~GattDBResult() {} |
| 20 |
| 21 FakeBluetoothInstance::LEDeviceFoundData::LEDeviceFoundData( |
| 22 mojom::BluetoothAddressPtr&& addr, |
| 23 int32_t rssi, |
| 24 mojo::Array<mojom::BluetoothAdvertisingDataPtr>&& adv_data) |
| 25 : addr_(std::move(addr)), rssi_(rssi), adv_data_(std::move(adv_data)) {} |
| 26 |
| 27 FakeBluetoothInstance::LEDeviceFoundData::~LEDeviceFoundData() {} |
| 28 |
| 29 void FakeBluetoothInstance::Init(mojom::BluetoothHostPtr host_ptr) {} |
| 30 |
| 31 void FakeBluetoothInstance::OnAdapterProperties( |
| 32 mojom::BluetoothStatus status, |
| 33 mojo::Array<mojom::BluetoothPropertyPtr> properties) {} |
| 34 |
| 35 void FakeBluetoothInstance::OnRemoteDeviceProperties( |
| 36 mojom::BluetoothStatus status, |
| 37 mojom::BluetoothAddressPtr address, |
| 38 mojo::Array<mojom::BluetoothPropertyPtr> properties) {} |
| 39 |
| 40 void FakeBluetoothInstance::OnDeviceFound( |
| 41 mojo::Array<mojom::BluetoothPropertyPtr> properties) { |
| 42 device_found_data_.push_back(std::move(properties)); |
| 43 } |
| 44 |
| 45 void FakeBluetoothInstance::OnDiscoveryStateChanged( |
| 46 mojom::BluetoothDiscoveryState state) {} |
| 47 |
| 48 void FakeBluetoothInstance::OnBondStateChanged( |
| 49 mojom::BluetoothStatus status, |
| 50 mojom::BluetoothAddressPtr remote_addr, |
| 51 mojom::BluetoothBondState state) {} |
| 52 |
| 53 void FakeBluetoothInstance::OnAclStateChanged( |
| 54 mojom::BluetoothStatus status, |
| 55 mojom::BluetoothAddressPtr remote_addr, |
| 56 mojom::BluetoothAclState state) {} |
| 57 |
| 58 void FakeBluetoothInstance::OnLEDeviceFound( |
| 59 mojom::BluetoothAddressPtr addr, |
| 60 int32_t rssi, |
| 61 mojo::Array<mojom::BluetoothAdvertisingDataPtr> adv_data) { |
| 62 le_device_found_data_.push_back( |
| 63 new LEDeviceFoundData(std::move(addr), rssi, std::move(adv_data))); |
| 64 } |
| 65 |
| 66 void FakeBluetoothInstance::OnLEConnectionStateChange( |
| 67 mojom::BluetoothAddressPtr remote_addr, |
| 68 bool connected) {} |
| 69 |
| 70 void FakeBluetoothInstance::OnSearchComplete( |
| 71 mojom::BluetoothAddressPtr remote_addr, |
| 72 mojom::BluetoothGattStatus status) {} |
| 73 |
| 74 void FakeBluetoothInstance::OnGetGattDB( |
| 75 mojom::BluetoothAddressPtr remote_addr, |
| 76 mojo::Array<mojom::BluetoothGattDBElementPtr> db) { |
| 77 gatt_db_result_.push_back( |
| 78 new GattDBResult(std::move(remote_addr), std::move(db))); |
| 79 } |
| 80 |
| 81 void FakeBluetoothInstance::OnServicesRemoved( |
| 82 mojom::BluetoothAddressPtr remote_addr, |
| 83 uint16_t start_handle, |
| 84 uint16_t end_handle) {} |
| 85 |
| 86 void FakeBluetoothInstance::OnServicesAdded( |
| 87 mojom::BluetoothAddressPtr remote_addr, |
| 88 mojo::Array<mojom::BluetoothGattDBElementPtr> db) {} |
| 89 |
| 90 void FakeBluetoothInstance::OnGattNotify( |
| 91 mojom::BluetoothAddressPtr remote_addr, |
| 92 mojom::BluetoothGattServiceIDPtr service_id, |
| 93 mojom::BluetoothGattIDPtr char_id, |
| 94 bool is_notify, |
| 95 mojo::Array<uint8_t> value) {} |
| 96 |
| 97 void FakeBluetoothInstance::RequestGattRead( |
| 98 mojom::BluetoothAddressPtr address, |
| 99 int32_t attribute_handle, |
| 100 int32_t offset, |
| 101 bool is_long, |
| 102 const RequestGattReadCallback& callback) {} |
| 103 |
| 104 void FakeBluetoothInstance::RequestGattWrite( |
| 105 mojom::BluetoothAddressPtr address, |
| 106 int32_t attribute_handle, |
| 107 int32_t offset, |
| 108 mojo::Array<uint8_t> value, |
| 109 const RequestGattWriteCallback& callback) {} |
| 110 |
| 111 } // namespace arc |
OLD | NEW |