Cache all characteristics in all services once a peripheral is connected
Reason for Changes
I encounter an annoying issue that read/write for each characteristic has a delay (approximately 1 second) on Windows.
This delay is caused by service.GetCharacteristicsAsync(BluetoothCacheMode.Uncached) in BLESession#GetEndpoint() which takes 1 second on my development PC with a bluetooth adapter.
Avoid this, I would like to propose this PR to cache all characteristics once a peripheral is connected.
Fortunately this does not significantly increase duration on connecting phase to the peripheral.
Resolves
Resolves #151
Proposed Changes
Reason for Changes
I encounter an annoying issue that read/write for each characteristic has a delay (approximately 1 second) on Windows. This delay is caused by
service.GetCharacteristicsAsync(BluetoothCacheMode.Uncached)
inBLESession#GetEndpoint()
which takes 1 second on my development PC with a bluetooth adapter.Avoid this, I would like to propose this PR to cache all characteristics once a peripheral is connected.
Fortunately this does not significantly increase duration on connecting phase to the peripheral.