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.
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.