Commit Graph

58 Commits

Author SHA1 Message Date
Luiz Augusto von Dentz 27afa421cf handsfree-audio: Add Acquire implementation
This adds Acquire method which can be used by agents that require
pulling the fd directly instead of waiting a NewConnection.
2017-05-04 12:34:31 -05:00
Denis Kenzior 80a71f32cd handsfree-audio: Fix crash
For HFP 1.5 devices the driver is always set to NULL.  So if the AG
establishes the SCO connection first, we might crash.
2016-08-23 20:34:52 -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
Denis Kenzior fdba39b8ed handsfree-audio: Call sco_connected_hint 2015-05-13 09:57:52 -05:00
Denis Kenzior 1c2987670d handsfree-audio: Add additional debugs 2015-05-13 09:57:52 -05:00
Tommi Kenakkala 04218d3a86 handsfree-audio: Refactor manager init / cleanup 2015-02-02 09:28:34 -06:00
Marcel Holtmann 8ebb17977b handsfree-audio: Fix broken coding style in switch statement 2014-09-20 16:13:45 +02:00
Vinicius Costa Gomes 51982e7b13 handsfree-audio: Don't listen() if no defer_setup
As we won't allow any card to be registered when the kernel doesn't
support defer_setup, we don't need to have the listening SCO socket
open in this case.
2013-09-12 13:17:40 -05:00
Vinicius Costa Gomes 6d08a47ec3 handsfree-audio: Don't register if no defer_setup
If the kernel doesn't support defer_setup for SCO, we shouldn't allow
cards to be registered, because in that case we won't be able to
properly send the file descriptor to the Agent.
2013-09-12 13:17:40 -05:00
Vinicius Costa Gomes e84bd27b99 handsfree-audio: Set socket parameters
In the AG case, the voice setting needs to be set before we can
use Transparent SCO mode, which is necessary for Wideband speech
support.
2013-09-12 13:17:40 -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 e574d44d00 handsfree-audio: Tweak logic a bit 2013-09-12 13:17:40 -05:00
Vinicius Costa Gomes 0de0f496cb handsfree-audio: Add setting SCO air mode 2013-09-12 13:17:40 -05:00
Denis Kenzior 9e112379b5 handsfree-audio: Make sure to reset has_wideband
When Agent is unregistered we do not know whether the wideband speech is
supported.  Default to false.
2013-08-07 16:37:23 -05:00
Vinicius Costa Gomes 8caf91bf0f handsfree-audio: Fix replying to an empty D-Bus message
In the case that ofono_handsfree_card_connect_sco() is called outside the
context of a .Connect() call, there's no message we need to reply.  This
happens, for example, when the HFP AG plugin initiates a SCO connection when
it receives an AT+BCC command from the HF.
2013-05-03 11:31:44 -05:00
Vinicius Costa Gomes 4b067e6ffa handsfree-audio: Implement ofono_handsfree_audio_has_defer_setup() 2013-04-25 17:51:15 -05:00
João Paulo Rechi Vita a2d0f434fa handsfree-audio: Add debug logging
Print debug messages when Handsfree Audio Agent registers or unregisters
itself.
2013-04-16 14:20:40 -05:00
Vinicius Costa Gomes 600539ed2a handsfree-audio: Toggle wideband support when the agent registers
Each time an agent registers itself, we check if we support deferred
setup and if the agent has mSBC as a codec, if both checks are true,
we enable wideband speech support.
2013-04-15 07:08:26 -05:00
Vinicius Costa Gomes 12df4fca94 handsfree-audio: Keep track whether defer_setup is enabled
'defer_setup' will be one of the inputs when enabling or disabling
support for wideband speech codecs, we will only enable wideband
speech support if the kernel supports deferred setup.

So, we have to have this information available, in this case it means
a global variable.
2013-04-15 07:07:23 -05:00
Claudio Takahasi f65070b377 handsfree-audio: Send the selected codec
This patch removes the hard-coded CVSD codec, and adds the selected
codec in the NewConnection method call, notifying the agent the codec
previously selected for the audio connection.
2013-04-15 07:01:59 -05:00
Vinicius Costa Gomes 9ef5953a56 handsfree-audio: Implement ofono_handsfree_card_set_codec() 2013-04-15 06:58:03 -05:00
Denis Kenzior e130f22715 handsfree-audio: Move codec enums to hfp.h 2013-04-09 14:33:41 -05:00
Vinicius Costa Gomes b2273d313f handsfree-audio: Remove unused 'codecs' field from agent
Now that we only keep track whether we support wideband speech or not, we
don't have to keep track of the list of codecs supported by the Agent.
2013-04-09 14:33:41 -05:00
Vinicius Costa Gomes 1c51856434 handsfree-audio: Implement ofono_handsfree_audio_has_wideband 2013-04-09 14:33:41 -05:00
Vinicius Costa Gomes 9dd7bb365f handsfree-audio: Add .Connect using the card driver
Now each handsfree implementation may be notified that a card wants
its audio to be connected.
2013-03-28 09:34:39 -05:00
Vinicius Costa Gomes 4f02f03abb handsfree-audio: Add ofono_handsfree_card_connect_sco 2013-03-28 09:34:03 -05:00
Vinicius Costa Gomes 798ff5887b handsfree-audio: Reject .Connect() from other senders
Only the agent should be able to call .Connect() on the card.
2013-03-26 23:24:18 -05:00
Vinicius Costa Gomes cc5a86f1db handsfree-audio: Add support for sending the SCO socket
Send the SCO socket to the agent associated with the card that
just got connected.
2013-03-26 23:23:58 -05:00
Vinicius Costa Gomes c3cd427ee8 handsfree-audio: Add support for initiating SCO connections
When calling the card's .Connect() method, we should be able to
establish a SCO connection.

