Commit Graph

6937 Commits

Author SHA1 Message Date
Vinicius Costa Gomes 3a3e31eef2 hfp_hf_bluez5: Add SLC establishment procedure
When receiving a NewConnection call from BlueZ, initiates the Service
Level Connection using the received file descriptor. The HFP modem
sub-components (devinfo, voicecall, netreg, handsfree and callvolume)
are created at this point.
2013-01-23 17:28:16 -06:00
Vinicius Costa Gomes a90f0441d6 hfp_hf_bluez5: Handle NewConnection from BlueZ
Parse the essential arguments in the message, in this case only the
file descriptor, and register the modem if it is not already
registered. This is necessary because in some cases, we may receive a
NewConnection call, and the SDP process is still taking place.
2013-01-23 14:19:53 -06:00
Vinicius Costa Gomes 71986b67a3 hfp_hf_bluez5: Follow HFP AG device Alias property
If the device Alias property changes we should also change the name of
the modem.
2013-01-23 14:18:18 -06:00
Vinicius Costa Gomes 67cdf33fe8 hfp_hf_bluez5: Register modem for HFP AG devices
Now that we are able to keep track of devices appearing and
disappearing from BlueZ, we are able to register the modem when a
device that supports the HFP AG UUID appears.
2013-01-23 14:16:54 -06:00
Vinicius Costa Gomes 609f194309 bluez5: Add HFP_AG_UUID 2013-01-23 14:16:38 -06:00
Vinicius Costa Gomes 0de672ca78 hfp_hf_bluez5: Add tracking of bluetooth devices
This patch tracks the GDBusProxy for Bluetooth devices in order to be
able to get their properties.
2013-01-23 14:13:37 -06:00
Vinicius Costa Gomes 63cd9a740a hfp_hf_bluez5: Initial GDBusClient for BlueZ
This patch adds the initial callbacks to track when BlueZ connects so
we can register our HFP external profile handler. And tracks the
interfaces added or removed.
2013-01-23 14:13:37 -06:00
Vinicius Costa Gomes cdd99c3d5f bluez5: Add additional defines 2013-01-23 14:13:34 -06:00
Denis Kenzior b262aefe56 bluez5: Fix copy paste error 2013-01-23 13:02:05 -06:00
Denis Kenzior 2fa7a4a66e netreg: Fix broken CMER behavior on MBM 2013-01-21 10:23:34 -06:00
Denis Kenzior 1103f8ae08 mbm: Delay init until EMRDY
If we send these commands before the EMRDY notification has been seen,
they will simply return an error.
2013-01-21 10:22:45 -06:00
Denis Kenzior b9782fedfc hfpmodem: Add comment for previous commit 2013-01-21 09:41:54 -06:00
Mikel Astiz 843bd71169 hfpmodem: Fix release-and-swap without +CIEV
Some phones do not send the corresponding call state update (+CIEV)
after a successful release-and-swap operation (AT+CHLD=1).

This has been observed with a Nokia 500, while testing ReleaseAndSwap()
while an active and a held call exist:

ofonod[20414]: > AT+CLCC\r
ofonod[20414]: < \r\n+CLCC: 1,0,1,0,0,"<number1>",145\r\n
ofonod[20414]: < \r\n+CLCC: 2,0,0,0,0,"<number2>",145\r\n
ofonod[20414]: < \r\nOK\r\n
ofonod[20414]: > AT+CHLD=1\r
ofonod[20414]: < \r\nOK\r\n

After this, no +CIEV is received, but the call has been hung up.

The proposed approach to solve this consists of using AT+CLCC, unless
a call release has been received within a specific time period.

The result fixes the problem as can be seen below:

ofonod[20847]: < \r\n+CLCC: 1,0,1,0,0,"<number1>",145\r\n
ofonod[20847]: < \r\n+CLCC: 2,0,0,0,0,"<number2>",145\r\n
ofonod[20847]: < \r\nOK\r\n
ofonod[20847]: > AT+CHLD=1\r
ofonod[20847]: < \r\nOK\r\n
ofonod[20847]: > AT+CLCC\r
ofonod[20847]: < \r\n+CLCC: 1,0,0,0,0,"<number1>",145\r\n
ofonod[20847]: < \r\nOK\r\n
ofonod[20847]: < \r\n+CIEV: 5,2\r\n
ofonod[20847]: < \r\n+CIEV: 5,0\r\n
2013-01-21 09:41:54 -06:00
Mikel Astiz cbb784e734 hfpmodem: Avoid transitional voicecall states
While processing the result of AT+CLCC, process the differences in a way
that disconnections are reported first, then call state changes and
finally new calls.

