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.

Found issue in Discovering the characteristics - Version 1.1.0 and above

See original GitHub issue

Using BLE-PLX Library for Scanning and Connecting to BLE devices

Did check your reference implementation as provided at - https://www.polidea.com/blog/ReactNative_and_Bluetooth_to_An_Other_level/

used the below code block to discover all services -

 device
          .connect()
          .then(device => {
            this.info('Discovering services and characteristics');
            return device.discoverAllServicesAndCharacteristics();
          })
          .then(device => {
            this.info('Setting notifications');
            return this.setupNotifications(device);
          })

The issue i found, is the device has no service UUIDs list even when the libraries like

react-native-ble-manager as successfully scanning and discovering services and characteristics

Attaching the screenshot of device properties - after scanning and discovering services - image

Kindly resolve the above issue as i am using your library in one of my project as initially i found it more better and easy to use. Kindly fix the bug as soon as possible, will be helpful.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Cierpliwycommented, Jan 31, 2020

Ok. Let me clarify. Device has multiple properties:

▸ id
▸ name
▸ rssi
▸ mtu
▸ manufacturerData
▸ serviceData
▸ serviceUUIDs
▸ localName
▸ txPowerLevel
▸ solicitedServiceUUIDs
▸ isConnectable
▸ overflowServiceUUIDs

We can group them into explicit categories: Read-only (stable) values:

▸ id

Properties, which can be modified, when the new Device object is fetched from the API (Device by itself is immutable and “snapshot” of it at the moment of the call):

▸ name
▸ mtu

Properties, which are fetched during the scanning procedure from the advertisement data (they are always null outside device scanning):

▸ rssi
▸ manufacturerData
▸ serviceData
▸ serviceUUIDs
▸ localName
▸ txPowerLevel
▸ solicitedServiceUUIDs
▸ isConnectable
▸ overflowServiceUUIDs

Therefore if you want to get services of the device (not services advertised during scanning procedure) you have to call sequentially device.iscoverAllServicesAndCharacteristics() and then device.services(). The result of the last call should return Array<Service>. I guess that’s what you expect.

Why all of the properties are in one bag? That’s just a mistake during early development, which we left as it is to keep backward compatibility (it’s so important for me in this crazy JS world).

0reactions
Ajaykumar02commented, Feb 1, 2020

@Cierpliwy, cool i have not used the device.services(). Thank you for clarification.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Found issue in Discovering the characteristics - Version 1.1.0 ...
Kindly resolve the above issue as i am using your library in one of my project as initially i found it more better...
Read more >
Autofill - Android Developers
Version 1.1.0 ... Let us know if you discover new issues or have ideas for improving this ... The commits included in this...
Read more >
Cisco FindIT Network Discovery Utility Quick Start Guide ...
Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental. Cisco FindIT Network Discovery Utility Version 1.1.0....
Read more >
Discovering Oracle E-Business Suite
1.1.0, Oracle Application Management Pack for Oracle E-Business Suite is bringing up all patch edition WebLogic Servers prior to performing discovery. All patch ......
Read more >
CVE-2021-44228 - NVD
From version 2.16.0 (along with 2.12.2, 2.12.3, and 2.3.1), ... CVSS Version 2.0 ... Show Matching CPE(s), Up to (excluding) 1.1.0.
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