btleplug icon indicating copy to clipboard operation
btleplug copied to clipboard

往Gatt characteristic写入数据时会将通道阻塞住

Open Henxun opened this issue 2 years ago • 2 comments

Describe the bug A clear and concise description of what the bug is.

Expected behavior A clear and concise description of what you expected to happen.

Actual behavior A clear and concise description of what actually happened.

Additional context Add any other context about the problem here.

Henxun avatar Jul 26 '23 10:07 Henxun

let operation = self .characteristic .WriteValueWithOptionAsync(&writer.DetachBuffer()?, write_type.into())?; let result = operation.await?;

代码阻塞 "let result = operation.await",并且之前调用的discover_services也会阻塞无法结束

Henxun avatar Jul 27 '23 01:07 Henxun

当get_characteristics中调用GetCharacteristicsWithCacheModeAsync中传入参数BluetoothCacheMode::Uncached时会阻塞代码运行,BluetoothCacheMode::Uncached正常或者调用GetCharacteristicsAsync

Henxun avatar Jul 27 '23 08:07 Henxun