nativescript-community / nativescript-community/ble
DiscoverCharacteristics not returning promise iOS
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.
- The args isn't coming through properly.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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