Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1544)

Unified Diff: device/bluetooth/bluetooth_local_gatt_characteristic.h

Issue 1973703002: Implement //device/bt changes for notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notifications_dbus
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/bluetooth/bluetooth_local_gatt_characteristic.h
diff --git a/device/bluetooth/bluetooth_local_gatt_characteristic.h b/device/bluetooth/bluetooth_local_gatt_characteristic.h
index 9170d38ac8f319607929f10e47a61947f7dee3e7..5511c79a561700c44c2af3e5cd296ec372ce83bb 100644
--- a/device/bluetooth/bluetooth_local_gatt_characteristic.h
+++ b/device/bluetooth/bluetooth_local_gatt_characteristic.h
@@ -29,6 +29,13 @@ namespace device {
class DEVICE_BLUETOOTH_EXPORT BluetoothLocalGattCharacteristic
: public virtual BluetoothGattCharacteristic {
public:
+ enum NotificationStatus {
+ NOTIFICATION_SUCCESS = 0,
+ NOTIFY_PROPERTY_NOT_SET,
+ INDICATE_PROPERTY_NOT_SET,
+ SERVICE_NOT_REGISTERED,
+ };
+
// Constructs a BluetoothLocalGattCharacteristic associated with a local GATT
// service when the adapter is in the peripheral role.
//
@@ -48,6 +55,15 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothLocalGattCharacteristic
Permissions permissions,
BluetoothLocalGattService* service);
+ // Notify that the remote central that the value of this characteristic has
+ // been changed and the new value is |new_value|. |indicate| should be set to
+ // true if we want to use an indication instead of a notification. An
+ // indication waits for a response from the remote, making it more reliable
+ // but notifications may be faster.
+ virtual NotificationStatus NotifyValueChanged(
+ const std::vector<uint8_t>& new_value,
+ bool indicate) = 0;
+
protected:
BluetoothLocalGattCharacteristic();
~BluetoothLocalGattCharacteristic() override;

Powered by Google App Engine
This is Rietveld 408576698