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

kernel-implementation of Hub_Properties probably dependant on the way WinRT-bluetooth works #142

Closed
dkurok opened this issue Mar 22, 2021 · 2 comments · Fixed by #143
Closed
Assignees
Labels
area-hubs enhancement New feature or request

Comments

@dkurok
Copy link
Contributor

dkurok commented Mar 22, 2021

In Hub_Properties you do:
private async Task InitialHubPropertiesQueryAsync()
{
await Task.WhenAll(_knownProperties.Select(property => RequestHubPropertySingleUpdate(property)));
}
This actually fires up 14 writes to the Hub in parallel. Because the notifications of the Hub with the results are fired "slower" a lot of the notifications get lost.
I have this problem when using a BlueGiga-implementation ahering to your interfaces for Bluetooth.
If I change your above code to:
private async Task InitialHubPropertiesQueryAsync()
{
foreach (HubProperty property in _knownProperties)
{
await RequestHubPropertySingleUpdate(property);
}
}
this works perfect because it does the request of an update and awaits the result one after another! With WinRT-implementation I geuss it works with your implementation because WinRT's _characteristic.WriteValueWithResultAsync() does some background-waiting or alike (it nearly not commented at MS)
Maybe you can change that, because other bluetooth-implementations (BlueZ is in progress) may have the same problem.

@tthiery
Copy link
Member

tthiery commented Mar 23, 2021

I will create a Pull Request. That is a reasonable change. The BLE send message adapter we have is reasonable underspeced to not be clear on this.

@tthiery tthiery self-assigned this Mar 23, 2021
@tthiery tthiery added enhancement New feature or request area-hubs labels Mar 23, 2021
@tthiery tthiery added this to the v4.0 (breaking) milestone Mar 23, 2021
tthiery added a commit that referenced this issue Mar 23, 2021
@tthiery
Copy link
Member

tthiery commented Mar 23, 2021

Pull Request is prepared, awaiting review @dkurok

tthiery added a commit that referenced this issue Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-hubs enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants