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

Side by Side Diff: device/bluetooth/bluetooth_remote_gatt_characteristic_android.cc

Issue 1681853003: Add BluetoothRemoteGattServiceWin to BluetoothDeviceWin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add PlatformSupportsLowEnergy check in the unittests Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_android.h" 5 #include "device/bluetooth/bluetooth_remote_gatt_characteristic_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 write_pending_ = true; 201 write_pending_ = true;
202 write_callback_ = callback; 202 write_callback_ = callback;
203 write_error_callback_ = error_callback; 203 write_error_callback_ = error_callback;
204 } 204 }
205 205
206 void BluetoothRemoteGattCharacteristicAndroid::OnChanged( 206 void BluetoothRemoteGattCharacteristicAndroid::OnChanged(
207 JNIEnv* env, 207 JNIEnv* env,
208 const JavaParamRef<jobject>& jcaller, 208 const JavaParamRef<jobject>& jcaller,
209 const JavaParamRef<jbyteArray>& value) { 209 const JavaParamRef<jbyteArray>& value) {
210 base::android::JavaByteArrayToByteVector(env, value, &value_); 210 base::android::JavaByteArrayToByteVector(env, value, &value_);
211 FOR_EACH_OBSERVER(BluetoothAdapter::Observer, adapter_->GetObservers(), 211 adapter_->NotifyGattCharacteristicValueChanged(this, value_);
212 GattCharacteristicValueChanged(adapter_, this, value_));
213 } 212 }
214 213
215 void BluetoothRemoteGattCharacteristicAndroid::OnRead( 214 void BluetoothRemoteGattCharacteristicAndroid::OnRead(
216 JNIEnv* env, 215 JNIEnv* env,
217 const JavaParamRef<jobject>& jcaller, 216 const JavaParamRef<jobject>& jcaller,
218 int32_t status, 217 int32_t status,
219 const JavaParamRef<jbyteArray>& value) { 218 const JavaParamRef<jbyteArray>& value) {
220 read_pending_ = false; 219 read_pending_ = false;
221 220
222 // Clear callbacks before calling to avoid reentrancy issues. 221 // Clear callbacks before calling to avoid reentrancy issues.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 void BluetoothRemoteGattCharacteristicAndroid::EnsureDescriptorsCreated() 286 void BluetoothRemoteGattCharacteristicAndroid::EnsureDescriptorsCreated()
288 const { 287 const {
289 if (!descriptors_.empty()) 288 if (!descriptors_.empty())
290 return; 289 return;
291 290
292 Java_ChromeBluetoothRemoteGattCharacteristic_createDescriptors( 291 Java_ChromeBluetoothRemoteGattCharacteristic_createDescriptors(
293 AttachCurrentThread(), j_characteristic_.obj()); 292 AttachCurrentThread(), j_characteristic_.obj());
294 } 293 }
295 294
296 } // namespace device 295 } // namespace device
OLDNEW
« no previous file with comments | « device/bluetooth/bluetooth_low_energy_win_fake.cc ('k') | device/bluetooth/bluetooth_remote_gatt_service_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698