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

Side by Side Diff: device/bluetooth/bluetooth_local_gatt_service_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:28 ..and next year it will be 2017!
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_SERVICE_BLUEZ_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_SERVICE_BLUEZ_H_
7
8 #include <stdint.h>
ortuno 2016/04/14 17:42:36 I don't see any ints.
rkc 2016/04/14 19:27:28 Done.
9
10 #include <string>
11
12 #include "base/macros.h"
13 #include "base/memory/weak_ptr.h"
14 #include "dbus/object_path.h"
15 #include "device/bluetooth/bluetooth_gatt_service_bluez.h"
16 #include "device/bluetooth/bluetooth_uuid.h"
17
18 namespace device {
19
20 class BluetoothAdapter;
21 class BluetoothGattCharacteristic;
22
23 } // namespace device
24
25 namespace bluez {
26
27 class BluetoothAdapterBlueZ;
28 class BluetoothDeviceBlueZ;
29 class BluetoothLocalGattCharacteristicBlueZ;
ortuno 2016/04/14 17:42:36 I don't think you are using this anywhere?
rkc 2016/04/14 19:27:28 Done.
30 class BluetoothLocalGattDescriptorBlueZ;
ortuno 2016/04/14 17:42:36 Same here.
rkc 2016/04/14 19:27:28 Done.
31
32 // The BluetoothLocalGattServiceBlueZ class implements BluetootGattService
33 // for local GATT services for platforms that use BlueZ.
34 class BluetoothLocalGattServiceBlueZ : public BluetoothGattServiceBlueZ {
35 public:
36 // device::BluetoothGattService overrides.
37 device::BluetoothUUID GetUUID() const override;
38 bool IsLocal() const override;
39 bool IsPrimary() const override;
40 device::BluetoothDevice* GetDevice() const override;
41 bool AddCharacteristic(
42 device::BluetoothGattCharacteristic* characteristic) override;
43 bool AddIncludedService(device::BluetoothGattService* service) override;
44 void Register(const base::Closure& callback,
45 const ErrorCallback& error_callback) override;
46 void Unregister(const base::Closure& callback,
47 const ErrorCallback& error_callback) override;
48
49 private:
50 friend class BluetoothDeviceBlueZ;
51
52 BluetoothLocalGattServiceBlueZ(BluetoothAdapterBlueZ* adapter,
53 const dbus::ObjectPath& object_path);
54 ~BluetoothLocalGattServiceBlueZ() override;
55
56 // Called by dbus:: on unsuccessful completion of a request to register a
57 // local service.
58 void OnRegistrationError(const ErrorCallback& error_callback,
59 const std::string& error_name,
60 const std::string& error_message);
61
62 // Note: This should remain the last member so it'll be destroyed and
63 // invalidate its weak pointers before any other members are destroyed.
64 base::WeakPtrFactory<BluetoothLocalGattServiceBlueZ> weak_ptr_factory_;
65
66 DISALLOW_COPY_AND_ASSIGN(BluetoothLocalGattServiceBlueZ);
67 };
68
69 } // namespace bluez
70
71 #endif // DEVICE_BLUETOOTH_BLUETOOTH_LOCAL_GATT_SERVICE_BLUEZ_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698