| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 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_remote_gatt_descriptor_mac.h" | 5 #include "device/bluetooth/bluetooth_remote_gatt_descriptor_mac.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #import "base/mac/foundation_util.h" | 8 #import "base/mac/foundation_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 BluetoothRemoteGattDescriptorMac::BluetoothRemoteGattDescriptorMac( | 45 BluetoothRemoteGattDescriptorMac::BluetoothRemoteGattDescriptorMac( |
| 46 BluetoothRemoteGattCharacteristicMac* characteristic, | 46 BluetoothRemoteGattCharacteristicMac* characteristic, |
| 47 CBDescriptor* descriptor) | 47 CBDescriptor* descriptor) |
| 48 : gatt_characteristic_(characteristic), | 48 : gatt_characteristic_(characteristic), |
| 49 cb_descriptor_(descriptor, base::scoped_policy::RETAIN), | 49 cb_descriptor_(descriptor, base::scoped_policy::RETAIN), |
| 50 value_read_or_write_in_progress_(false) { | 50 value_read_or_write_in_progress_(false) { |
| 51 uuid_ = BluetoothAdapterMac::BluetoothUUIDWithCBUUID([cb_descriptor_ UUID]); | 51 uuid_ = BluetoothAdapterMac::BluetoothUUIDWithCBUUID([cb_descriptor_ UUID]); |
| 52 identifier_ = base::SysNSStringToUTF8( | 52 identifier_ = base::SysNSStringToUTF8( |
| 53 [NSString stringWithFormat:@"%s-%p", uuid_.canonical_value().c_str(), | 53 [NSString stringWithFormat:@"%s-%p", uuid_.canonical_value().c_str(), |
| 54 (void*)cb_descriptor_]); | 54 cb_descriptor_.get()]); |
| 55 } | 55 } |
| 56 | 56 |
| 57 std::string BluetoothRemoteGattDescriptorMac::GetIdentifier() const { | 57 std::string BluetoothRemoteGattDescriptorMac::GetIdentifier() const { |
| 58 return identifier_; | 58 return identifier_; |
| 59 } | 59 } |
| 60 | 60 |
| 61 BluetoothUUID BluetoothRemoteGattDescriptorMac::GetUUID() const { | 61 BluetoothUUID BluetoothRemoteGattDescriptorMac::GetUUID() const { |
| 62 return uuid_; | 62 return uuid_; |
| 63 } | 63 } |
| 64 | 64 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 static_cast<const BluetoothRemoteGattCharacteristicMac*>( | 190 static_cast<const BluetoothRemoteGattCharacteristicMac*>( |
| 191 descriptor.GetCharacteristic()); | 191 descriptor.GetCharacteristic()); |
| 192 return out << "<BluetoothRemoteGattDescriptorMac " | 192 return out << "<BluetoothRemoteGattDescriptorMac " |
| 193 << descriptor.GetUUID().canonical_value() << "/" << &descriptor | 193 << descriptor.GetUUID().canonical_value() << "/" << &descriptor |
| 194 << ", characteristic: " | 194 << ", characteristic: " |
| 195 << characteristic_mac->GetUUID().canonical_value() << "/" | 195 << characteristic_mac->GetUUID().canonical_value() << "/" |
| 196 << characteristic_mac << ">"; | 196 << characteristic_mac << ">"; |
| 197 } | 197 } |
| 198 | 198 |
| 199 } // namespace device. | 199 } // namespace device. |
| OLD | NEW |