Commit Graph

6899 Commits

Author SHA1 Message Date
Frédéric Danis 3e9a836afd bluetooth: Rename HFP AG plugin
As BlueZ 5 introduced backwards incompatible API changes, and we want to
keep support for BlueZ 4 based HFP AG plugin for some time, we need to
separate HFP AG plugin which is based on BlueZ 4 from the one based on
BlueZ 5.

The hfp_ag.c plugin is renamed to hfp_ag_bluez4. This will make it easy
to add an HFP AG plugin for BlueZ 5.
2013-01-30 22:09:52 -06:00
Vinicius Costa Gomes 5b56668f1e hfp_hf_bluez5: Only register modems for Paired devices
When there are many devices around that support the HFP AG profile,
we may have a lot of modems that the user will never use.
2013-01-30 21:36:49 -06:00
Claudio Takahasi 5185980fb0 hfp_hf_bluez5: Improve Proxy property changed handling
This patch removes unnecessary GDBusProxy object access when property
changed is triggered. The property name and the argument iterator is
informed in the function callback.
2013-01-30 21:32:47 -06:00
Vinicius Costa Gomes 3a2046c073 TODO: Add task for supporting BlueZ 5 in dundee 2013-01-30 21:31:55 -06:00
Claudio Takahasi 9496fe8e70 hfp_hf_bluez5: Fix missing fd close
This patch fix an unusual scenario, service_level_connection() fails if
GIOChannel or GAtChat memory allocation fails.
2013-01-29 15:58:39 -06:00
Vinicius Costa Gomes b6f92d3074 hfp_hf_bluez5: Rename 'Address' to 'Remote'
Rename this property to better indicate that it is the remote Address
being referred to.
2013-01-29 15:57:48 -06:00
Claudio Takahasi 368b8816ee bluez5: Add RFCOMM socket address declaration
This patch adds a copy of Bluetooth RFCOMM socket declaration.
2013-01-29 09:03:55 -06:00
Claudio Takahasi 6985c798b2 bluez5: Add bt_bacmp()
Adds a copy of BlueZ bacmp() function.
2013-01-29 09:03:04 -06:00
Claudio Takahasi e8621fe8c2 bluez5: Add bt_ba2str()
Adds a copy of BlueZ ba2str() function.
2013-01-29 09:02:45 -06:00
Claudio Takahasi e05b3dfb4d hfp_hf_bluez5: Add SCO listen socket
This patch adds the initial SCO server socket handling. BtIO and BlueZ
functions should not be used, with the new Profile API the objetive is
to get rid of these dependencies.
2013-01-29 09:01:26 -06:00
Claudio Takahasi 5e84f78869 bluez5: Add bt_bacpy()
Adds a copy of BlueZ bacpy() function.
2013-01-29 08:40:33 -06:00
Claudio Takahasi a2376f6c77 bluez5: Add SCO socket declarations
Adds local copy of SCO Bluetooth sockets declarations, since the
objective to avoid including BlueZ library headers.
2013-01-29 08:39:31 -06:00
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