Search code examples
c++linuxbluetoothbluezhfp

How to implement HFP on linux with bluez?


I'd like to implement HFP on Linux. As far as I understand I need to first create SPP connection between my phone and a computer in order to exchange some setting. In BT specification, there is a spp service. is it this one what i need or do i have to use dbus? Can I use a serial communication to send the AT commands? I've read a lot of stuff at the internet and source code from git, but not sure how to approach the problem with the spp.


Solution

  • HFP in Linux is implemented as part oFono. You can refer ofono code for this. SPP and HFP use cases are different.

    Once install ofono, you can connect to mobile device to Linux machine then you can use below command to make call from your phone.

    dbus-send --system --print-reply --dest=org.ofono /hfp/org/bluez/hci0/dev_05_BA_8D_DF_B7_9C org.ofono.VoiceCallManager.Dial string:"1234567890" string:"default"