bluetooth lowenergy - Android BLE onCharacteristicChanged not invoked -
in app have used setcharacteristicnotification enable notificaito characteristic. in log cat getting notification enable true got success on ondescriptorwrite callback callback method oncharacteristicchanged not called.please me. in advance
log
d/bluetoothgatt(15694): setcharacteristicnotification() - uuid: 00003c01-0000-1000-8000-00805f9b34fb enable: true
code
mbluetoothgatt.setcharacteristicnotification(characteristic, enabled); bluetoothgattdescriptor descriptor = characteristic.getdescriptor( uuid.fromstring(samplegattattributes.client_characteristic_config)); descriptor.setvalue(bluetoothgattdescriptor.enable_notification_value); return mbluetoothgatt.writedescriptor(descriptor);
just added sleep between read , write operations , working fine.
try { thread.sleep(200); } catch (interruptedexception e) { e.printstacktrace(); }
Comments
Post a Comment