0

Overview

Hi everyone, I'm developing a feature for a Softphone (run on windows), that's make answer/end a call from Bluetooth headsets or speakerphones. I have read and do step by step follow Hands-free Profile spec: https://www.bluetooth.com/specifications/specs/hands-free-profile-1-8/

Currently, I have set up "Sevice Level Connection" by send/recv AT commands follow the spec.

Problem

  1. I don't know how to set-up Audio Connection that know as SCO connection. It's seem need to write a custom driver, that I have no experience with. The only tutorial I see from Microsoft is very difficult to understand: https://learn.microsoft.com/en-us/windows-hardware/drivers/bluetooth/creating-a-sco-client-connection-to-a-remote-device
  2. Is there any way to bypass this step without code a driver?
  3. If I can set-up Audio Connection then Can I answer/end call from Bluetooth headset?

This is Initialization Sevice Level Connection diagram: https://i.stack.imgur.com/9KMlb.png

This is Answer Call diagram: https://i.stack.imgur.com/M8WZf.png

Viète
  • 1
  • 1
  • 2
  • 1. Learn how to develop drivers (KMDF is what you need). 2. Yes and no, depends on your requirements. 3. Yes. Expanded 2: use standard windows My Phone application. It installs HFP driver that can be simple used then by yoyr application. – Mike Petrichenko Jun 09 '22 at 10:16
  • Thanks @MikePetrichenko, your mean is Phone Link app?https://www.microsoft.com/store/productId/9NMPJ99VJBWV? – Viète Jun 09 '22 at 10:29
  • (1) I know it depend on my skill, but as a beginner, how long I need to spent learning how to develop this driver? – Viète Jun 09 '22 at 10:37
  • Sorry, the app called "Your phone" It is standard Win 10 app that is preinstalled with Windows. There is no answer on this question. It may take 1 year, or 10 years. I do not think that it may take less than 3 months. – Mike Petrichenko Jun 09 '22 at 10:49
  • Thanks @MikePetrichenko. But I don't understand how to use HFP driver on YouR Phone app? Could you describe more detail about it, please? – Viète Jun 10 '22 at 02:56
  • Discover Bluetooth devices to find your one. Enumerate its services. Find service you need (HandsFree Audio Gateway) and then install it by using BluetoothSetServiceState. Once device installed you can use new audio device. You have to use RfComm control channel to control the HandsFree and send commands to it separately. – Mike Petrichenko Jun 10 '22 at 03:32
  • I see this site say: "Windows 10 (Version 1903) supports HFP", so what is level it support? https://support.microsoft.com/en-us/windows/supported-bluetooth-profiles-8900e50f-318e-4283-2beb-c8325bfc9515 – Viète Jun 10 '22 at 03:35
  • @MikePetrichenko, I have performed all step you say, but which is the step relevant to HFP driver of Your Phone app or SCO driver? This is my code: bit.ly/3xBtNGg – Viète Jun 10 '22 at 04:13
  • Default Win10 driver (without my Phone app) supports only HandsFree Profile. If you want to connect to phone (PC appears as HandsFree Gateway) you need the My Phone app. – Mike Petrichenko Jun 10 '22 at 07:23
  • I took a look on your code but I have no idea what third party classes you use so I can't help with that. – Mike Petrichenko Jun 10 '22 at 07:32
  • I used 32Feet .NET – Viète Jun 10 '22 at 07:36
  • No, I want to connect PC and Headset, not phone – Viète Jun 10 '22 at 07:40
  • Are you mean I should connect PC to Your Phone, then connect phone to headset? – Viète Jun 10 '22 at 07:43
  • No, you can simple connect to HFP service control channel after installing the driver. About 32feet its better to contact 32feet support. I can help with native API calls or with our products only. – Mike Petrichenko Jun 10 '22 at 07:45
  • Yes, then I have to write SCO profile driver for SCO connection? or just init Sevice Level Connection then it's possible answer call from headset? – Viète Jun 10 '22 at 07:56
  • You do not need custom profile driver for HFP profile. It is shipped with Windows 10 (and, AFAIR, Win 8) – Mike Petrichenko Jun 10 '22 at 08:28
  • Many thanks for your assistance, I will retry with native API – Viète Jun 10 '22 at 09:02
  • Hi @MikePetrichenko, currently I can accept/reject/end call by send/recv AT commands (I use C# with System.Runtime.WindowsRuntime) but I must disable Handsfree Telephony service from window (https://ibb.co/VSDTXnh), and this not only made microphone on Bluetooth headset not work but also made my softphone can't find recording device. If I enable Handsfree Telephony service, rfcomm socket will could't connect to handsfree telephony service. – Viète Jun 15 '22 at 02:46
  • It throw error: "Could not connect to service Only one usage of each socket address (protocol/network address/port) is normally permitted. Only one usage of each socket address (protocol/network address/port) is normally permitted." – Viète Jun 15 '22 at 02:49
  • It apears because you paired your device from Windows UI. It installs all the services. You should pair it from the app using BluetoothAuthenticateDeviceEx or similar. (Do not forget to disable Authentication Agent, otherwise pairing will be handled by the system). After that you have to install required services (HandsFree one) by using BluetoothSetServiceState for Hands Free Audio so the system installs only required service without touching control channel. Next you have to connect to control channel and follow the HFP protocol answer on all initialization commands. – Mike Petrichenko Jun 15 '22 at 07:12
  • How to I can disable Authentication Agent? I don't see it in BlutoothAPI of WinAPI – Viète Jun 15 '22 at 08:23
  • There is no API. However there is undocummented method. Unfortunately I can not share that information. Try to find the way by yourself. – Mike Petrichenko Jun 15 '22 at 08:37
  • Does your btframework have this? – Viète Jun 15 '22 at 08:55
  • Yes it includes all the things. – Mike Petrichenko Jun 15 '22 at 09:29
  • I tried with your framework demo, but recording devices on window still not display my device (https://ibb.co/GVXVNkr) ? – Viète Jun 15 '22 at 10:11
  • As I wrote you have to install device for HFP service. – Mike Petrichenko Jun 15 '22 at 12:43
  • I am preparing the simple demo app. It may take some time so I'll let you know when finish. – Mike Petrichenko Jun 15 '22 at 13:08
  • Here I created a very simple demo that shows how to connect to HandsFree device with Audio and control channel: https://github.com/btframework/HandsFreeConnect – Mike Petrichenko Jun 15 '22 at 20:49
  • Thanks @MikePetrichenko, it can connect to my device (ColumnHeader: true, Connected: true), but it throw this error: https://ibb.co/JyR6HLY – Viète Jun 16 '22 at 03:10
  • Make sure that device is completely removed before connecting. – Mike Petrichenko Jun 16 '22 at 04:11
  • I surely removed it before connecting. I use "Remove device" button to remove (https://ibb.co/cwmz63j). Is there any place that I haven't removed yet? – Viète Jun 16 '22 at 04:20
  • Then there are 2 possible problem with your device: 1. There is some third party driver/app installed on your PC that handles the connection. 2. Your device should use other than HFP service. I tested with Jabra BT2045 – Mike Petrichenko Jun 16 '22 at 04:25
  • It also get similar error with Galaxy Buds Pro, but this err don't happend on RFCOMM client demo – Viète Jun 16 '22 at 06:28
  • It looks like your system hooks control channel instead of leaving it not connected. I'll look for other solution. Better if you contact our support by e-mail or other way instead of discussing all the things here. – Mike Petrichenko Jun 16 '22 at 06:58

0 Answers0