OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "device/bluetooth/test/fake_peripheral.h" |
| 6 |
| 7 namespace bluetooth { |
| 8 |
| 9 FakePeripheral::FakePeripheral(FakeCentral* fake_central, |
| 10 const std::string& address, |
| 11 const std::string& name) |
| 12 : device::BluetoothDevice(fake_central), |
| 13 address_(address), |
| 14 id_(address), |
| 15 name_(name), |
| 16 gatt_connected_(false) {} |
| 17 |
| 18 FakePeripheral::~FakePeripheral() {} |
| 19 |
| 20 void FakePeripheral::SetGattConnected(bool connected) { |
| 21 gatt_connected_ = connected; |
| 22 } |
| 23 |
| 24 uint32_t FakePeripheral::GetBluetoothClass() const { |
| 25 NOTREACHED(); |
| 26 return 0; |
| 27 } |
| 28 |
| 29 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 30 device::BluetoothTransport FakePeripheral::GetType() const { |
| 31 NOTREACHED(); |
| 32 return device::BLUETOOTH_TRANSPORT_INVALID; |
| 33 } |
| 34 #endif |
| 35 |
| 36 std::string FakePeripheral::GetIdentifier() const { |
| 37 return id_; |
| 38 } |
| 39 |
| 40 std::string FakePeripheral::GetAddress() const { |
| 41 return address_; |
| 42 } |
| 43 |
| 44 device::BluetoothDevice::VendorIDSource FakePeripheral::GetVendorIDSource() |
| 45 const { |
| 46 NOTREACHED(); |
| 47 return VENDOR_ID_UNKNOWN; |
| 48 } |
| 49 |
| 50 uint16_t FakePeripheral::GetVendorID() const { |
| 51 NOTREACHED(); |
| 52 return 0; |
| 53 } |
| 54 |
| 55 uint16_t FakePeripheral::GetProductID() const { |
| 56 NOTREACHED(); |
| 57 return 0; |
| 58 } |
| 59 |
| 60 uint16_t FakePeripheral::GetDeviceID() const { |
| 61 NOTREACHED(); |
| 62 return 0; |
| 63 } |
| 64 |
| 65 uint16_t FakePeripheral::GetAppearance() const { |
| 66 NOTREACHED(); |
| 67 return 0; |
| 68 } |
| 69 |
| 70 base::Optional<std::string> FakePeripheral::GetName() const { |
| 71 return name_; |
| 72 } |
| 73 |
| 74 base::string16 FakePeripheral::GetNameForDisplay() const { |
| 75 return base::string16(); |
| 76 } |
| 77 |
| 78 bool FakePeripheral::IsPaired() const { |
| 79 NOTREACHED(); |
| 80 return false; |
| 81 } |
| 82 |
| 83 bool FakePeripheral::IsConnected() const { |
| 84 NOTREACHED(); |
| 85 return false; |
| 86 } |
| 87 |
| 88 bool FakePeripheral::IsGattConnected() const { |
| 89 return gatt_connected_; |
| 90 } |
| 91 |
| 92 bool FakePeripheral::IsConnectable() const { |
| 93 NOTREACHED(); |
| 94 return false; |
| 95 } |
| 96 |
| 97 bool FakePeripheral::IsConnecting() const { |
| 98 NOTREACHED(); |
| 99 return false; |
| 100 } |
| 101 |
| 102 device::BluetoothDevice::UUIDSet FakePeripheral::GetUUIDs() const { |
| 103 return UUIDSet(); |
| 104 } |
| 105 |
| 106 bool FakePeripheral::ExpectingPinCode() const { |
| 107 NOTREACHED(); |
| 108 return false; |
| 109 } |
| 110 |
| 111 bool FakePeripheral::ExpectingPasskey() const { |
| 112 NOTREACHED(); |
| 113 return false; |
| 114 } |
| 115 |
| 116 bool FakePeripheral::ExpectingConfirmation() const { |
| 117 NOTREACHED(); |
| 118 return false; |
| 119 } |
| 120 |
| 121 void FakePeripheral::GetConnectionInfo(const ConnectionInfoCallback& callback) { |
| 122 NOTREACHED(); |
| 123 } |
| 124 |
| 125 void FakePeripheral::Connect(PairingDelegate* pairing_delegate, |
| 126 const base::Closure& callback, |
| 127 const ConnectErrorCallback& error_callback) { |
| 128 NOTREACHED(); |
| 129 } |
| 130 |
| 131 void FakePeripheral::SetPinCode(const std::string& pincode) { |
| 132 NOTREACHED(); |
| 133 } |
| 134 |
| 135 void FakePeripheral::SetPasskey(uint32_t passkey) { |
| 136 NOTREACHED(); |
| 137 } |
| 138 |
| 139 void FakePeripheral::ConfirmPairing() { |
| 140 NOTREACHED(); |
| 141 } |
| 142 |
| 143 void FakePeripheral::RejectPairing() { |
| 144 NOTREACHED(); |
| 145 } |
| 146 |
| 147 void FakePeripheral::CancelPairing() { |
| 148 NOTREACHED(); |
| 149 } |
| 150 |
| 151 void FakePeripheral::Disconnect(const base::Closure& callback, |
| 152 const ErrorCallback& error_callback) { |
| 153 NOTREACHED(); |
| 154 } |
| 155 |
| 156 void FakePeripheral::Forget(const base::Closure& callback, |
| 157 const ErrorCallback& error_callback) { |
| 158 NOTREACHED(); |
| 159 } |
| 160 |
| 161 void FakePeripheral::ConnectToService( |
| 162 const device::BluetoothUUID& uuid, |
| 163 const ConnectToServiceCallback& callback, |
| 164 const ConnectToServiceErrorCallback& error_callback) { |
| 165 NOTREACHED(); |
| 166 } |
| 167 |
| 168 void FakePeripheral::ConnectToServiceInsecurely( |
| 169 const device::BluetoothUUID& uuid, |
| 170 const ConnectToServiceCallback& callback, |
| 171 const ConnectToServiceErrorCallback& error_callback) { |
| 172 NOTREACHED(); |
| 173 } |
| 174 |
| 175 void FakePeripheral::CreateGattConnectionImpl() { |
| 176 NOTREACHED(); |
| 177 } |
| 178 |
| 179 void FakePeripheral::DisconnectGatt() { |
| 180 NOTREACHED(); |
| 181 } |
| 182 } // namespace bluetooth |
OLD | NEW |