OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_notify_session_bluez.h" | 5 #include "device/bluetooth/bluez/bluetooth_gatt_notify_session_bluez.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "device/bluetooth/bluetooth_adapter.h" | 9 #include "device/bluetooth/bluetooth_adapter.h" |
10 #include "device/bluetooth/bluetooth_device.h" | 10 #include "device/bluetooth/bluetooth_device.h" |
11 #include "device/bluetooth/bluetooth_gatt_service.h" | 11 #include "device/bluetooth/bluetooth_remote_gatt_service.h" |
12 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_bluez.h" | 12 #include "device/bluetooth/bluez/bluetooth_remote_gatt_characteristic_bluez.h" |
13 #include "device/bluetooth/dbus/bluez_dbus_manager.h" | 13 #include "device/bluetooth/dbus/bluez_dbus_manager.h" |
14 | 14 |
15 namespace bluez { | 15 namespace bluez { |
16 | 16 |
17 BluetoothGattNotifySessionBlueZ::BluetoothGattNotifySessionBlueZ( | 17 BluetoothGattNotifySessionBlueZ::BluetoothGattNotifySessionBlueZ( |
18 scoped_refptr<device::BluetoothAdapter> adapter, | 18 scoped_refptr<device::BluetoothAdapter> adapter, |
19 const std::string& device_address, | 19 const std::string& device_address, |
20 const std::string& service_identifier, | 20 const std::string& service_identifier, |
21 const std::string& characteristic_identifier, | 21 const std::string& characteristic_identifier, |
22 const dbus::ObjectPath& characteristic_path) | 22 const dbus::ObjectPath& characteristic_path) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 return; | 80 return; |
81 } | 81 } |
82 | 82 |
83 // Mark this session as inactive no matter what. | 83 // Mark this session as inactive no matter what. |
84 active_ = false; | 84 active_ = false; |
85 | 85 |
86 device::BluetoothDevice* device = adapter_->GetDevice(device_address_); | 86 device::BluetoothDevice* device = adapter_->GetDevice(device_address_); |
87 if (!device) | 87 if (!device) |
88 return; | 88 return; |
89 | 89 |
90 device::BluetoothGattService* service = device->GetGattService(service_id_); | 90 device::BluetoothRemoteGattService* service = |
| 91 device->GetGattService(service_id_); |
91 if (!service) | 92 if (!service) |
92 return; | 93 return; |
93 | 94 |
94 BluetoothRemoteGattCharacteristicBlueZ* chrc = | 95 BluetoothRemoteGattCharacteristicBlueZ* chrc = |
95 static_cast<BluetoothRemoteGattCharacteristicBlueZ*>( | 96 static_cast<BluetoothRemoteGattCharacteristicBlueZ*>( |
96 service->GetCharacteristic(characteristic_id_)); | 97 service->GetCharacteristic(characteristic_id_)); |
97 if (!chrc) | 98 if (!chrc) |
98 return; | 99 return; |
99 | 100 |
100 chrc->RemoveNotifySession(callback); | 101 chrc->RemoveNotifySession(callback); |
(...skipping 24 matching lines...) Expand all Loading... |
125 active_ = false; | 126 active_ = false; |
126 return; | 127 return; |
127 } | 128 } |
128 | 129 |
129 if (property_name == properties->notifying.name() && | 130 if (property_name == properties->notifying.name() && |
130 !properties->notifying.value()) | 131 !properties->notifying.value()) |
131 active_ = false; | 132 active_ = false; |
132 } | 133 } |
133 | 134 |
134 } // namespace bluez | 135 } // namespace bluez |
OLD | NEW |