nativescript-community / nativescript-community/ble

DiscoverCharacteristics not returning promise iOS

Open
#196 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
202
Forks
79
PR merge metrics
No merged PRs in 30d

Description

The device I'm working against has a service 0000ffe0-0000-1000-8000-00805f9b34fb which is discovered just fine with discoverServices. When I call discoverCharacteristics with that ID the promise never gets returned. I did a little debugging and for some reason in the args for discoverCharacteristics in bluetooth.ios.js the id is coming through as ffe0 but everything seems fine until we get to this if statement.

if (UUID === pUUID && sUUID === args.serviceUUID)

Here the sUUID does not equal args.serviceUUID and this is where the call will hang at.

As far as I can tell I have 2 issues here.

  1. The args isn't coming through properly.
  2. The if statement above should return the promise as a reject if it is not met.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in bluetooth.ios.js and trace the discoverCharacteristics path after discoverServices succeeds. Inspect how the service UUID is passed and compared in the if (UUID === pUUID && sUUID === args.serviceUUID) condition. Done means the reported service can discover characteristics without hanging, with the promise outcome behaving as intended when the condition is not met.

Written by the indexing model from the issue text.

Assessment

Tech stack
ios, typescript
Domain
mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.