Right now, we only have support for establishing the SCO connection
directly, this is what is expected from HFP 1.5 HF/AG devices.
2013-03-26 23:23:39 -05:00
Denis Kenzior 32ea0c683a handsfree_audio: Call driver remove() on removal 2013-03-18 14:06:56 -05:00
Claudio Takahasi 5d0ba72d04 core: Add bt_str2ba() to bluetooth.h
This patch adds a utility Bluetooth function to convert Bluetooth
address from string to bdaddr_t.
2013-03-18 14:00:15 -05:00
Denis Kenzior c86fcc3a70 handsfree-audio: Match new card API 2013-03-18 13:42:46 -05:00
Denis Kenzior f54ced9992 handsfree-audio: Implement get/set data 2013-03-18 13:42:46 -05:00
Denis Kenzior d081e3d5ea handsfree-audio: Add card driver registration 2013-03-18 13:42:46 -05:00
Claudio Takahasi 241e3ca74c handsfree-audio: Reject SCO if agent is unavailable
This patch rejects the incoming SCO connection if there isn't a
Handsfree Audio Agent registered.
2013-03-04 16:41:51 -06:00
Claudio Takahasi a6874a64b2 handsfree-audio: Reject SCO if Card is not ready
The Audio Card is being created when the NewConnection from BlueZ
Profile is received, and registered when the service level connection
negotiation finishes. This patch rejects SCO connection if the SCO
incoming connection arrives when the service level negotiation is
ongoing.
2013-03-04 16:41:51 -06:00
Claudio Takahasi 2c4015278d handsfree-audio: Check local SCO address
This patch verifies if the local Bluetooth address of the incoming
connection also matches with one of available audio cards.
2013-03-04 16:41:51 -06:00
Claudio Takahasi 4a6ecaf28b handsfree-audio: Add NewConnection
This patch adds Agent NewConnection call. The card object path, the SCO
file descriptor, and the codec are being passed to the agent. This
initial version supports CVSD codec only.
2013-03-04 16:41:51 -06:00
Claudio Takahasi 9504427173 handsfree-audio: Add SCO handling
Unlike the previous implementation in the plugin, the SCO/SLC matching
is done based on the Audio Card objects.

Audio Cards are created when the RFCOMM fd descriptor is received, and
registered when the service level connetion is established.
2013-03-04 16:39:53 -06:00
Claudio Takahasi 4fcd084859 handsfree-audio: Check CVSD when registering agent
This patch makes CVSD codec mandatory when registering a Handsfree
Audio Agent.
2013-03-01 13:32:11 -06:00
Denis Kenzior c7a3f3990a handsfree-audio: properly increment next_card_id 2013-02-26 15:47:08 -06:00
Denis Kenzior ff2d68f2eb handsfree-audio: Impelement CardRemoved signal 2013-02-26 14:14:46 -06:00
Denis Kenzior dfacb14968 handsfree-audio: Implement CardAdded signal 2013-02-26 14:14:46 -06:00
Denis Kenzior b76bb56dae handsfree-audio: Implement the GetCards method 2013-02-26 14:14:46 -06:00
Denis Kenzior 1c75912380 handsfree-audio: Implement card GetProperties 2013-02-26 14:14:46 -06:00
Denis Kenzior 44281e53a9 handsfree-audio: Unregister from DBus on removal 2013-02-26 14:14:46 -06:00
Denis Kenzior f3a7069c47 handsfree-audio: Add skeleton D-Bus registration
For HandsfreeAudioCard objects
2013-02-26 14:14:46 -06:00
Denis Kenzior b179adf879 handsfree-audio: Don't hardcode '/' path
Use OFONO_MANAGER_PATH instead
2013-02-26 14:14:46 -06:00
Denis Kenzior dfeb91fc08 handsfree-audio: Implement card create / remove 2013-02-26 11:09:48 -06:00
Denis Kenzior 951e03dfea handsfree-audio: Add ref / unref support 2013-02-21 08:27:55 -06:00