Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for discovering ONLY one service when desired. Fix broken… #2

Merged
merged 4 commits into from
Oct 27, 2020

Conversation

tony-gutierrez
Copy link

… passing of Uuids to winrt C code.

This is for improved speed when the user only wants one service. This change is in the main noble-uwp already if you prefer to pull it from there.

Fixes the connectable status being stuck to that of the first seen advert (which gets cached).
@acstacey
Copy link
Owner

Looks good, thanks 👍

@acstacey acstacey merged commit e4dd4cd into acstacey:nodert Oct 27, 2020
@tony-gutierrez
Copy link
Author

tony-gutierrez commented Oct 27, 2020

There's another pr in the main repo to fix the connectable flag. Unfortunately I'm going to have to abandon noble-uwp (for noble-winrt), just can't get it to be stable when scanning for more than a few hours. Something is wrong in the nodert code somewhere.

@acstacey
Copy link
Owner

Have you had success with making connections in noble-winrt? I noticed you commented on this issue: Timeular/noble-winrt#10
I haven't tried it for a while as noble-uwp has been ok for me (I only scan for a minute or less at a time)

@tony-gutierrez
Copy link
Author

noble-winrt works on par with UWP, while using less ram. I am able to scan constantly for days with no issues, where uwp will crash.

I havent had your exact problem with the characteristics callback not firing, but occasionally I have seen that "no service exists" error. I discover a single service using Peripheral.discoverSomeServicesAndCharacteristics, instead of the nested method you had in your example, and it seems to work fine most of the time.

I found this branch, https://github.com/fido-alliance/noble-winrt, and the author has added some better error handling, and made some other tweaks. I wish the noble world wasn't so fragmented, but it seems that you just have to seek out the best of everyone's tweaks.

Also, people always package their binding as a noble replacement (including original noble, or https://github.com/abandonware/noble, or their own custom noble) instead of just simply publishing it as a binding that can be used with any noble. So it make merges and pull requests harder.

@acstacey
Copy link
Owner

Thanks for the tip, I only need one service so will try that in a couple of weeks. Yeah it's frustrating trying to piece together the best versions. I'm hoping abandonware noble will merge in winrt bindings at some point

@tony-gutierrez
Copy link
Author

Here's my latest winrt with all the fixes I have found a need for so far. https://github.com/tony-gutierrez/noble-winrt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants