Index: device/bluetooth/bluetooth_remote_gatt_characteristic_android.h |
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h |
index 4493a94579509581601d8e049126bb8f656d010a..606b7d4ffa4f0da711801abe434d7e92e0cc9826 100644 |
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h |
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_android.h |
@@ -7,6 +7,8 @@ |
#include <stdint.h> |
+#include <queue> |
+ |
#include "base/android/jni_android.h" |
#include "base/containers/scoped_ptr_hash_map.h" |
#include "base/macros.h" |
@@ -73,18 +75,24 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicAndroid |
const base::Closure& callback, |
const ErrorCallback& error_callback) override; |
+ // Called when StartNotifySession operation succeeds. |
+ void OnStartNotifySessionSuccess(); |
+ |
+ // Called when StartNotifySession operation fails. |
+ void OnStartNotifySessionError(BluetoothGattService::GattErrorCode error); |
+ |
// Called when value changed event occurs. |
void OnChanged(JNIEnv* env, |
const base::android::JavaParamRef<jobject>& jcaller, |
const base::android::JavaParamRef<jbyteArray>& value); |
- // Callback after Read operation completes. |
+ // Called when Read operation completes. |
void OnRead(JNIEnv* env, |
const base::android::JavaParamRef<jobject>& jcaller, |
int32_t status, |
const base::android::JavaParamRef<jbyteArray>& value); |
- // Callback after Write operation completes. |
+ // Called when Write operation completes. |
void OnWrite(JNIEnv* env, |
const base::android::JavaParamRef<jobject>& jcaller, |
int32_t status); |
@@ -123,6 +131,11 @@ class DEVICE_BLUETOOTH_EXPORT BluetoothRemoteGattCharacteristicAndroid |
// Adapter unique instance ID. |
std::string instance_id_; |
+ // StartNotifySession callbacks and pending state. |
+ typedef std::pair<NotifySessionCallback, ErrorCallback> |
+ PendingStartNotifyCall; |
+ std::queue<PendingStartNotifyCall> pending_start_notify_calls_; |
+ |
// ReadRemoteCharacteristic callbacks and pending state. |
bool read_pending_ = false; |
ValueCallback read_callback_; |