Commit Graph

2396 Commits

Author SHA1 Message Date
Tony Espy 201d34b0a1 idmap: use UL for bitshift literals
The current bitshift logic in idmap incorrectly uses
the literal 1 for the value to shift in idmap_alloc(),
idmap_take(), and idmap_alloc_next().  This causes the
resulting value to be an int instead of a long, which
results in the wrong bit being set once the number of
bits to shift operand exceeds sizeof(int).  Also
on some platforms, the behavior of the left bitshift
operator is undefined when this overflow occurs.
2014-03-05 08:49:50 -06:00
Slava Monich c2e58405ee include: Be more const-correct in ofono_dbus_* 2014-01-13 10:19:54 -06:00
Denis Kenzior d6af339c99 git: Fixup messed up permissions 2013-12-21 13:39:54 -06:00
Krzysztof Wilk 5c11e13019 siri: Add atom implementation 2013-12-18 00:07:47 -06: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 394069cb59 voicecall: Implement ofono_voicecall_mpty_hint 2013-09-12 13:17:39 -05:00
Denis Kenzior d7ba153737 smsutil: Make sure to return 1/0
So the value might be used directly for D-Bus property emission.
Otherwise D-Bus asserts and screws itself with:
ofonod[7427]: src/sms.c:handle_mwi()
process 7427: arguments to dbus_message_iter_append_basic() were
incorrect, assertion "*bool_p == 0 || *bool_p == 1" failed in file
../../dbus/dbus-message.c line 2549.
2013-09-03 22:58:59 -05:00
Vinicius Costa Gomes 8a11d38983 bluetooth: Add define for SCO voice settings
Add defines for SCO voice setting (Air Coding). Air mode "Transparent
Data" shall be supported if wide band speech is supported.
2013-08-19 12:14:39 -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
Lucas De Marchi 53a0fa8c7c common: Fix parsing SS control string
It's not possible to be both greater than '9' and less than '0'. This
would lead to accepting things like "#$33#" as activation and "*$33#" as
deactivation, even though the string makes no sense.
2013-05-22 21:40:19 -05:00
Lucas De Marchi 874a9ee285 stk: Fix sizeof on memcpy
src/stk.c: In function ‘__ofono_cbs_sim_download’:
src/stk.c:283:45: error: argument to ‘sizeof’ in ‘memcpy’ call is the
same expression as the source; did you mean to dereference it?
[-Werror=sizeof-pointer-memaccess]
  memcpy(&e.cbs_pp_download.page, msg, sizeof(msg));
                                               ^
2013-05-22 21:37:52 -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
Vinicius Costa Gomes c07a2fc24c hfp: Add defines for HFP SDP feature bits 2013-04-25 03:38:44 -05:00
Claudio Takahasi 9a3cfcd109 core: Add SetProperty for EchoCancelingNoiseReduction
This patch extends SetProperty method of the Handsfree interface
allowing to disable echo canceling and noise reduction feature in
the audio gateway through a D-Bus method call. Once disabled, it
is not allowed to enable it using this procedure.
2013-04-23 10:30:15 -05:00
Claudio Takahasi 275fe0df81 core: Set EchoCancelingNoiseReduction to TRUE by default
According to Bluetooth HFP spec: By default, if the AG supports its
own embedded echo canceling and/or noise reduction functions, it shall
have them activated until the AT+NREC command is received. The
configuration set by the HF shall by used by the AG while the Service
Level Connection is active.

Since there isn't a command to query the current value, it is being
assumed that Echo Canceling and Noise Reduction is enabled when the
connection is established and the gateway supports this feature.
2013-04-23 10:20:02 -05:00
Claudio Takahasi 6ef7d4fa88 core: Add EchoCancelingNoiseReduction to GetProperties
This patch adds EchoCancelingNoiseReduction property to GetProperties
method of Handsfree interface.
2013-04-23 10:19:35 -05:00
Claudio Takahasi 1b355c4232 core: Add "echo-canceling-and-noise-reduction"
This patch adds "echo-canceling-and-noise-reduction" to "Features"
property of the Handsfree interface.
2013-04-23 10:19:07 -05:00
Paulo Borges 2e9cb14e26 hfp: Move HFP versions definitions to hfp.h
hfp.h should store all HFP related definitions.
2013-04-18 08:43:21 -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
Paulo Borges 82909259c4 emulator: Change feature check to attend HFP 1.6
HFP 1.6 adds a new feature called Codec Negotitation. For the HF Role,
this feature is stored in bit 8 of the supported features
bitmap.

This patch changes the range of valid HF feature bitmaps to 2^8-1.
2013-04-15 07:23:28 -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
Denis Kenzior ad43b3d248 core: Include hfp.h 2013-04-09 14:33:41 -05:00
Denis Kenzior 2cdccd4e42 core: Add hfp.h
This will serve as a collection point for all HFP related definitions.
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
Forest Bond 0e0eb227f2 modem: Support modem property "AlwaysOnline"
This can be set by the modem driver to indicate that the device is
always in the online state when it is enabled.  This is useful for
modem drivers that handle both CDMA and GSM devices.
2013-04-01 21:41:58 -05:00
Forest Bond b0ad1ecb8f modem: Allow setting boolean properties 2013-03-28 09:47:32 -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
Vinicius Costa Gomes c735b26c06 ofono.conf: Punch hole for HandsfreeAudioAgent 2013-03-19 22:23:40 -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