forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbluetooth_gatt_service_bluez.h
56 lines (40 loc) · 1.76 KB
/
bluetooth_gatt_service_bluez.h
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
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2016 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_BLUEZ_BLUETOOTH_GATT_SERVICE_BLUEZ_H_
#define DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_SERVICE_BLUEZ_H_
#include <string>
#include "base/macros.h"
#include "dbus/object_path.h"
#include "device/bluetooth/bluetooth_gatt_service.h"
namespace bluez {
class BluetoothAdapterBlueZ;
class BluetoothDeviceBlueZ;
// The BluetoothGattServiceBlueZ class implements BluetootGattService
// for GATT services on platforms that use BlueZ.
class BluetoothGattServiceBlueZ : public virtual device::BluetoothGattService {
public:
// device::BluetoothGattService overrides.
std::string GetIdentifier() const override;
// Object path of the underlying service.
const dbus::ObjectPath& object_path() const { return object_path_; }
// Parses a named D-Bus error into a service error code.
static device::BluetoothGattService::GattErrorCode DBusErrorToServiceError(
const std::string error_name);
// Returns the adapter associated with this service.
BluetoothAdapterBlueZ* GetAdapter() const;
protected:
BluetoothGattServiceBlueZ(BluetoothAdapterBlueZ* adapter,
dbus::ObjectPath object_path);
~BluetoothGattServiceBlueZ() override;
private:
friend class BluetoothDeviceBlueZ;
// The adapter associated with this service. It's ok to store a raw pointer
// here since |adapter_| indirectly owns this instance.
BluetoothAdapterBlueZ* adapter_;
// Object path of the GATT service.
dbus::ObjectPath object_path_;
DISALLOW_COPY_AND_ASSIGN(BluetoothGattServiceBlueZ);
};
} // namespace bluez
#endif // DEVICE_BLUETOOTH_BLUEZ_BLUETOOTH_GATT_SERVICE_BLUEZ_H_