-
Notifications
You must be signed in to change notification settings - Fork 136
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
Winrt full support #266
Winrt full support #266
Conversation
Cartermel
commented
Apr 24, 2024
- adds ble peripheral functionality for windows (advertising, notifying etc)
Wow, this looks pretty great @Cartermel thank you for working on it! @jagobagascon could you please take a look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made a quick advertising test and it is working. But at least for me the advertised data is switching back and forth between my own test, and Windows' own advertising (I'm running Windows on a VM so this may be related to my setup).
return err | ||
} | ||
|
||
a.publisher = pub |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we check if a.publisher
is null and release the existing instance if not?
If someone calls Configure
a few times they would end up leaking memory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, added that for the publisher as well as the advertisement, which was unused by accident! Looks to be working in the heartrate example if I try to reconfigure it a couple times before starting.
Could you give some more insight on how the advertisement is switching? The advertisements were quite strange to get working, I copied most of their implementation for this C# source, which I was never really able to see from my phone using the ble tester app on android. But seems to work fine when running the heartrate example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using the nRF Connect app to check the advertised data. And this is what I get when running the advertisement example:
screen-20240426-090119.2.mp4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah okay when using nrf connect I can see it. It's not alternating for me, sometimes it pops up then disappears for a second or two though, but I never see any windows advertising data.
this behavior is the same when I run the C# source as well, seems to be a windows quirk?
when running the heartrate example, and adding some manufacturer data to the advertisement, it shows up steady
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you give some more insight on how the advertisement is switching?
This is pretty common behavior. If there's more than one advertisement happening at the same time, many systems will alternate between them. Because they use the same MAC address for both advertisements, it looks like it's constantly changing.
I wouldn't worry about it if it doesn't cause any problems.
@Cartermel @jagobagascon @aykevl anything else needed here or are we good to merge? |
I'll try to work on the bug (saltosystems/winrt-go#92) @Cartermel reported on winrt-go today. It would be great if you could wait for me to fix that. |
FYI saltosystems/winrt-go#93 has been merged and should fix the vector errors @Cartermel was having. |
Thank you @jagobagascon for the fix. @Cartermel can you please update the go.mod/go.sum in this PR and verify it has been addressed? |
@deadprogram updated and it's working great, |
Thank you very much @Cartermel @jagobagascon and @aykevl now squash/merging. |