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

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

Issue 1950033002: bluetooth: mac: Initial BluetoothRemoteGattCharacteristicMac implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@servicescan_cleanup
Patch Set: Updating the characteristic property conversion Created 4 years, 6 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_
7
8 #include "device/bluetooth/bluetooth_remote_gatt_characteristic.h"
9
10 #include "base/mac/scoped_nsobject.h"
11
12 @class CBCharacteristic;
13
14 namespace device {
15
16 class BluetoothRemoteGattServiceMac;
17
18 // The BluetoothRemoteGattCharacteristicMac class implements
19 // BluetoothRemoteGattCharacteristic for remote GATT services on OS X.
20 class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicMac
21 : public BluetoothRemoteGattCharacteristic {
22 public:
23 BluetoothRemoteGattCharacteristicMac(
24 BluetoothRemoteGattServiceMac* gatt_service,
25 CBCharacteristic* cb_characteristic);
26 ~BluetoothRemoteGattCharacteristicMac() override;
27
28 // Override BluetoothGattCharacteristic methods.
29 std::string GetIdentifier() const override;
30 BluetoothUUID GetUUID() const override;
31 Properties GetProperties() const override;
32 Permissions GetPermissions() const override;
33
34 // Override BluetoothRemoteGattCharacteristic methods.
35 const std::vector<uint8_t>& GetValue() const override;
36 BluetoothRemoteGattService* GetService() const override;
37 bool IsNotifying() const override;
38 std::vector<BluetoothRemoteGattDescriptor*> GetDescriptors() const override;
39 BluetoothRemoteGattDescriptor* GetDescriptor(
40 const std::string& identifier) const override;
41 void StartNotifySession(const NotifySessionCallback& callback,
42 const ErrorCallback& error_callback) override;
43 void ReadRemoteCharacteristic(const ValueCallback& callback,
44 const ErrorCallback& error_callback) override;
45 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value,
46 const base::Closure& callback,
47 const ErrorCallback& error_callback) override;
48
49 DISALLOW_COPY_AND_ASSIGN(BluetoothRemoteGattCharacteristicMac);
50
51 private:
52 // gatt_service_ owns instances of this class.
53 BluetoothRemoteGattServiceMac* gatt_service_;
54 // A characteristic from CBPeripheral.services.characteristics.
55 base::scoped_nsobject<CBCharacteristic> cb_characteristic_;
56 // Characteristic identifier.
57 std::string identifier_;
58 // Service UUID.
59 BluetoothUUID uuid_;
60 };
61
62 } // namespace device
63
64 #endif // DEVICE_BLUETOOTH_BLUETOOTH_REMOTE_GATT_CHARACTERISTIC_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698