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_CHARACTERISTIC_SERVICE_PROVIDER_H_ | 5 #ifndef DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_H_ |
6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_H_ | 6 #define DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 20 matching lines...) Expand all Loading... |
31 // property are delegated to the Delegate object, an instance of which is | 31 // property are delegated to the Delegate object, an instance of which is |
32 // mandatory during initialization. In addition, a "SendValueChanged" method is | 32 // mandatory during initialization. In addition, a "SendValueChanged" method is |
33 // provided, which emits a DBus.Properties.PropertyChanged signal for the | 33 // provided, which emits a DBus.Properties.PropertyChanged signal for the |
34 // "Value" property. | 34 // "Value" property. |
35 class DEVICE_BLUETOOTH_EXPORT BluetoothGattCharacteristicServiceProvider { | 35 class DEVICE_BLUETOOTH_EXPORT BluetoothGattCharacteristicServiceProvider { |
36 public: | 36 public: |
37 virtual ~BluetoothGattCharacteristicServiceProvider(); | 37 virtual ~BluetoothGattCharacteristicServiceProvider(); |
38 | 38 |
39 // Send a PropertyChanged signal to notify the Bluetooth daemon that the value | 39 // Send a PropertyChanged signal to notify the Bluetooth daemon that the value |
40 // of the "Value" property has changed to |value|. | 40 // of the "Value" property has changed to |value|. |
41 virtual void SendValueChanged(const dbus::ObjectPath& device_path, | 41 virtual void SendValueChanged(const std::vector<uint8_t>& value) = 0; |
42 const std::vector<uint8_t>& value, | |
43 bool indicate) = 0; | |
44 | 42 |
45 // Writes the characteristics's properties into the provided writer. If | 43 // Writes the characteristics's properties into the provided writer. If |
46 // value is not null, it is written also, otherwise no value property is | 44 // value is not null, it is written also, otherwise no value property is |
47 // written. | 45 // written. |
48 virtual void WriteProperties(dbus::MessageWriter* writer) {} | 46 virtual void WriteProperties(dbus::MessageWriter* writer) {} |
49 | 47 |
50 virtual const dbus::ObjectPath& object_path() const = 0; | 48 virtual const dbus::ObjectPath& object_path() const = 0; |
51 | 49 |
52 // Creates the instance, where |bus| is the D-Bus bus connection to export | 50 // Creates the instance, where |bus| is the D-Bus bus connection to export |
53 // the object onto, |uuid| is the 128-bit GATT characteristic UUID, | 51 // the object onto, |uuid| is the 128-bit GATT characteristic UUID, |
(...skipping 20 matching lines...) Expand all Loading... |
74 protected: | 72 protected: |
75 BluetoothGattCharacteristicServiceProvider(); | 73 BluetoothGattCharacteristicServiceProvider(); |
76 | 74 |
77 private: | 75 private: |
78 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicServiceProvider); | 76 DISALLOW_COPY_AND_ASSIGN(BluetoothGattCharacteristicServiceProvider); |
79 }; | 77 }; |
80 | 78 |
81 } // namespace bluez | 79 } // namespace bluez |
82 | 80 |
83 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_
H_ | 81 #endif // DEVICE_BLUETOOTH_DBUS_BLUETOOTH_GATT_CHARACTERISTIC_SERVICE_PROVIDER_
H_ |
OLD | NEW |