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.

Updates not received when calling updateValueCallback repeatedly

See original GitHub issue

Hi, thanks for an awesome library! Im experiencing an issue at the moment but Im not sure whether its in Android or Bleno. (Im communicating with Bleno from an Android device)

Im using Bleno like a Socket (One characteristic and write data back and forth on it). The data can be bigger than the notification size limit, so Im splitting it into chunks (if neccessary) and sending this.updateValueCallback(chunk); for each chunk.

Everything works as expected with up to exactly 9 chunks. When adding a 10th Chunk, I don’t receive anything on my Android device (Not the first 9 either). I experimented with adding Sleep() calls between sending each Chunk. With short sleeps (like 5 ms) there is no difference. With longer sleeps (1 second) it starts to work again (I receive the characteristic updates on Android).

So Im wondering if this is an issue with Bleno or with Android. If its an Android issue, feel free to ignore it 😃

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:17

github_iconTop GitHub Comments

2reactions
farfromrefugcommented, May 12, 2016

I solved that issue by using a toSend stack. I then use onIndicate (which is sent when a packaged as been successfully received) to check if toSend is empty. If not i call updateValueCallback and slice the stack

No more need for a sleep timer

0reactions
chrisbartleycommented, Dec 19, 2018

Another update: running under Raspbian on a Raspberry Pi 3 B+, I don’t need any wait at all. Using indicate does the right thing so that onIndicate() is really only getting called once the chunk is successfully sent. Is the faulty behavior a known issue on the Mac?

Read more comments on GitHub >

github_iconTop Results From Across the Web

onIndicate not documented · Issue #170 · noble/bleno - GitHub
I have implemented an "indicate" and do get the onIndicate call when I ... Calling updateValueCallback repeatedly to update a Characteristic ...
Read more >
How to implement update value callback when peripheral ...
For example, I've defined my characteristic as follows: var customCharacteristic = function() { bleno.Characteristic.call(this, { uuid: 'UUID_HERE', properties: ...
Read more >
bleno - Bountysource
Calling bleno.disconnect() disconnects device but blocks new connection for ... BLE can connect and get the service , but it can NOT get...
Read more >
Request location updates - Android Developers
This lesson shows you how to get the update using the LocationCallback callback approach. Call requestLocationUpdates() , passing it your instance of the ......
Read more >
LightningChart® JS API Documentation
Event handler for mouse event that is 'abrupt'. Meaning that the event can be triggered as a side-effect of something totally unrelated, without...
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