Getting the caller-id through Bluetooth classic or BLE using one of the telephony profiles

I’m trying to figure out if it’s possible to create a nerves system that can act as a Bluetooth peripheral connected to a telephone, and be notified with the caller-id when there is an incoming telephone call.

Both Bluetooth classic and Bluetooth LE have facilities for this requirement. In Bluetooth classic, there is the Handsfree Profile (HFP). In this profile the audio streams and the control portion (accepting, denying, putting on hold) are tightly coupled.
In BLE there is a whole bundle of profiles (TMAS, TBS, CCP, etc.) that can be used to get to a full-fledged handsfree scenario. But you can also use a subset of these profiles, if you’re only interested in the control part and you’re not interested in routing the audio stream to your device. Your smartwatch can accept a call, while the audio gets routed from your phone to a set of earbuds.

This is just to say that there are profiles conveying the caller-id to a bluetooth connected device, both in Bluetooth classic and BLE.
Has anybody successfully integrated one of these telephony profiles on a nerves device before?

I know there is the blue_herron package that hooks into the HCI layer, bypassing BlueZ entirely. But in order to implement the TMAS profile in BLE, the nerves peripheral would need to implement both a GATT server and a GATT client. Currently only the GATT server role is supported (although it seems that the GATT client role is on the roadmap, according to the readme).

Another path to my goal could be to integrate with BlueZ on the nerves device. There was some discussion in this thread on how to integrate with D-Bus. But since the nerves device would need to be reactive to notifications, and set up a GATT server and GATT client, this doesn’t seem like an easy job.
Maybe there are ways to integrate with BlueZ and get the Bluetooth classic HFP profile to work. But I don’t know where to start there either.

I’m not a bluetooth expert by any means. I’m wading through layers and layers of specifications, and it took me a while to even get to this state where I can ask an intelligent question about it. I’m hoping that I’ve overlooked an easy way to achieve this goal. If so, please do share :slight_smile:

2 Likes