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

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

Issue 1898643002: Refactor device::BluetoothGattXXX classes to split into remote/local. (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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_GATT_NOTIFY_SESSION_H_ 5 #ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_H_
6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_H_ 6 #define DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "device/bluetooth/bluetooth_export.h" 12 #include "device/bluetooth/bluetooth_export.h"
13 13
14 namespace device { 14 namespace device {
15 15
16 // A BluetoothGattNotifySession represents an active session for listening 16 // A BluetoothGattNotifySession represents an active session for listening
17 // to value updates from GATT characteristics that support notifications and/or 17 // to value updates from GATT characteristics that support notifications and/or
18 // indications. Instances are obtained by calling 18 // indications. Instances are obtained by calling
19 // BluetoothGattCharacteristic::StartNotifySession. 19 // BluetoothRemoteGattCharacteristic::StartNotifySession.
20 class DEVICE_BLUETOOTH_EXPORT BluetoothGattNotifySession { 20 class DEVICE_BLUETOOTH_EXPORT BluetoothGattNotifySession {
21 public: 21 public:
22 // Destructor automatically stops this session. 22 // Destructor automatically stops this session.
23 virtual ~BluetoothGattNotifySession(); 23 virtual ~BluetoothGattNotifySession();
24 24
25 // Returns the identifier of the associated characteristic. 25 // Returns the identifier of the associated characteristic.
26 virtual std::string GetCharacteristicIdentifier() const = 0; 26 virtual std::string GetCharacteristicIdentifier() const = 0;
27 27
28 // Returns true if this session is active. 28 // Returns true if this session is active.
29 virtual bool IsActive() = 0; 29 virtual bool IsActive() = 0;
30 30
31 // Stops this session and calls |callback| upon completion. This won't 31 // Stops this session and calls |callback| upon completion. This won't
32 // necessarily stop value updates from the characteristic -- since updates 32 // necessarily stop value updates from the characteristic -- since updates
33 // are shared among BluetoothGattNotifySession instances -- but it will 33 // are shared among BluetoothGattNotifySession instances -- but it will
34 // terminate this session. 34 // terminate this session.
35 virtual void Stop(const base::Closure& callback) = 0; 35 virtual void Stop(const base::Closure& callback) = 0;
36 36
37 protected: 37 protected:
38 BluetoothGattNotifySession(); 38 BluetoothGattNotifySession();
39 39
40 private: 40 private:
41 DISALLOW_COPY_AND_ASSIGN(BluetoothGattNotifySession); 41 DISALLOW_COPY_AND_ASSIGN(BluetoothGattNotifySession);
42 }; 42 };
43 43
44 } // namespace device 44 } // namespace device
45 45
46 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_H_ 46 #endif // DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_H_
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_gatt_descriptor_unittest.cc ('k') | device/bluetooth/bluetooth_gatt_notify_session_bluez.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698