| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "device/bluetooth/bluetooth_gatt_connection_mac.h" | 5 #include "device/bluetooth/bluetooth_gatt_connection_mac.h" |
| 6 | 6 |
| 7 namespace device { | 7 namespace device { |
| 8 | 8 |
| 9 BluetoothGattConnectionMac::BluetoothGattConnectionMac( | 9 BluetoothGattConnectionMac::BluetoothGattConnectionMac( |
| 10 scoped_refptr<BluetoothAdapter> adapter, | 10 scoped_refptr<BluetoothAdapter> adapter, |
| 11 std::string device_address) | 11 std::string device_address) |
| 12 : adapter_(adapter), device_address_(device_address) {} | 12 : adapter_(adapter), device_address_(device_address) {} |
| 13 | 13 |
| 14 BluetoothGattConnectionMac::~BluetoothGattConnectionMac() {} | 14 BluetoothGattConnectionMac::~BluetoothGattConnectionMac() {} |
| 15 | 15 |
| 16 // BluetoothGattConenction overrides. | 16 // BluetoothGattConenction overrides. |
| 17 std::string BluetoothGattConnectionMac::GetDeviceAddress() const { | 17 std::string BluetoothGattConnectionMac::GetDeviceAddress() const { |
| 18 return device_address_; | 18 return device_address_; |
| 19 } | 19 } |
| 20 | 20 |
| 21 bool BluetoothGattConnectionMac::IsConnected() { | 21 bool BluetoothGattConnectionMac::IsConnected() { |
| 22 return false; | 22 BluetoothDevice* device = adapter_->GetDevice(device_address_); |
| 23 return device->IsConnected(); |
| 23 } | 24 } |
| 24 | 25 |
| 25 void BluetoothGattConnectionMac::Disconnect(const base::Closure& callback) {} | 26 void BluetoothGattConnectionMac::Disconnect(const base::Closure& callback) { |
| 27 // TODO: decrement counter on device. |
| 28 } |
| 26 | 29 |
| 27 } // namespace device | 30 } // namespace device |
| OLD | NEW |