admin管理员组文章数量:1550369
I have connected to a bluetooth device. I am able to read charectristic using mGatt.readCharacteristic(getMiliService().getCharacteristic(uuid));
But I am not able to register indicate for a characteristic.
What I tried boolean flag1 = m_Gatt.setCharacteristicNotification(bluetoothgattcharacteristic, flag); BluetoothGattDescriptor descriptor= bluetoothgattcharacteristic.getDescriptor(Helper.UUID_DESCRIPTOR_CLIENT_CHARACTERISTIC_CONFIGURATION); descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE); mGatt.writeDescriptor(descriptor); descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE); mGatt.writeDescriptor(descriptor);
and waiting for onCharacteristicChanged(BluetoothGatt bluetoothgatt, final BluetoothGattCharacteristic characteristic)
method getting called. which never happend.
I am not sure what I am missing here.
Can anyone give a working example for indicate?
本文标签: androidsubscribingBLE
版权声明:本文标题:android indicate,Example for subscribing for BLE indicate in android 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/xitong/1727245737a1104606.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论