Hi,
> I would like to trigger an action when someone presses the call button on a
> Bluetooth headset.
Not really possible at the moment.
The call button typically acts as a multi-function button on a HFP headset,
meaning that depending on the context the headset is in it may generate
different events (AT commands sent to the phone).
E.g. when a call is ongoing pressing the button might generate an AT command to
hang up the call, while when there is no call ongoing a press (or a double
press) might generate an AT command to dial the last called number again. It's
implementation dependent even if there are strong similarities between headsets.
In BlueZ 4 those AT commands are handled by the bluetooth daemon and while you
can observe the effects of the commands (such as a call being terminated)
bluetooth daemon doesn't explicitly inform other processes it has received an
AT command for processing.
HSP is a much simpler profile which defines only one AT command the device can
send, which is why bluetoothd sends a D-Bus signal. However note that if you
monitor BlueZ D-Bus signal directly you'll risk your app breaking eventually
(BlueZ 5 does not have that signal any more). Also as you noticed for a dual
(HFP+HSP) headset the default is to use HFP which has many more features and is
thus better for the normal voicecall use case.
What you can observe directly in your app are input events generated by media
key (play/pause/etc) presses, if your headset has those. I'll leave it to
someone who knows QML better than me to comment how exactly to do that.
BR,
H.
___
SailfishOS.org Devel mailing list
To unsubscribe, please send a mail to devel-unsubscr...@lists.sailfishos.org