Commit Graph

71 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz 94839129d9 hfp_hf_bluez5: Rework code handling device changes
This splits the handling of device changes and modem registration so
they can be uses separately.
2017-05-04 12:34:31 -05:00
Luiz Augusto von Dentz cc41a2a4c0 hfp_hf: Handle ServicesResolved signal
This adds handling for ServicesResolved signal which tells when BlueZ
is done resolving the device services so the code will no longer ignore
devices that got its services resolved after Paired signal.
2017-05-01 10:45:25 -05:00
Luiz Augusto von Dentz bf005f5599 hfp_hf: Fix not creating modem during NewConnection
In case the UUIDs are not updated, as they are still being resolved, when
Paired property changes a modem will never be registered.

In order to fix this problem allow modems to be registered directly
during NewConnection.
2017-05-01 10:45:25 -05:00
Simon Fels 5a7410e9e4 handsfree-audio: add type for our audio cards
When registering audio cards for the handsfree and gateway roles we
need a way for our users to differentiate between both to decide which
of them they start using for their purpose.
2015-10-05 11:46:30 -05:00
Kuba Pawlak 71df8bb15e hfp_hf_bluez5: Fix crash on re-pairing a Device
It may happen that a Device object is unpaired an paired again
without being removed from DBus. This in turn triggers second
modem object to be created, but not fully initialized.
If this modem object is used, oFono will crash.
2015-07-12 21:19:31 -05:00
Denis Kenzior 8d47f97106 hfp_hf_bluez5: Implement sco_connected_hint 2015-05-13 09:57:53 -05:00
Kuba Pawlak 8e6ebab83b hfp_ag_bluez5: use none prefix for AT+BCC.
iPhone 5s with iOS8.2 sometimes failes to acknowledge AT+BCC
with OK. This means +CIEV events get consumed by this command
and call ended notification is not parsed.

Nov 30 00:00:19 ofonod[938]: > AT+BCC\r
Nov 30 00:00:28 ofonod[938]: < \r\n+CIEV: 2,0\r\n
2015-03-24 09:12:58 -05:00
Denis Kenzior 017c1161d4 hfp_hf_bluez5: Use latest HFP version 2014-10-20 13:40:28 -05:00
Denis Kenzior 35feae07e5 hfp: Use proper prefix
Otherwise the BCS command can consume unsolicited notifications.

ofonod[3270]: < \r\n+BCS: 2\r\n
ofonod[3270]: > AT+BCS=2\r
ofonod[3270]: < \r\n+CIEV: 1,1\r\n
ofonod[3270]: < \r\n+CIEV: 2,0\r\n
ofonod[3270]: < \r\nOK\r\n
2014-05-21 12:08:37 -05:00
Denis Kenzior d6af339c99 git: Fixup messed up permissions 2013-12-21 13:39:54 -06:00
Krzysztof Wilk c8a3172c00 hfp_hf_bluez5: Enable Siri atom 2013-12-18 00:07:47 -06:00
Denis Kenzior 2158249069 hfp_hf_bluez5: Be more pedantic in get_version
If no 'Version' key is found we might be assigning an uninitialized
value.  Return an error in this case as the 'Version' key is required.
2013-10-01 11:35:27 -05:00
Denis Kenzior c49ed15a8f hfp_hf_bluez5: Add version debug info 2013-10-01 11:28:19 -05:00
Vinicius Costa Gomes ff16aed8bd handsfree-audio: Detect transparent SCO in kernel
Deferred SCO setup is not enough for HFP 1.6 wideband codec support.
Wideband speech also requires Transparent SCO to be enabled in the
kernel.
2013-09-12 13:17:40 -05:00
Denis Kenzior 62c2b81db7 hfp_hf_bluez5: Remove Cancel method 2013-09-12 13:17:40 -05:00
Denis Kenzior f2103a7ada hfp_hf_bluez5: Mark Release method as NOREPLY 2013-09-12 13:17:39 -05:00
Frederic Danis d6a601f8d1 hfp_hf_bluez5: Fix SDP record with correct features 2013-06-26 10:39:11 -05:00
Vinicius Costa Gomes 856a884052 hfp_hf_bluez5: Enable WB only with defer_setup
When setting the SDP features, only enable wideband speech support if
the kernel has defer setup for SCO.

