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
3 // found in the LICENSE file.
5 #ifndef CHROMEOS_DBUS_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_
6 #define CHROMEOS_DBUS_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_
11 #include "chromeos/chromeos_export.h"
13 #include "dbus/object_path.h"
17 // BluetoothGattServiceServiceProvider is used to provide a D-Bus object that
18 // the Bluetooth daemon can communicate with to register GATT service
21 // Instantiate with a chosen D-Bus object path (that conforms to the BlueZ GATT
22 // service specification), service UUID, and the list of included services, and
23 // pass the D-Bus object path as the |service_path| argument to the
24 // chromeos::BluetoothGattManagerClient::RegisterService method. Make sure to
25 // create characteristic and descriptor objects using the appropriate service
26 // providers before registering a GATT service with the Bluetooth daemon.
27 class CHROMEOS_EXPORT BluetoothGattServiceServiceProvider
{
29 virtual ~BluetoothGattServiceServiceProvider();
31 // Creates the instance where |bus| is the D-Bus bus connection to export the
32 // object onto, |object_path| is the object path that it should have, |uuid|
33 // is the 128-bit GATT service UUID, and |includes| are a list of object paths
34 // belonging to other exported GATT services that are included by the GATT
35 // service being created. Make sure that all included services have been
36 // exported before registering a GATT services with the GATT manager.
37 static BluetoothGattServiceServiceProvider
* Create(
39 const dbus::ObjectPath
& object_path
,
40 const std::string
& uuid
,
41 const std::vector
<dbus::ObjectPath
>& includes
);
44 BluetoothGattServiceServiceProvider();
47 DISALLOW_COPY_AND_ASSIGN(BluetoothGattServiceServiceProvider
);
50 } // namespace chromeos
52 #endif // CHROMEOS_DBUS_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_