1

I am quite new to bluetooth development, but having fun learning it! So far I have worked on making a RPi4 into a central device, and have managed to implement discovery, connecting, monitoring, etc.

In the coming days I want to start working on a separate device for peripheral-central testing. Building up to this I am attempting to implement a few custom Bluez profiles. The ones I am trying to implement are: A2DP, HFP, and PBAP. So far, I am able to register the profiles on the Pi and can see them using bluetoothctl show and dbus-monitor --system.

The one I am having trouble with is A2DP. For HFP I have been using test-hfp as inspiration and for PBA I have been using pbaclient.py along with an override of the Bluez Profile methods. For A2DP it seems very difficult to find any documentation of how to write a custom profile. As of now, I've left it as a method override of the Bluez profile methods. With HFP, it was necessary to work with socket connection and client, I assume it is quite similar for A2DP, but where/how do I start? I assume I will also need to disable the inbuilt Pi profile Audio sink before registering my own A2DP, and remember I have read how to do this somewhere, but if anyone knows from the top of their head how to do this, feel free to help me out :)

On another note, I am placing the relevant .h and .c files in the same folder as where I am implementing the profile.py files, using the given .h and .c files found in bluez.5.58, but for HFP, I can only find a .c file in my bluez library. Can I use the .h file found in AlsaBluez or am I just missing the placement of the correct file?

Any tips and pointers on how to approach these issues and my method/efforts overall moving forward is greatly appreciated! :)

0 Answers0