question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

StartUpdatesAsync on characteristic Android error

See original GitHub issue

Steps to reproduce

  1. Download xamarin-bluetooth-le from master branch

  2. Launch BLE explorer

  3. Coonect to a Device with custom service - with 2 characteristics

  • 1 Write without Response (1)
  • 1 update with Notify (2)
  1. try to write and update

Expected behavior

Write on characteristic 1 send data to my device Update on characteristic 2 get data when my device send data

Actual behavior

I connected to my device, discover services, and get characteristics.

  • carac 1 : Write without Response (1)
  • carac 2 : update with Notify (2)

when i wrote on mu (1), its ok when i try to update (2), my application give an exeption.

Crashlog

I got an exeption : “Gatt SetCharacteristicNotification FAILED.”

i check in source code and found that :

/ In order to subscribe to notifications on a given characteristic, you must first set the Notifications Enabled bit // in its Client Characteristic Configuration Descriptor. See https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorsHomePage.aspx and // https://developer.bluetooth.org/gatt/descriptors/Pages/DescriptorViewer.aspx?u=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml // for details.

i dont know why

if (!_gatt.SetCharacteristicNotification(_nativeCharacteristic, true))
                throw new CharacteristicReadException("Gatt SetCharacteristicNotification FAILED.");

return false 😕

Configuration

Version of the Plugin: e.g. 1.2.1

Platform: e.g. Android 4.4.2

Device: e.g. wiko rainbow 4G

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
vimalavencommented, Jun 8, 2020

Same, it’s not working for me too. The event never gets triggered. Any idea?

0reactions
tcatalanocommented, Aug 2, 2018

I know this is an old thread but I am having same problem with Characteristic.ValueUpdated not firing. Have verified with nrfConnect that notification is definitely being sent from device. Have tried 1.3 and 2.0 packages.

Was there a resolution? Thanks for any info.

Read more comments on GitHub >

github_iconTop Results From Across the Web

StartUpdatesAsync on characteristic Android error #176
I connected to my device, discover services, and get characteristics. carac 1 : Write without Response (1); carac 2 : update with Notify...
Read more >
StartUpdatesAsync on characteristic Android error
Steps to reproduce. Download xamarin-bluetooth-le from master branch. Launch BLE explorer. Coonect to a Device with custom service - with 2 ...
Read more >
How to fix 'Gatt write characteristic FAILED.' exception in ...
You are trying to run IO operation on MAIN thread. That is not possible and Android won't let you do this. This rises...
Read more >
Implementation and complete understanding of BLE(Bluetooth ...
On Android this will throw a GATT ERROR in a couple of seconds if the device is out of range. try { await...
Read more >
Plugin.BLE 3.0.0-beta.2
On Android this will throw a GATT ERROR in a couple of seconds if the device is out of range. try { await...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found