Wireless Communication Library Support Forum

Frameworks => Bluetooth Framework => Topic started by: steam3d on July 05, 2021, 02:44:42 PM

Title: Does the Bluetooth Framework support connect to the headphones?
Post by: steam3d on July 05, 2021, 02:44:42 PM
I need just to connect or disconnect the headphones (Classic Bluetooth) without sending any data to it. (like on the screenshoot). Can i reach this by using your Bluetooth Framework?
(https://i.stack.imgur.com/eFqCm.png)
Title: Re: Does the Bluetooth Framework support connect to the headphones?
Post by: Mike Petrichenko on July 05, 2021, 03:17:47 PM
Yes, it is possible.

Run BluetoothManager demo application. Discover your device. Then click Enum service and select your Audio service (it is Advanced Audio Gateway or A2DP Gateway). Then click Install Device. To disconnect click Uninstall device.
Title: Re: Does the Bluetooth Framework support connect to the headphones?
Post by: steam3d on July 06, 2021, 11:58:52 AM
I checked BluetoothManager. Looks like you just turn on / off some of Headphones services to connect / disconnect. (Something like https://docs.microsoft.com/en-us/windows/win32/api/bluetoothapis/nf-bluetoothapis-bluetoothsetservicestate)
It's dirty way and not the same when i click to connect button on paired bluetooth device.

Also the device never get disconnected even if i disable all available device services. There is also another problem, when some audio service change their state from disabled to enabled, the windows recreated the audio endpoint and generate new audio GUID instead use the old one.

In General, this option will not work for me.
Title: Re: Does the Bluetooth Framework support connect to the headphones?
Post by: Mike Petrichenko on July 06, 2021, 01:00:19 PM
There is no other documented way to do what you need.