[BLE][C++]: Correct method to initiate disconnect on Windows Bluetooth stack?
Hello All,
Work Setup:
OS: Windows 10 Enterprise
VS Version: Microsoft Visual Studio Professional 2019 Version 16.8.3
Programming Language: C++
The call to trigger disconnect as per documentation is Close() or Dispose().
On using the methods on an object of type BluetoothLEDevice would always return in compilation error as below.
error C2039: 'Close': is not a member of 'Windows::Devices::Bluetooth::BluetoothLEDevice'
error C2039: 'Dispose': is not a member of 'Windows::Devices::Bluetooth::BluetoothLEDevice'
message : You should invoke the destructor, '~BluetoothLEDevice' instead
Also, suggests to invoke the destructor instead. On using the destructor call, it has been observed that a disconnect is issued only on the last connected device.
How can a BLE disconnect be achieved for a device of choice in C++?