Share via

GattCharacteristic.WriteValueAsync Method is directly throwing the exception when called after the BLE device is disconnected.

Punith P 0 Reputation points
2023-09-22T19:18:17.45+00:00

I am trying to build the console application to interact with BLE device and I am referring to windows BLE sample UWP program.

GattCharacteristic.WriteValueAsync Method works perfectly fine when BLE device is connected. But directly goes to "hresult_error" when called after device is disconnected. This is observed in the console application that I am building. Where as in the sample program it works fine by returning the failed status.

I have attached the code and call stack image.

 

BLE_Write_Error

Windows development | Windows API - Win32

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.