The goal is to avoid unnecessary transitional states such as two active
calls existing at the same time.
2013-01-21 09:41:54 -06:00
Mikel Astiz 9726e50d82 hfpmodem: Refactor voicecall notify with foreach
Define a helper function in order to use foreach statements when
ofono_voicecall_notify() needs to be called.
2013-01-21 09:41:54 -06:00
Marcel Holtmann abb54f4aa5 gdbus: Check for valid path before handling properties 2013-01-20 18:45:56 -08:00
Vinicius Costa Gomes a419432c0f hfpmodem: Add support for sending the supported codecs
Right now, only the mandatory CVSD codec is supported. The mSBC
mandatory codec is "temporarily" not supported.

The spec alows this, HFP 1.6 Spec Section 4.34.1 page 92: "If wide band
speech is supported then the mandatory codec (mSBC) shall be included
unless it is temporarily unavailable."
2013-01-17 11:21:16 -06:00
Vinicius Costa Gomes f09a57d799 hfpmodem: Add version defines for HFP 1.6 2013-01-17 11:21:16 -06:00
Denis Kenzior b68365313b AUTHORS: Mention Claudio's contributions 2013-01-17 11:21:16 -06:00
Lucas De Marchi c6f52d7545 build: Use AM_CPPFLAGS instead of INCLUDES
Makefile.am:518: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
2013-01-16 13:16:51 -08:00
Lucas De Marchi 41a72a874a build: Do not use deprecated AM_CONFIG_HEADER
The long-obsoleted AM_CONFIG_HEADER macro was removed in automake 1.13.
Use AC_CONFIG_HEADERS instead.
2013-01-16 13:15:02 -08:00
Lucas De Marchi e1d5dfe3ae storage: Include sys/types.h for ssize_t
src/storage.h:32:1: error: unknown type name 'ssize_t'
src/storage.h:36:1: error: unknown type name 'ssize_t'
2013-01-16 13:14:30 -08:00
Claudio Takahasi 544726eb2e hfp_hf_bluez5: Add BlueZ Profile handler
This patch declares the external HFP Profile handler. It contains the
initial implementation of the D-Bus Profile1 interface and methods
responsible for handling Bluetooth connections.
2013-01-16 13:59:52 -06:00
Claudio Takahasi 8be7fa050d bluez5: Add a couple of defines 2013-01-16 13:58:55 -06:00
Claudio Takahasi f95fbc72a1 hfp_hf_bluez5: Add initial skeleton implementation 2013-01-16 13:54:03 -06:00
Claudio Takahasi 9fb87705c2 bluetooth: Add profile register / unregister
Adds utility API to handle BlueZ 5 RegisterProfile and UnregisterProfile
methods.
2013-01-16 13:54:00 -06:00
Claudio Takahasi 2b7d96a223 hfp_hf: Add initial file for external HFP
This patch adds the initial file to support external HFP profile and
BlueZ 5. "hfp_hf_bluez5" plugin will implement an external Bluetooth
profile compatible with BlueZ 5, and "hfp_hf_bluez4" plugin will keep
the compatibility with BlueZ 4.
2013-01-16 13:43:06 -06:00
Claudio Takahasi 0973479c29 bluetooth: Initial files for BlueZ 5
This patch adds the file for Bluetooth(BlueZ 5) oFono plugin.
2013-01-16 13:41:08 -06:00
Claudio Takahasi caad5322f6 bluetooth: Rename bluetooth plugins
As BlueZ 5 introduced backwards incompatible API changes, and we want to
keep support for BlueZ 4 based plugins for some time, we need to separate
the plugins that are based on BlueZ 4 from the ones based on BlueZ 5.

The bluetooth.c plugin has now been renamed to bluez4.c and the hfp_hf.c
plugin is renamed to hfp_hf_bluez4.  This will make it easy to add a
HFP HF plugin for BlueZ 5.
2013-01-16 13:37:23 -06:00
Claudio Takahasi 145112dad2 build: Add configure option for BlueZ 5 support
Going forward, BlueZ 5 will be supported by default.  BlueZ 4 support
will have to be explicitly enabled by using '--enable-bluez4'.

