OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/dbus/fake_bluetooth_device_client.h" | 5 #include "device/bluetooth/dbus/fake_bluetooth_device_client.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <sys/socket.h> | 8 #include <sys/socket.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
993 return; | 993 return; |
994 | 994 |
995 PropertiesMap::const_iterator iter = properties_map_.find(device_path); | 995 PropertiesMap::const_iterator iter = properties_map_.find(device_path); |
996 Properties* properties = iter->second; | 996 Properties* properties = iter->second; |
997 | 997 |
998 VLOG(1) << "removing device: " << properties->alias.value(); | 998 VLOG(1) << "removing device: " << properties->alias.value(); |
999 device_list_.erase(listiter); | 999 device_list_.erase(listiter); |
1000 | 1000 |
1001 // Remove the Input interface if it exists. This should be called before the | 1001 // Remove the Input interface if it exists. This should be called before the |
1002 // BluetoothDeviceClient::Observer::DeviceRemoved because it deletes the | 1002 // BluetoothDeviceClient::Observer::DeviceRemoved because it deletes the |
1003 // BluetoothDeviceChromeOS object, including the device_path referenced here. | 1003 // BluetoothDeviceBlueZ object, including the device_path referenced here. |
1004 FakeBluetoothInputClient* fake_bluetooth_input_client = | 1004 FakeBluetoothInputClient* fake_bluetooth_input_client = |
1005 static_cast<FakeBluetoothInputClient*>( | 1005 static_cast<FakeBluetoothInputClient*>( |
1006 bluez::BluezDBusManager::Get()->GetBluetoothInputClient()); | 1006 bluez::BluezDBusManager::Get()->GetBluetoothInputClient()); |
1007 fake_bluetooth_input_client->RemoveInputDevice(device_path); | 1007 fake_bluetooth_input_client->RemoveInputDevice(device_path); |
1008 | 1008 |
1009 if (device_path == dbus::ObjectPath(kLowEnergyPath)) { | 1009 if (device_path == dbus::ObjectPath(kLowEnergyPath)) { |
1010 FakeBluetoothGattServiceClient* gatt_service_client = | 1010 FakeBluetoothGattServiceClient* gatt_service_client = |
1011 static_cast<FakeBluetoothGattServiceClient*>( | 1011 static_cast<FakeBluetoothGattServiceClient*>( |
1012 bluez::BluezDBusManager::Get()->GetBluetoothGattServiceClient()); | 1012 bluez::BluezDBusManager::Get()->GetBluetoothGattServiceClient()); |
1013 gatt_service_client->HideHeartRateService(); | 1013 gatt_service_client->HideHeartRateService(); |
(...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 // TODO(keybuk): tear down this side of the connection | 1653 // TODO(keybuk): tear down this side of the connection |
1654 callback.Run(); | 1654 callback.Run(); |
1655 } else if (status == BluetoothProfileServiceProvider::Delegate::CANCELLED) { | 1655 } else if (status == BluetoothProfileServiceProvider::Delegate::CANCELLED) { |
1656 error_callback.Run(bluetooth_device::kErrorFailed, "Canceled"); | 1656 error_callback.Run(bluetooth_device::kErrorFailed, "Canceled"); |
1657 } else if (status == BluetoothProfileServiceProvider::Delegate::REJECTED) { | 1657 } else if (status == BluetoothProfileServiceProvider::Delegate::REJECTED) { |
1658 error_callback.Run(bluetooth_device::kErrorFailed, "Rejected"); | 1658 error_callback.Run(bluetooth_device::kErrorFailed, "Rejected"); |
1659 } | 1659 } |
1660 } | 1660 } |
1661 | 1661 |
1662 } // namespace bluez | 1662 } // namespace bluez |
OLD | NEW |