It is possible that even if defer setup is supported the kernel is
not able to use Transparent Mode for SCO.
2013-04-25 17:51:59 -05:00
Denis Kenzior ff27e74eee Revert "hfp_hf_bluez5: UUIDs can change after Pairing"
This reverts commit 456b8c9723.
2013-04-25 17:47:05 -05:00
Vinicius Costa Gomes e1de3c7f2e hfp_hf_bluez5: Register the SDP record with correct features 2013-04-25 03:40:19 -05:00
Vinicius Costa Gomes 48cb2e5249 bluez5: Unify bt_register_profile_* into a single function
It was a cause of confusion for little gain to have separate
functions for registering profiles with extra information, for
example "role" and "features". We remove those helper functions
in favor of a single one with more parameters, "role" and
"feature" when NULL, will be ignored.
2013-04-25 03:38:11 -05:00
Vinicius Costa Gomes 456b8c9723 hfp_hf_bluez5: UUIDs can change after Pairing
For example, in the case of a remote-initiated pairing, the device may
be created and Paired first, then the UUID array is emitted later.
2013-04-18 08:37:17 -05:00
Vinicius Costa Gomes 4e7f0690e9 hfp_hf_bluez5: Watch for changes in the selected codec
This patch adds a function to monitor when the AG sends a new codec
before establishing the SCO connection.
2013-04-15 07:00:39 -05:00
Denis Kenzior 4610d3dad2 hfp_hf_bluez5: Include hfp.h 2013-04-09 14:33:41 -05:00
Denis Kenzior 3715103654 hfp_hf_bluez5: Remove redundant parentheses 2013-04-09 14:33:41 -05:00
Vinicius Costa Gomes 3697794f9e hfp_hf_bluez5: Add audio card .connect() for HFP 1.6 2013-04-09 14:33:41 -05:00
Vinicius Costa Gomes a36ffa872a hfp_hf_bluez5: Use 1.6 card driver 2013-04-05 12:25:10 -05:00
Claudio Takahasi dd24a39d2f hfp_hf_bluez5: Add extracting version
This patch parses and reads the profile "Version" that comes in the fd
dictionary of the NewConnection method. "Version" is input for Audio Card
registration.
2013-04-05 12:14:00 -05:00
Denis Kenzior 2f50d25ab5 hfp_hf_bluez5: Make sure to call the callback 2013-03-28 09:30:45 -05:00
Vinicius Costa Gomes 759cf25614 hfp_hf_bluez5: Add a card driver for HFP 1.6
This is just the skeleton of a Handsfree Audio Card for the HF side of
HFP 1.6.
2013-03-28 09:29:50 -05:00
Denis Kenzior afb4470558 hfp_hf_bluez5: Set remote and local information 2013-03-18 13:57:30 -05:00
Denis Kenzior 0f973d7150 hfp_hf_bluez5: Update to the new API 2013-03-18 13:42:46 -05:00
Claudio Takahasi b64357f690 hfp_hf_bluez5: Remove duplicated include 2013-03-12 13:03:42 -05:00
Claudio Takahasi e51f734881 hfp_hf_bluez5: Remove SCO handling
This patch moves the SCO socket handling from hfp_hf_bluez5 plugin.  It
will be instead handled by the handsfree-audio functionality. This is
the initial step to be able to support sending the file descriptor
through the Agent NewConnection method.
2013-03-04 16:16:24 -06:00
Claudio Takahasi 3b8d84d19d hfp_hf_bluez5: Use new bluetooth.h header 2013-03-04 16:13:31 -06:00
Paulo Borges 80212a3db2 bluez5: Move ref / unref handsfree audio
This commit moves the ref / unref to hfp_hf_bluez5 to make
bluez5 more generic and reusable.
2013-03-01 13:22:35 -06:00
Claudio Takahasi cf6137c187 hfp_hf_bluez5: Remove Card on RequestDisconnection
For local initiated disconnection the GAtChat disconnect callback is not
called. For this case, Audio Card remove function needs to be called.
2013-02-28 10:11:05 -06:00
Claudio Takahasi bff9432007 hfp_hf_bluez5: Remove Card when modem is disabled 2013-02-28 10:10:54 -06:00
Claudio Takahasi 134b237344 hfp_hf_bluez5: Remove Card if SLC is disconnected
This patch removes previous registered Audio Card when the remote
Bluetooth device triggers the service level disconnection.
2013-02-28 10:10:41 -06:00
Claudio Takahasi 1ee6c6ea09 hfp_hf_bluez5: Remove Card when SLC fails
This patch removes the previously created Audio Card if the service
level negotiation fails.
2013-02-28 10:10:30 -06:00
Claudio Takahasi fb9b54bc2c hfp_hf_bluez5: Add local address to Audio Card 2013-02-28 10:10:13 -06:00
Claudio Takahasi 4ef4d620e4 hfp_hf_bluez5: Add registering Audio Card
This patch registers the Handsfree Audio Card when the service level
connection is established.
2013-02-28 10:09:33 -06:00
Claudio Takahasi f765427b22 hfp_hf_bluez5: Send HFP version when registering 2013-02-20 21:36:49 -06:00
Claudio Takahasi 8a1cd911d8 hfp_hf_bluez5: Add local HFP version tracking
Fallback to HFP 1.5 if defer setup is not supported since it is not
possible to proceed with codec negotiation.
2013-02-20 21:31:04 -06:00
Denis Kenzior 7ba9521f10 hfp_hf_bluez5: Ensure active SLC for SCO links
Whenever a SCO connection is attempted, ensure that the SLC link is
already active between us and the same remote peer.
2013-02-14 08:47:10 -06:00
Denis Kenzior 83b43c8abd hfp_hf_bluez5: Remove use of hash table
The number of paired devices is quite small, so the use of the hash
table for lookup seems unnecessary.  The typical user will have no more
than 1-2 devices paired, maybe half a dozen in a less common case.
2013-02-14 08:47:10 -06:00
Denis Kenzior 825feb8cd5 hfp_hf_bluez5: Use faster method of disable() 2013-02-14 08:47:10 -06:00
Claudio Takahasi 39f1480155 hfp_hf_bluez5: Remove unneeded modem hash lookup
Modem object is created when the Device Proxy is added, and it is
paired. Another path is when the Device "Paired" property changes
to True.
2013-02-14 08:47:10 -06:00
Denis Kenzior 4394a362eb hfp_hf_bluez5: Use some tricks to optimize code 2013-02-14 08:47:10 -06:00
Vinicius Costa Gomes 233b1ecca4 hfp_hf_bluez5: Add support for Enabling/Disabling the modem
Now that we have the support for sending the correct messages
to BlueZ, we are able to dynamically power up/down the HFP modem.

We add another property to the modem to be able to get the D-Bus
object path that represents the remote device.
2013-02-14 08:47:10 -06:00