As before, the '--disable-bluetooth' configure option will disable all
bluetooth support (BlueZ 4 and BlueZ 5)
2013-01-16 13:34:22 -06:00
Denis Kenzior b67e68e753 sim: Fix whitespace violation 2013-01-15 12:16:08 -06:00
Denis Kenzior 8bd6b7c6c5 phonesim: Add support for SIM hotswap 2013-01-01 23:16:05 -06:00
Denis Kenzior 7fca6fca90 stk: Fix crash with Modem-Handled SIM Refresh 2013-01-01 21:40:14 -06:00
Denis Kenzior e744f9159d Revert "stk: Fix crash in SIM refresh handling"
This reverts commit dfd1fae50b.
2013-01-01 21:03:23 -06:00
Denis Kenzior 3e996d9e1f AUTHORS: Mention Forest's contributions 2012-12-30 20:37:44 -06:00
Forest Bond 11a3337a58 sierra: Initialize GSM error reporting separately 2012-12-30 20:35:58 -06:00
Forest Bond 2c91a4bb65 sierra: Create GPRS context in post_sim function
This matches the huawei plugin.
2012-12-30 20:35:53 -06:00
Anderson Lizardo 45bc35e534 gdbus: Fix memory leak on properties_set()
The pointer returned by dbus_message_iter_get_signature() must be freed
with dbus_free().

Fixes this memory leak:

==1857== 16 bytes in 1 blocks are definitely lost in loss record 104 of
251
==1857==    at 0x402BF52: realloc (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==1857==    by 0x415E286: dbus_realloc (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==1857==    by 0x415E70B: ??? (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==1857==    by 0x415F17B: ??? (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==1857==    by 0x414CB33: dbus_message_iter_get_signature (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==1857==    by 0x8053239: properties_set (object.c:899)
==1857==    by 0x5FFFFF: ???
==1857==
2013-01-06 14:49:03 -08:00
Marcel Holtmann 3143ea126e gdbus: Check signature of property value before calling setter 2013-01-05 00:45:35 -08:00
Lucas De Marchi a39520e1be gdbus: Don't include just added interfaces in GetManagedObjects
If we received a call to ObjectManager.GetManagedObject we should not
include in the response the interfaces in data->added. This is because
it's not guaranteed that those interfaces will trigger an
InterfacesAdded signal, which is the case if the interface is removed in
the same mainloop iteration.
2013-01-03 21:34:18 -08:00
Lucas De Marchi 7482480294 gdbus: Simplify generated introspection
The generated introspection is not supposed to be read as is by human,
so there's no point in printing the indentation or writing more code to
use auto-close tags.

If it's desired to read the raw xml file, user can always use other
tools to transform the output such as "xmllint --format".

This also fixes a missing </property> when property is deprecated.
2013-01-03 21:34:18 -08:00
Marcel Holtmann 7738e3a92c gdbus: Hold client reference during get name owner reply 2013-01-02 07:37:35 -08:00
Luiz Augusto von Dentz a559a4993b gdbus: Call check_signals when sending signals with g_dbus_send_message
If message passed to g_dbus_send_message is a signal verify if it is a
valid and there really exists an interface with respective signal name.
2012-12-30 10:49:27 -08:00
Luiz Augusto von Dentz 9ed7b17ca3 gdbus: Check if the interface being registered is valid
This prevent registering interfaces that are empty or have all members
marked as experiemental.
2012-12-30 10:49:27 -08:00
Luiz Augusto von Dentz 5f8485bcc1 gdbus: Introduce G_DBUS_PROPERTY_FLAG_EXPERIMENTAL
This flag can be used to mark properties as experimental, marked
properties are disabled by default and can be enabled by setting
G_DBUS_FLAG_ENABLE_EXPERIMENTAL using g_dbus_set_flags.
2012-12-30 10:49:27 -08:00
Luiz Augusto von Dentz 4b14fcc9a1 gdbus: Introduce G_DBUS_SIGNAL_FLAG_EXPERIMENTAL
This flag can be used to mark signals as experimental, marked
signals are disabled by default and can be enabled by setting
G_DBUS_FLAG_ENABLE_EXPERIMENTAL using g_dbus_set_flags.
2012-12-30 10:49:27 -08:00
Luiz Augusto von Dentz 4b50c0bd05 gdbus: Introduce G_DBUS_METHOD_FLAG_EXPERIMENTAL
This flag can be used to mark methods as experimental, marked
methods are disable by default and can be enabled by setting
G_DBUS_FLAG_ENABLE_EXPERIMENTAL using g_dbus_set_flags.
2012-12-30 10:49:27 -08:00
Marcel Holtmann 37a54d0433 gdbus: Include changed properties only once per signal 2012-12-30 00:58:59 -08:00
Marcel Holtmann 2f3da9cdf4 gdbus: Update properties on D-Bus client re-connections 2012-12-29 14:49:38 -08:00
Marcel Holtmann f9f6536b2b gdbus: Add function to manually refresh properties 2012-12-29 14:49:38 -08:00