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 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 return; | 952 return; |
953 | 953 |
954 PropertiesMap::const_iterator iter = properties_map_.find(device_path); | 954 PropertiesMap::const_iterator iter = properties_map_.find(device_path); |
955 Properties* properties = iter->second; | 955 Properties* properties = iter->second; |
956 | 956 |
957 VLOG(1) << "removing device: " << properties->alias.value(); | 957 VLOG(1) << "removing device: " << properties->alias.value(); |
958 device_list_.erase(listiter); | 958 device_list_.erase(listiter); |
959 | 959 |
960 // Remove the Input interface if it exists. This should be called before the | 960 // Remove the Input interface if it exists. This should be called before the |
961 // BluetoothDeviceClient::Observer::DeviceRemoved because it deletes the | 961 // BluetoothDeviceClient::Observer::DeviceRemoved because it deletes the |
962 // BluetoothDeviceChromeOS object, including the device_path referenced here. | 962 // BluetoothDeviceBlueZ object, including the device_path referenced here. |
963 FakeBluetoothInputClient* fake_bluetooth_input_client = | 963 FakeBluetoothInputClient* fake_bluetooth_input_client = |
964 static_cast<FakeBluetoothInputClient*>( | 964 static_cast<FakeBluetoothInputClient*>( |
965 bluez::BluezDBusManager::Get()->GetBluetoothInputClient()); | 965 bluez::BluezDBusManager::Get()->GetBluetoothInputClient()); |
966 fake_bluetooth_input_client->RemoveInputDevice(device_path); | 966 fake_bluetooth_input_client->RemoveInputDevice(device_path); |
967 | 967 |
968 if (device_path == dbus::ObjectPath(kLowEnergyPath)) { | 968 if (device_path == dbus::ObjectPath(kLowEnergyPath)) { |
969 FakeBluetoothGattServiceClient* gatt_service_client = | 969 FakeBluetoothGattServiceClient* gatt_service_client = |
970 static_cast<FakeBluetoothGattServiceClient*>( | 970 static_cast<FakeBluetoothGattServiceClient*>( |
971 bluez::BluezDBusManager::Get()->GetBluetoothGattServiceClient()); | 971 bluez::BluezDBusManager::Get()->GetBluetoothGattServiceClient()); |
972 gatt_service_client->HideHeartRateService(); | 972 gatt_service_client->HideHeartRateService(); |
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1610 // TODO(keybuk): tear down this side of the connection | 1610 // TODO(keybuk): tear down this side of the connection |
1611 callback.Run(); | 1611 callback.Run(); |
1612 } else if (status == BluetoothProfileServiceProvider::Delegate::CANCELLED) { | 1612 } else if (status == BluetoothProfileServiceProvider::Delegate::CANCELLED) { |
1613 error_callback.Run(bluetooth_device::kErrorFailed, "Canceled"); | 1613 error_callback.Run(bluetooth_device::kErrorFailed, "Canceled"); |
1614 } else if (status == BluetoothProfileServiceProvider::Delegate::REJECTED) { | 1614 } else if (status == BluetoothProfileServiceProvider::Delegate::REJECTED) { |
1615 error_callback.Run(bluetooth_device::kErrorFailed, "Rejected"); | 1615 error_callback.Run(bluetooth_device::kErrorFailed, "Rejected"); |
1616 } | 1616 } |
1617 } | 1617 } |
1618 | 1618 |
1619 } // namespace bluez | 1619 } // namespace bluez |
OLD | NEW |