Call event notifications

7 views
Skip to first unread message

Grégory Brusick

unread,
Apr 11, 2024, 9:52:07 AMApr 11
to btstack-dev
Hello,

I am developing on a esp32 device and want to pair to a phone and get call event notifications (ringing, on call, hangup)
I managed to have it working based on the hfp_hf_demo. I get all the information I want, but I would like to have only the event and not appear on the phone as an audio device, because the device is not audio capable and also because the phone switches the audio to the device when it reconnects during a call and it is rather annoying to have to set the. correct output again.

When not connected to the phone, I try reconnecting using hfp_hf_establish_service_level_connection().
I never try to establish an audio connection.
And I also issue a hfp_hf_release_audio_connection() call as soon as I get a HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED just in case.

I tried other gap device classes without much success I also reduced the supported features to only
uint16_t hf_supported_features          =
        (1<<HFP_HFSF_CLI_PRESENTATION_CAPABILITY) |
        (1<<HFP_HFSF_HF_INDICATORS)         |
      (1<<HFP_HFSF_ENHANCED_CALL_STATUS);

Thats pretty much all I changed from the demo.

I also tried putting the device type as speaker on the phone instead of headset to tell it that it is not suited for calls, but without success.

Is there something I'm doing wrong here?
Or maybe there is something more suited to do what I want than the HFP profile?

Best

Gregory

Matthias Ringwald

unread,
Apr 12, 2024, 1:52:45 PMApr 12
to btsta...@googlegroups.com
Hi Gregory

Getting the call state without being a HFP HF device is tricky. There's no concept in HFP for a non-audio hands-free unit :)
if you stick to HFP, you can call hfp_hf_release_audio_connection upon HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED, which you've already found.
This would route the audio back to the phone. I don't think there's a better option with HFP.

On iOS, you might be able to use their Apple Notification Service, which might have partial information, e.g. incoming caller name.
https://developer.apple.com/library/archive/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Specification/Specification.html

Maybe Android has something similar.

The new LE Audio profiles provide call info independent from the audio via the Telephony Bearer Service, but so far, only Google Pixel 7a and newer support it, as well as a few other flagship phones.

Best regards
Matthias
> --
> You received this message because you are subscribed to the Google Groups "btstack-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to btstack-dev...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/btstack-dev/c9f125bf-25a9-4819-9c3e-74405f21922en%40googlegroups.com.

Grégory Brusick

unread,
Apr 13, 2024, 5:52:31 PMApr 13
to btstack-dev
Hi Matthias,

The hfp_hf_release_audio_connection trick is not working great for me. 
Mostly because of the actual audio headset that gets disconnected but not reconnected when it happens.

Thank you for the Apple suggestion, I will look into that for apple users.

Best

Gregory
Reply all
Reply to author
Forward
0 new messages