adabru / BleWinrtDll

BLE for Unity 3d in Windows without UWP.
Do What The F*ck You Want To Public License
168 stars 52 forks source link

Enable Indication into Client Characteristic Configuration #33

Closed xmeubah closed 2 years ago

xmeubah commented 2 years ago

I would like to enable DFU mode of my nordic device. In order to perform this, I have to subscribe to a characteristic with Indications enabled. To do it, I have modified your code as followed : status = co_await characteristic.WriteClientCharacteristicConfigurationDescriptorWithResultAsync(GattClientCharacteristicConfigurationDescriptorValue::Indicate); Unfortunately, indications do not seem to be enabled.

Could you please help me ?

xmeubah commented 2 years ago

The solution was that I need to Write to Characteristic with GattWriteOption::WriteWithResponse option and not GattWriteOption::WriteWithoutResponse...

auto status = co_await characteristic.WriteValueAsync(buffer, GattWriteOption::WriteWithResponse);