| OLD | NEW |
| 1 // Copyright 2016 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_remote_gatt_service_mac.h" | 5 #include "device/bluetooth/bluetooth_remote_gatt_service_mac.h" |
| 6 | 6 |
| 7 #import <CoreBluetooth/CoreBluetooth.h> | 7 #import <CoreBluetooth/CoreBluetooth.h> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 CBService* service, | 22 CBService* service, |
| 23 bool is_primary) | 23 bool is_primary) |
| 24 : bluetooth_device_mac_(bluetooth_device_mac), | 24 : bluetooth_device_mac_(bluetooth_device_mac), |
| 25 service_(service, base::scoped_policy::RETAIN), | 25 service_(service, base::scoped_policy::RETAIN), |
| 26 is_primary_(is_primary), | 26 is_primary_(is_primary), |
| 27 is_discovery_complete_(false), | 27 is_discovery_complete_(false), |
| 28 discovery_pending_count_(0) { | 28 discovery_pending_count_(0) { |
| 29 uuid_ = BluetoothAdapterMac::BluetoothUUIDWithCBUUID([service_.get() UUID]); | 29 uuid_ = BluetoothAdapterMac::BluetoothUUIDWithCBUUID([service_.get() UUID]); |
| 30 identifier_ = base::SysNSStringToUTF8( | 30 identifier_ = base::SysNSStringToUTF8( |
| 31 [NSString stringWithFormat:@"%s-%p", uuid_.canonical_value().c_str(), | 31 [NSString stringWithFormat:@"%s-%p", uuid_.canonical_value().c_str(), |
| 32 (void*)service_]); | 32 service_.get()]); |
| 33 } | 33 } |
| 34 | 34 |
| 35 BluetoothRemoteGattServiceMac::~BluetoothRemoteGattServiceMac() {} | 35 BluetoothRemoteGattServiceMac::~BluetoothRemoteGattServiceMac() {} |
| 36 | 36 |
| 37 std::string BluetoothRemoteGattServiceMac::GetIdentifier() const { | 37 std::string BluetoothRemoteGattServiceMac::GetIdentifier() const { |
| 38 return identifier_; | 38 return identifier_; |
| 39 } | 39 } |
| 40 | 40 |
| 41 BluetoothUUID BluetoothRemoteGattServiceMac::GetUUID() const { | 41 BluetoothUUID BluetoothRemoteGattServiceMac::GetUUID() const { |
| 42 return uuid_; | 42 return uuid_; |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 const BluetoothRemoteGattServiceMac& service) { | 240 const BluetoothRemoteGattServiceMac& service) { |
| 241 const BluetoothLowEnergyDeviceMac* bluetooth_device_mac_ = | 241 const BluetoothLowEnergyDeviceMac* bluetooth_device_mac_ = |
| 242 static_cast<const BluetoothLowEnergyDeviceMac*>(service.GetDevice()); | 242 static_cast<const BluetoothLowEnergyDeviceMac*>(service.GetDevice()); |
| 243 return out << "<BluetoothRemoteGattServiceMac " | 243 return out << "<BluetoothRemoteGattServiceMac " |
| 244 << service.GetUUID().canonical_value() << "/" << &service | 244 << service.GetUUID().canonical_value() << "/" << &service |
| 245 << ", device: " << bluetooth_device_mac_->GetAddress() << "/" | 245 << ", device: " << bluetooth_device_mac_->GetAddress() << "/" |
| 246 << bluetooth_device_mac_ << ">"; | 246 << bluetooth_device_mac_ << ">"; |
| 247 } | 247 } |
| 248 | 248 |
| 249 } // namespace device | 249 } // namespace device |
| OLD | NEW |