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.

Discovering services and characteristics callback never called

See original GitHub issue

Hi,

issue

I am connecting to a device and then calling discoverSomeServicesAndCharacteristics and discoverAllServicesAndCharacteristics I passed a callback to both methods and it was never fired.

I did try the discoverServices method and using the ‘servicesDiscover’ listener. The callback was fired but the services argument was an empty array.

Steps taken to debug

I have been able to connect and listen to the particular service I want to with the lightBlue ios app.

Version

v1.6.0 v1.7.0

What do I need to do to debug this further?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
gandhimonikcommented, May 10, 2019

@ojack I’ve started using discoverServices and discoverCharacteristics since then. I’ve observed that these 2 methods are more reliable. Basically, you call discoverServices on the peripheral object and then you call discoverCharacteristics on each service object.

1reaction
curioussavagecommented, Feb 14, 2017

@sandeepmistry here it is. I see at least two errors. That said I really have no idea what I’m looking at.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not discover Service and Characteristics via Bluetooth ...
One issue is probably that you call gatt.discoverServices() several times. Two times in the onConnectionStateChange method:
Read more >
[BLE] Android does not discover services if ... - Issue Tracker
It performs service discovery after receiving the SC indication. However, the onConnectionStateChange(..) callback is called immediately after ...
Read more >
@nabeeln7/noble - npm
For example, in case of the "discover services" operation of Peripheral: There's a discoverServices method expecting a callback: peripheral.
Read more >
Generic Attribute Profile (GATT) - Zephyr Project Documentation
Attribute read and write callbacks are called directly from RX Thread thus it is not ... Caching discovered attributes is not supported.
Read more >
Bluetooth Low Energy Custom Profile
This is not coincidental. The GATT protocol specifies that a peer device should be able to discover all the services and characteristics by...
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