Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_mac.h

Issue 2767813002: Bluetooth: macOS: Implementing read/write for descriptors (Closed)
Patch Set: NSString/NSNumber type for descriptor value Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_
7 7
8 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h" 8 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
9 9
10 #include <unordered_map> 10 #include <unordered_map>
11 11
12 #include "base/mac/scoped_nsobject.h" 12 #include "base/mac/scoped_nsobject.h"
13 #include "base/memory/weak_ptr.h" 13 #include "base/memory/weak_ptr.h"
14 14
15 #if defined(__OBJC__) 15 #if defined(__OBJC__)
16 #import <CoreBluetooth/CoreBluetooth.h> 16 #import <CoreBluetooth/CoreBluetooth.h>
17 #else 17 #else
18 @class CBCharacteristic; 18 @class CBCharacteristic;
tapted 2017/04/05 00:38:37 note @class isn't a valid keyword when __OBJC__ is
jlebel 2017/04/06 17:48:49 Done.
19 typedef NS_ENUM(NSInteger, CBCharacteristicWriteType); 19 typedef NS_ENUM(NSInteger, CBCharacteristicWriteType);
20 #endif // defined(__OBJC__) 20 #endif // defined(__OBJC__)
21 21
22 namespace device { 22 namespace device {
23 23
24 class BluetoothAdapterMac; 24 class BluetoothAdapterMac;
25 class BluetoothRemoteGattDescriptorMac; 25 class BluetoothRemoteGattDescriptorMac;
26 class BluetoothRemoteGattServiceMac; 26 class BluetoothRemoteGattServiceMac;
27 27
28 // The BluetoothRemoteGattCharacteristicMac class implements 28 // The BluetoothRemoteGattCharacteristicMac class implements
(...skipping 30 matching lines...) Expand all
59 protected: 59 protected:
60 void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor, 60 void SubscribeToNotifications(BluetoothRemoteGattDescriptor* ccc_descriptor,
61 const base::Closure& callback, 61 const base::Closure& callback,
62 const ErrorCallback& error_callback) override; 62 const ErrorCallback& error_callback) override;
63 void UnsubscribeFromNotifications( 63 void UnsubscribeFromNotifications(
64 BluetoothRemoteGattDescriptor* ccc_descriptor, 64 BluetoothRemoteGattDescriptor* ccc_descriptor,
65 const base::Closure& callback, 65 const base::Closure& callback,
66 const ErrorCallback& error_callback) override; 66 const ErrorCallback& error_callback) override;
67 67
68 private: 68 private:
69 friend class BluetoothLowEnergyDeviceMac;
69 friend class BluetoothRemoteGattDescriptorMac; 70 friend class BluetoothRemoteGattDescriptorMac;
70 friend class BluetoothRemoteGattServiceMac; 71 friend class BluetoothRemoteGattServiceMac;
71 friend class BluetoothTestMac; 72 friend class BluetoothTestMac;
72 73
73 void DiscoverDescriptors(); 74 void DiscoverDescriptors();
74 // Called by the BluetoothRemoteGattServiceMac instance when the 75 // Called by the BluetoothRemoteGattServiceMac instance when the
75 // characteristics value has been read. 76 // characteristics value has been read.
76 void DidUpdateValue(NSError* error); 77 void DidUpdateValue(NSError* error);
77 // Updates value_. 78 // Updates value_.
78 void UpdateValue(); 79 void UpdateValue();
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 }; 137 };
137 138
138 // Stream operator for logging. 139 // Stream operator for logging.
139 DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<( 140 DEVICE_BLUETOOTH_EXPORT std::ostream& operator<<(
140 std::ostream& out, 141 std::ostream& out,
141 const BluetoothRemoteGattCharacteristicMac& characteristic); 142 const BluetoothRemoteGattCharacteristicMac& characteristic);
142 143
143 } // namespace device 144 } // namespace device
144 145
145 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_ 146 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698