| OLD | NEW |
| 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_DBUS_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_ | 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_ |
| 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_ | 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "dbus/bus.h" | 11 #include "dbus/bus.h" |
| 12 #include "dbus/object_path.h" | 12 #include "dbus/object_path.h" |
| 13 #include "device/bluetooth/bluetooth_export.h" | 13 #include "device/bluetooth/bluetooth_export.h" |
| 14 | 14 |
| 15 namespace bluez { | 15 namespace bluez { |
| 16 | 16 |
| 17 // BluetoothGattServiceServiceProvider is used to provide a D-Bus object that | 17 // BluetoothGattServiceServiceProvider is used to provide a D-Bus object that |
| 18 // the Bluetooth daemon can communicate with to register GATT service | 18 // the Bluetooth daemon can communicate with to register GATT service |
| 19 // hierarchies. | 19 // hierarchies. |
| 20 // | 20 // |
| 21 // Instantiate with a chosen D-Bus object path (that conforms to the BlueZ GATT | 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 | 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 | 23 // pass the D-Bus object path as the |service_path| argument to the |
| 24 // chromeos::BluetoothGattManagerClient::RegisterService method. Make sure to | 24 // bluez::BluetoothGattManagerClient::RegisterService method. Make sure to |
| 25 // create characteristic and descriptor objects using the appropriate service | 25 // create characteristic and descriptor objects using the appropriate service |
| 26 // providers before registering a GATT service with the Bluetooth daemon. | 26 // providers before registering a GATT service with the Bluetooth daemon. |
| 27 class DEVICE_BLUETOOTH_EXPORT BluetoothGattServiceServiceProvider { | 27 class DEVICE_BLUETOOTH_EXPORT BluetoothGattServiceServiceProvider { |
| 28 public: | 28 public: |
| 29 virtual ~BluetoothGattServiceServiceProvider(); | 29 virtual ~BluetoothGattServiceServiceProvider(); |
| 30 | 30 |
| 31 // Creates the instance where |bus| is the D-Bus bus connection to export the | 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| | 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 | 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 | 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 | 35 // service being created. Make sure that all included services have been |
| 36 // exported before registering a GATT services with the GATT manager. | 36 // exported before registering a GATT services with the GATT manager. |
| 37 static BluetoothGattServiceServiceProvider* Create( | 37 static BluetoothGattServiceServiceProvider* Create( |
| 38 dbus::Bus* bus, | 38 dbus::Bus* bus, |
| 39 const dbus::ObjectPath& object_path, | 39 const dbus::ObjectPath& object_path, |
| 40 const std::string& uuid, | 40 const std::string& uuid, |
| 41 const std::vector<dbus::ObjectPath>& includes); | 41 const std::vector<dbus::ObjectPath>& includes); |
| 42 | 42 |
| 43 protected: | 43 protected: |
| 44 BluetoothGattServiceServiceProvider(); | 44 BluetoothGattServiceServiceProvider(); |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(BluetoothGattServiceServiceProvider); | 47 DISALLOW_COPY_AND_ASSIGN(BluetoothGattServiceServiceProvider); |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace bluez | 50 } // namespace bluez |
| 51 | 51 |
| 52 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_ | 52 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_SERVICE_SERVICE_PROVIDER_H_ |
| OLD | NEW |