OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_low_energy_device_mac.h" | 5 #include "device/bluetooth/bluetooth_low_energy_device_mac.h" |
6 | 6 |
7 #import <CoreFoundation/CoreFoundation.h> | 7 #import <CoreFoundation/CoreFoundation.h> |
8 | 8 |
9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 advertised_uuids_.push_back( | 67 advertised_uuids_.push_back( |
68 BluetoothUUID(std::string([[uuid UUIDString] UTF8String]))); | 68 BluetoothUUID(std::string([[uuid UUIDString] UTF8String]))); |
69 } | 69 } |
70 } | 70 } |
71 | 71 |
72 std::string BluetoothLowEnergyDeviceMac::GetIdentifier() const { | 72 std::string BluetoothLowEnergyDeviceMac::GetIdentifier() const { |
73 return identifier_; | 73 return identifier_; |
74 } | 74 } |
75 | 75 |
76 uint32 BluetoothLowEnergyDeviceMac::GetBluetoothClass() const { | 76 uint32 BluetoothLowEnergyDeviceMac::GetBluetoothClass() const { |
77 return 0; | 77 return 0x1F00; // Unspecified Device Class |
78 } | 78 } |
79 | 79 |
80 std::string BluetoothLowEnergyDeviceMac::GetAddress() const { | 80 std::string BluetoothLowEnergyDeviceMac::GetAddress() const { |
81 return hash_address_; | 81 return hash_address_; |
82 } | 82 } |
83 | 83 |
84 BluetoothDevice::VendorIDSource BluetoothLowEnergyDeviceMac::GetVendorIDSource() | 84 BluetoothDevice::VendorIDSource BluetoothLowEnergyDeviceMac::GetVendorIDSource() |
85 const { | 85 const { |
86 return VENDOR_ID_UNKNOWN; | 86 return VENDOR_ID_UNKNOWN; |
87 } | 87 } |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 instanceMethodSignatureForSelector:@selector(state)] retain]); | 239 instanceMethodSignatureForSelector:@selector(state)] retain]); |
240 base::scoped_nsobject<NSInvocation> invocation( | 240 base::scoped_nsobject<NSInvocation> invocation( |
241 [[NSInvocation invocationWithMethodSignature:signature] retain]); | 241 [[NSInvocation invocationWithMethodSignature:signature] retain]); |
242 [invocation setTarget:peripheral_]; | 242 [invocation setTarget:peripheral_]; |
243 [invocation setSelector:@selector(state)]; | 243 [invocation setSelector:@selector(state)]; |
244 [invocation invoke]; | 244 [invocation invoke]; |
245 CBPeripheralState state = CBPeripheralStateDisconnected; | 245 CBPeripheralState state = CBPeripheralStateDisconnected; |
246 [invocation getReturnValue:&state]; | 246 [invocation getReturnValue:&state]; |
247 return state; | 247 return state; |
248 } | 248 } |
OLD | NEW |