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

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

Issue 1872943002: Add support for local services/characteristics/descriptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
ortuno 2016/04/14 17:42:36 It's 2016!
rkc 2016/04/14 19:27:27 ..and, 2016 is the year that comes after 2015.
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_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
7
8 #include <stddef.h>
ortuno 2016/04/14 17:42:36 I don't think you need this one.
rkc 2016/04/14 19:27:27 Done.
9 #include <stdint.h>
10
11 #include <vector>
12
13 #include "base/macros.h"
14 #include "base/memory/weak_ptr.h"
15 #include "dbus/object_path.h"
16 #include "device/bluetooth/bluetooth_gatt_characteristic_bluez.h"
17 #include "device/bluetooth/bluetooth_uuid.h"
18
19 namespace device {
20
21 class BluetoothGattDescriptor;
22 class BluetoothGattService;
23
24 } // namespace device
25
26 namespace bluez {
27
28 class BluetoothLocalGattDescriptorBlueZ;
29 class BluetoothLocalGattServiceBlueZ;
30
31 // The BluetoothLocalGattCharacteristicBlueZ class implements
32 // BluetoothGattCharacteristic for remote GATT characteristics for platforms
ortuno 2016/04/14 17:42:35 Fix description.
rkc 2016/04/14 19:27:28 Done.
33 // that use BlueZ.
34 class BluetoothLocalGattCharacteristicBlueZ
35 : public BluetoothGattCharacteristicBlueZ {
36 public:
37 // device::BluetoothGattCharacteristic overrides.
38 device::BluetoothUUID GetUUID() const override;
39 bool IsLocal() const override;
40 const std::vector<uint8_t>& GetValue() const override;
41 Properties GetProperties() const override;
42 bool IsNotifying() const override;
43 bool AddDescriptor(device::BluetoothGattDescriptor* descriptor) override;
ortuno 2016/04/14 17:42:36 I'm guessing this will be removed base on the desi
rkc 2016/04/14 19:27:28 Yes, it will.
44 bool UpdateValue(const std::vector<uint8_t>& value) override;
45 void StartNotifySession(const NotifySessionCallback& callback,
46 const ErrorCallback& error_callback) override;
47 void ReadRemoteCharacteristic(const ValueCallback& callback,
48 const ErrorCallback& error_callback) override;
49 void WriteRemoteCharacteristic(const std::vector<uint8_t>& new_value,
50 const base::Closure& callback,
51 const ErrorCallback& error_callback) override;
52
53 private:
54 friend class BluetoothLocalGattServiceBlueZ;
55
56 BluetoothLocalGattCharacteristicBlueZ(BluetoothLocalGattServiceBlueZ* service,
57 const dbus::ObjectPath& object_path);
58 ~BluetoothLocalGattCharacteristicBlueZ() override;
59
60 // Note: This should remain the last member so it'll be destroyed and
61 // invalidate its weak pointers before any other members are destroyed.
62 base::WeakPtrFactory<BluetoothLocalGattCharacteristicBlueZ> weak_ptr_factory_;
ortuno 2016/04/14 17:42:36 You don't seem to use this.
rkc 2016/04/14 19:27:28 Done.
63
64 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattCharacteristicBlueZ);
65 };
66
67 } // namespace bluez
68
69 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_CHARACTERISTIC_BLUEZ_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698