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