summaryrefslogtreecommitdiffstats
path: root/device/bluetooth/bluetooth_gatt_notify_session_android.h
blob: 8413f87c1327a1c9188fe62716674fe4f5dc5b7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_ANDROID_H_
#define DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_ANDROID_H_

#include <string>

#include "base/callback.h"
#include "base/macros.h"
#include "device/bluetooth/bluetooth_gatt_notify_session.h"

namespace device {

class BluetoothAdapter;
class BluetoothRemoteGattCharacteristicAndroid;

// BluetoothGattNotifySessionAndroid implements
// BluetoothGattNotifySession for the Android platform.
//
// TODO(crbug.com/551634): Detect destroyed Characteristic or parents objects.
// TODO(crbug.com/551634): Implement Stop.
class DEVICE_BLUETOOTH_EXPORT BluetoothGattNotifySessionAndroid
    : public device::BluetoothGattNotifySession {
 public:
  explicit BluetoothGattNotifySessionAndroid(
      const std::string& characteristic_identifier);
  ~BluetoothGattNotifySessionAndroid() override;

  // BluetoothGattNotifySession overrides.
  std::string GetCharacteristicIdentifier() const override;
  bool IsActive() override;
  void Stop(const base::Closure& callback) override;

 private:
  // Identifier of the associated characteristic.
  std::string characteristic_id_;

  DISALLOW_COPY_AND_ASSIGN(BluetoothGattNotifySessionAndroid);
};

}  // namespace device

#endif  //  DEVICE_BLUETOOTH_BLUETOOTH_GATT_NOTIFY_SESSION_ANDROID_H_