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.

[iOS] Bug with discoverAllServicesAndCharacteristics

See original GitHub issue

I am implementing a simple component that scans and connects to a BLE device. The device I am trying to connect to is BLE test board. Here is the code I am using:

this.bleManager.connectToDevice(device.uuid)
      .then((device) => {
        console.log("DISCOVERING");
        return device.discoverAllServicesAndCharacteristics();
      })
      .then((device) => {
        console.log("DISCOVERED");
        this.setState({
          connectedGogglesId: device.uuid,
          connectedGoggles: device
        });
      })
      .then(() => {
        console.log("SUCCESS");
      }, (error) => {
        console.log(error);
      });

On Android, everything works fine, all services and characteristics are discovered and the “SUCCESS” message is printed. One iOS, however, the connection is successful, I see the bluetooth icon flash and turn white, it prints the “DISCOVERING” log message, but it just hangs on the discoverAllServicesAndCharacteristics call and never completes the discovery.

I’m using react-native 0.37 and the master branch of react-native-ble-plx. Any help or ideas at what might be causing this is GREATLY appreciated. Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
jchirschycommented, Aug 25, 2017

Hi all,

I’m facing a similar issue with IOS. discoverAllServicesAndCharacteristics is rejecting with the following message :

Error: Device 2B71F4FC-AD01-45E0-ADB5-440174341B08 is not connected

I also get the following warning :

Sending StateChangeEvent with no listeners registered.

Nevertheless, when I test the connection with .isDeviceConnected, the promise resolves successfully. I’m using an Ipad Mini 4 and react-native-ble-plx 0.6.1. Sniffator discovers characteristics properly, so as Lightblue.

Is there something new with this issue ?

Thanks for your help.

0reactions
stale[bot]commented, Mar 16, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[iOS] Bug with discoverAllServicesAndCharacteristics #30
I am implementing a simple component that scans and connects to a BLE device. The device I am trying to connect to is...
Read more >
RxBLELibraries/react-native-ble - Gitter
Hi, I'm facing same problem as @pride7 I'm not able to send data through my ... discoverAllServicesAndCharacteristics() but I don't understand what to...
Read more >
react-native-ble-plx 2.0.2 | Documentation
When iOS application launches BLE stack is not immediately available and we need to check its ... discoverAllServicesAndCharacteristics(transactionId).
Read more >
How do I discover Service UUIDs and Characterstic UUIDs ...
I'm trying to connect to my bluetooth device, however upon connecting and discovering all services and characteristics, I'm unable to advance ...
Read more >
Bluetooth sometimes reported as OF… - Apple Developer
Even though the bug is probably related. Environment: iOS 11.0.3 & 11.1.2. iPhone 7 & iPhone X. Bug Report: The state ...
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