My Bluetooth and OBD quest continues: Today I figured out how the bluez API works to connect to my OBD adapter as well as what protocol it speaks and how to open a socket to it. It seems like it isnāt actually using BLE characteristics, but instead just a profile, that I need to implement myself. In this case it uses the Serial Port Protocol, which just implements a Serial Port over Bluetooth.
To be able to connect to that you need to inherit the BluezQt::Profile class (if you are using kf5bluezqt) and register that profile with the agent using the manager. Of course UUID and ports have to match. Then your profileās newConnection()
function is called every time a BT device is connected to, which supports that profile. To this function a file descriptor is passed, which you can convert to a QLocalSocket, which basically provides the same functionality as the QtConnectivity QBluetooth socket.
With this I managed to connect to the dongle using my laptop and should be able to port OBDFish to it (once I have the SDK properly setup on my laptop since I am not at home). This means I donāt really need a kf5bluezqt update, although I do intend to PR one if I have the time after the meeting.
I made a minimal desktop example, which you can find here: https://github.com/deepbluev7/nicobd/tree/profile-example
Maybe someone will find that useful, the docs for the Bluez API donāt really help that much tbh, if you have no idea, what you should be doing.