platform/upstream/ofono.git
10 years agohfp: Add Voice Recognition flag to BRSF
Andrew Earl [Wed, 4 Dec 2013 14:36:13 +0000 (15:36 +0100)]
hfp: Add Voice Recognition flag to BRSF

10 years agohe910: tweak initialization logic
Denis Kenzior [Tue, 26 Nov 2013 22:25:48 +0000 (16:25 -0600)]
he910: tweak initialization logic

10 years agonetreg: Turn off CIEV indications other than rssi
Denis Kenzior [Tue, 26 Nov 2013 22:25:03 +0000 (16:25 -0600)]
netreg: Turn off CIEV indications other than rssi

10 years agoAUTHORS: Mention Slava's contributions
Denis Kenzior [Tue, 26 Nov 2013 21:33:08 +0000 (15:33 -0600)]
AUTHORS: Mention Slava's contributions

10 years agombpi: Provision mmsc and message_proxy
Slava Monich [Mon, 25 Nov 2013 22:00:41 +0000 (00:00 +0200)]
mbpi: Provision mmsc and message_proxy

10 years agohfp_ag_bluez5: Try to support non-phone hardware
Denis Kenzior [Mon, 25 Nov 2013 17:33:57 +0000 (11:33 -0600)]
hfp_ag_bluez5: Try to support non-phone hardware

For devices which are not 'real' phone modems, the voicecall
initialization can happen outside of the pre-sim state.  In this case
the voicecall atom detection logic fails.  Try to detect the voicecall
atom separately, and register the profile if the SIM atom is already
present and in state 'READY'.

For all other cases, the previous logic still applies.

10 years agoudevng: Add he910 detection logic
Denis Kenzior [Mon, 11 Nov 2013 22:01:51 +0000 (16:01 -0600)]
udevng: Add he910 detection logic

10 years agoplugins: Add initial Telit he910 driver
Denis Kenzior [Mon, 25 Nov 2013 16:54:51 +0000 (10:54 -0600)]
plugins: Add initial Telit he910 driver

10 years agobuild: Always build the connman plugin
Denis Kenzior [Fri, 22 Nov 2013 22:03:27 +0000 (16:03 -0600)]
build: Always build the connman plugin

It is not related to BLUEZ 4 support

10 years agogdbus: Fix trying to remove already removed sources
Bastien Nocera [Sat, 9 Nov 2013 17:02:57 +0000 (18:02 +0100)]
gdbus: Fix trying to remove already removed sources

When we return FALSE from idle handlers, the source is removed.
This will be causing warnings in glib 2.40.

See https://bugzilla.gnome.org/show_bug.cgi?id=710724

10 years agoRelease 1.13 1.13 upstream/1.13
Marcel Holtmann [Fri, 8 Nov 2013 08:34:09 +0000 (00:34 -0800)]
Release 1.13

10 years agombm: Fix segfault with hot-plugged MD300 modem
Denis Kenzior [Thu, 17 Oct 2013 20:24:56 +0000 (15:24 -0500)]
mbm: Fix segfault with hot-plugged MD300 modem

10 years agogdbus: Remove not needed check for NULL DBusPendingCall
Szymon Janc [Thu, 26 Sep 2013 08:02:35 +0000 (10:02 +0200)]
gdbus: Remove not needed check for NULL DBusPendingCall

It is now checked by g_dbus_send_message_with_reply() so there is no
need to double check that in caller.

10 years agogdbus: Check for NULL DBusPendingCall in g_dbus_send_message_with_reply
Szymon Janc [Thu, 26 Sep 2013 08:02:34 +0000 (10:02 +0200)]
gdbus: Check for NULL DBusPendingCall in g_dbus_send_message_with_reply

"Warning: if the connection is disconnected or you try to send Unix file
descriptors on a connection that does not support them, the
DBusPendingCall will be set to NULL, so be careful with this."

Check this in g_dbus_send_message_with_reply so that callers don't need
to double check for NULL if g_dbus_send_message_with_reply returned
TRUE.

This also fix crash if passing FD over D-Bus is blocked e.g. by SELinux
policy.

bluetoothd[1894]: profiles/audio/avdtp.c:session_cb()
bluetoothd[1894]: profiles/audio/avdtp.c:avdtp_parse_cmd() Received
    SET_CONFIGURATION_CMD
bluetoothd[1894]: profiles/audio/a2dp.c:endpoint_setconf_ind() Source
    0x6c5000: Set_Configuration_Ind
bluetoothd[1894]: profiles/audio/avdtp.c:avdtp_ref() 0x6df360: ref=1
bluetoothd[1894]: profiles/audio/a2dp.c:setup_ref() 0x6d32b0: ref=1
process 1894: arguments to dbus_pending_call_set_notify() were incorrect,
     assertion "pending != NULL" failed in file dbus-pending-call.c line
     636.
This is normally a bug in some application using the D-Bus library.

10 years agohfp_hf_bluez5: Be more pedantic in get_version
Denis Kenzior [Tue, 1 Oct 2013 16:35:27 +0000 (11:35 -0500)]
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.

10 years agohfp_hf_bluez5: Add version debug info
Denis Kenzior [Tue, 1 Oct 2013 16:28:19 +0000 (11:28 -0500)]
hfp_hf_bluez5: Add version debug info

10 years agohandsfree-audio: Don't listen() if no defer_setup
Vinicius Costa Gomes [Wed, 11 Sep 2013 00:09:44 +0000 (21:09 -0300)]
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.

10 years agohandsfree-audio: Don't register if no defer_setup
Vinicius Costa Gomes [Wed, 11 Sep 2013 00:09:43 +0000 (21:09 -0300)]
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.

10 years agohandsfree-audio: Set socket parameters
Vinicius Costa Gomes [Wed, 11 Sep 2013 00:09:42 +0000 (21:09 -0300)]
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.

10 years agohandsfree-audio: Detect transparent SCO in kernel
Vinicius Costa Gomes [Wed, 11 Sep 2013 00:09:41 +0000 (21:09 -0300)]
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.

10 years agohandsfree-audio: Tweak logic a bit
Denis Kenzior [Thu, 12 Sep 2013 18:07:33 +0000 (13:07 -0500)]
handsfree-audio: Tweak logic a bit

10 years agohandsfree-audio: Add setting SCO air mode
Vinicius Costa Gomes [Wed, 11 Sep 2013 00:09:40 +0000 (21:09 -0300)]
handsfree-audio: Add setting SCO air mode

10 years agohfp_hf_bluez5: Remove Cancel method
Denis Kenzior [Tue, 10 Sep 2013 16:26:22 +0000 (11:26 -0500)]
hfp_hf_bluez5: Remove Cancel method

10 years agohfp_hf_bluez5: Mark Release method as NOREPLY
Denis Kenzior [Tue, 10 Sep 2013 16:25:50 +0000 (11:25 -0500)]
hfp_hf_bluez5: Mark Release method as NOREPLY

10 years agotest: Add set-msisdn script
Denis Kenzior [Tue, 10 Sep 2013 16:01:55 +0000 (11:01 -0500)]
test: Add set-msisdn script

10 years agotest: Add display-icon script
Denis Kenzior [Tue, 10 Sep 2013 16:01:18 +0000 (11:01 -0500)]
test: Add display-icon script

10 years agohfpmodem: Call ofono_voicecall_mpty_hint as needed
Denis Kenzior [Tue, 10 Sep 2013 15:58:14 +0000 (10:58 -0500)]
hfpmodem: Call ofono_voicecall_mpty_hint as needed

10 years agoatmodem: Update parse_clcc utility function
Denis Kenzior [Tue, 10 Sep 2013 15:57:42 +0000 (10:57 -0500)]
atmodem: Update parse_clcc utility function

10 years agovoicecall: Implement ofono_voicecall_mpty_hint
Denis Kenzior [Tue, 10 Sep 2013 15:56:44 +0000 (10:56 -0500)]
voicecall: Implement ofono_voicecall_mpty_hint

10 years agoinclude: Add voicecall multiparty hint method
Denis Kenzior [Tue, 10 Sep 2013 15:54:05 +0000 (10:54 -0500)]
include: Add voicecall multiparty hint method

On protocols that support creation of multiparty calls outside of
oFono's control, we need a way to detect multiparty call transitions.
This method adds a way for the driver to hint the core which calls
should be part of the multiparty call.

Right now this is relevant only to HFP.  Real modem hardware should not
be using this method.

10 years agotest: Add selecting the modem in private-chat
Denis Kenzior [Tue, 10 Sep 2013 15:53:49 +0000 (10:53 -0500)]
test: Add selecting the modem in private-chat

10 years agotest: Add selecting the modem in create-multiparty
Denis Kenzior [Tue, 10 Sep 2013 15:53:17 +0000 (10:53 -0500)]
test: Add selecting the modem in create-multiparty

10 years agogdbus/client: Use g_dbus_add_properties_watch to track properties
Luiz Augusto von Dentz [Wed, 4 Sep 2013 18:57:20 +0000 (21:57 +0300)]
gdbus/client: Use g_dbus_add_properties_watch to track properties

This make the handling much simpler and avoids duplicates of the same
match rule.

10 years agogdbus/client: Use g_dbus_add_signal_watch to track signals
Luiz Augusto von Dentz [Mon, 2 Sep 2013 15:54:33 +0000 (18:54 +0300)]
gdbus/client: Use g_dbus_add_signal_watch to track signals

This make the handling much simpler and avoids duplicates of the same
match rule.

10 years agogdbus/client: Use g_dbus_add_service_watch to track services
Luiz Augusto von Dentz [Mon, 2 Sep 2013 13:02:05 +0000 (16:02 +0300)]
gdbus/client: Use g_dbus_add_service_watch to track services

This make the handling much simpler and avoids duplicates of the same
match rule.

10 years agogdbus/watch: Fix crash when disconnecting from D-Bus
Luiz Augusto von Dentz [Mon, 9 Sep 2013 08:25:12 +0000 (11:25 +0300)]
gdbus/watch: Fix crash when disconnecting from D-Bus

When disconnecting from D-Bus a message could be recieved with no sender:
Invalid read of size 1
   at 0x4A09EE1: strcmp (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x3B03C386B8: g_str_equal (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x4065D6: message_filter (watch.c:529)
   by 0x3B0700F9E5: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.4)
   by 0x4052E7: message_dispatch (mainloop.c:76)
   by 0x3B03C48962: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C47E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C48157: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C48559: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x4038C5: client_proxy_removed (test-gdbus-client.c:902)
   by 0x3B03C6B566: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
   by 0x3B03C6B6E5: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
 Address 0x0 is not stack'd, malloc'd or (recently) free'd

10 years agogdbus/watch: Fix aborting when removing D-Bus filter
Luiz Augusto von Dentz [Tue, 3 Sep 2013 15:00:35 +0000 (18:00 +0300)]
gdbus/watch: Fix aborting when removing D-Bus filter

In case of filter_data having a watch to a service name it may call
dbus_connection_remove_filter twice causing libdbus to abort:

process 24723: Attempt to remove filter function 0x4063e0 user data (nil), but no such filter has been added

To fix this the code will now only attempt to call
dbus_connection_remove_filter once in filter_data_free which is the
counterpart of filter_data_get where dbus_connection_add_filter is called.

10 years agogdbus/watch: Fix crash when g_dbus_remove_watch is called from connect callback
Luiz Augusto von Dentz [Mon, 2 Sep 2013 12:55:45 +0000 (15:55 +0300)]
gdbus/watch: Fix crash when g_dbus_remove_watch is called from connect callback

 at 0x40570C: update_service (watch.c:601)
 by 0x40584B: service_reply (watch.c:627)
 by 0x3B0700C511: ??? (in /usr/lib64/libdbus-1.so.3.7.4)
 by 0x3B0700F740: dbus_connection_dispatch (in /usr/lib64/libdbus-1.so.3.7.4)
 by 0x405167: message_dispatch (mainloop.c:76)
 by 0x3B03C48962: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
 by 0x3B03C47E05: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3600.3)
 by 0x3B03C48157: ??? (in /usr/lib64/libglib-2.0.so.0.3600.3)
 by 0x3B03C48559: g_main_loop_run (in /usr/lib64/libglib-2.0.so.0.3600.3)
Address 0x4c58a30 is 32 bytes inside a block of size 56 free'd
 at 0x4A074C4: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
 by 0x3B03C4D9AE: g_free (in /usr/lib64/libglib-2.0.so.0.3600.3)
 by 0x406102: filter_data_remove_callback (watch.c:378)
 by 0x405FC0: g_dbus_remove_watch (watch.c:798)
 by 0x40A22B: g_dbus_client_unref (client.c:1227)
 by 0x40570B: update_service (watch.c:599)
 by 0x40584B: service_reply (watch.c:627)

10 years agogdbus: Fix emitting PropertiesChanged twice
Luiz Augusto von Dentz [Mon, 19 Aug 2013 13:54:35 +0000 (16:54 +0300)]
gdbus: Fix emitting PropertiesChanged twice

This fixes double emission of PropertiesChanged introduced by flushing
changes, the flushing can happen during the pending processing so the
pending_prop flag needs to be updated in the beginning and the list of
properties can be freed before g_dbus_send_message as it is not required
anymore.

10 years agogdbus: Avoid calling dbus_connection_send*
Luiz Augusto von Dentz [Mon, 19 Aug 2013 13:05:15 +0000 (16:05 +0300)]
gdbus: Avoid calling dbus_connection_send*

dbus_connection_send* should not be called directly except by
g_dbus_send_message.

10 years agogdbus: Add g_dbus_send_message_with_reply
Luiz Augusto von Dentz [Mon, 19 Aug 2013 12:25:57 +0000 (15:25 +0300)]
gdbus: Add g_dbus_send_message_with_reply

g_dbus_send_message_with_reply flushes pending signals before calling
dbus_connection_send_with_reply so it does not alter the message order

10 years agogdbus: Fix sending ObjectManager/Properties signals out of order
Luiz Augusto von Dentz [Mon, 19 Aug 2013 11:39:28 +0000 (14:39 +0300)]
gdbus: Fix sending ObjectManager/Properties signals out of order

In some cases the order of the messages is altered when a message is
sent without processing the pending signals first, currently this affect
client_check_order unit test:

/gdbus/client_check_order: **
ERROR:unit/test-gdbus-client.c:795:property_check_order: assertion failed: (g_strcmp0(string, "value1") == 0)

As can be observed the value of the property is not yet updated because the
signal it is still pending, once this fix is applied the test pass:

/gdbus/client_check_order: OK

Note that the flushing only works when g_dbus_send_message is used so
places where dbus_connection_send and other variants are called directly
may still change the order.

10 years agosmsutil: Make sure to return 1/0
Denis Kenzior [Wed, 4 Sep 2013 03:58:59 +0000 (22:58 -0500)]
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.

10 years agotest-sms: Add skeleton code for MWI unit test
Denis Kenzior [Wed, 4 Sep 2013 03:58:40 +0000 (22:58 -0500)]
test-sms: Add skeleton code for MWI unit test

10 years agohfp: Set UDUB affected set to WAITING only
Denis Kenzior [Sun, 25 Aug 2013 06:25:28 +0000 (01:25 -0500)]
hfp: Set UDUB affected set to WAITING only

INCOMING calls are not affected by UDUB, only by +CHUP.

10 years agohfp: Fix up disconnect reason handling for +CHUP
Denis Kenzior [Sun, 25 Aug 2013 06:21:23 +0000 (01:21 -0500)]
hfp: Fix up disconnect reason handling for +CHUP

The affected call types for +CHUP were set to only ACTIVE calls.
Instead the affected set should include INCOMING, DIALING, ALERTING and
ACTIVE calls.

Thanks to Ionut Dediu for the diagnosing and reporting this issue.

10 years agobluetooth: Add define for SCO voice settings
Vinicius Costa Gomes [Fri, 16 Aug 2013 02:26:04 +0000 (23:26 -0300)]
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.

10 years agohandsfree-audio: Make sure to reset has_wideband
Denis Kenzior [Wed, 7 Aug 2013 21:37:23 +0000 (16:37 -0500)]
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.

10 years agoatmodem: Fix whitespace violation
Denis Kenzior [Mon, 22 Jul 2013 20:56:28 +0000 (15:56 -0500)]
atmodem: Fix whitespace violation

10 years agoSIMCOM: add a quirk to fix crsm request
Anthony Viallard [Fri, 19 Jul 2013 13:35:38 +0000 (15:35 +0200)]
SIMCOM: add a quirk to fix crsm request

10 years agoSIMCOM: add a quirk for signal strength reporting
Anthony Viallard [Fri, 19 Jul 2013 13:35:37 +0000 (15:35 +0200)]
SIMCOM: add a quirk for signal strength reporting

We must tell we want the signal strength reporting using
AT+AUTOCSQ command (ref. "SIM5215_SIM5216_ATC_V1.18.pdf - §10.7").

10 years agoSIMCOM: add a quirk for AT+CNMI command building
Anthony Viallard [Fri, 19 Jul 2013 13:35:36 +0000 (15:35 +0200)]
SIMCOM: add a quirk for AT+CNMI command building

Use mode=1 otherwise it fails (ref. "SIM5215_SIM5216_ATC_V1.18.pdf - §6.9")

10 years agobuild: Use dummy=yes assignment for pkg-config check
Marcel Holtmann [Fri, 19 Jul 2013 15:30:19 +0000 (08:30 -0700)]
build: Use dummy=yes assignment for pkg-config check

10 years agosim900: Use SIM900 quirk for gprs context
Jesper Larsen [Thu, 18 Jul 2013 07:49:58 +0000 (09:49 +0200)]
sim900: Use SIM900 quirk for gprs context

Use the module specific quirk for gprs by using the vendor entry
OFONO_VENDOR_SIMCOM_SIM900

10 years agoatmodem: Add gprs-context quirk for SIM900
Jesper Larsen [Thu, 18 Jul 2013 07:49:57 +0000 (09:49 +0200)]
atmodem: Add gprs-context quirk for SIM900

The SIM900 module from SIMCOM does have a AT+CGDATA command.
However, it is not possible to make a ppp connection when CGDATA
has been used to bring up the gprs context.

This patch adds a quirk that uses the alternative ATD*99***<cid>#
command instead.

10 years agoatmodem: Add vendor entry for SIM900 module
Jesper Larsen [Thu, 18 Jul 2013 07:49:56 +0000 (09:49 +0200)]
atmodem: Add vendor entry for SIM900 module

10 years agobuild: Build a simpler version of libgdbus-internal
Marcel Holtmann [Thu, 18 Jul 2013 15:04:22 +0000 (08:04 -0700)]
build: Build a simpler version of libgdbus-internal

10 years agobuild-sys: Use libgdbus-internal.la
Lucas De Marchi [Wed, 3 Jul 2013 12:49:36 +0000 (09:49 -0300)]
build-sys: Use libgdbus-internal.la

With the current approach if we have different CFLAGS for each binary we would
build gdbus several times for no reason.

Instead of prepending $(gdbus_sources) to several _SOURCES variable, use
a convenience library thas is used internally only, thus with a "-internal"
suffix.

10 years agosim900: Fix order of dlc prefixes
Jesper Larsen [Wed, 17 Jul 2013 07:14:15 +0000 (09:14 +0200)]
sim900: Fix order of dlc prefixes

The order of the defines for the dlc prefixes does not match
the order of the array containing the strings to print.

10 years agoAUTHORS: Mention Jesper's contributions
Denis Kenzior [Wed, 17 Jul 2013 15:19:58 +0000 (10:19 -0500)]
AUTHORS: Mention Jesper's contributions

10 years agosim900: Enable serial receiver
Jesper Larsen [Wed, 17 Jul 2013 07:14:13 +0000 (09:14 +0200)]
sim900: Enable serial receiver

The read option must be set to 'on' in order for two-way
communication with SIM900 module to work.

10 years agodundee: return error if there is a connection procedure ongoing
Gustavo Padovan [Mon, 24 Jun 2013 16:14:02 +0000 (17:14 +0100)]
dundee: return error if there is a connection procedure ongoing

10 years agohfp_hf_bluez5: Fix SDP record with correct features
Frederic Danis [Thu, 27 Jun 2013 12:45:58 +0000 (14:45 +0200)]
hfp_hf_bluez5: Fix SDP record with correct features

10 years agohfpmodem: Fix ECNR HF feature
Frederic Danis [Thu, 27 Jun 2013 12:45:57 +0000 (14:45 +0200)]
hfpmodem: Fix ECNR HF feature

10 years agogdbus: Remove proxies when client disconnects
Henrique Dante de Almeida [Mon, 27 May 2013 17:15:34 +0000 (14:15 -0300)]
gdbus: Remove proxies when client disconnects

Remove proxies and generate proxy_removed callbacks even when there are
no corresponding InterfaceRemoved signals.

This patch fixes having zombie gdbus proxy object when a server
disconnects without sending InterfaceRemoved signals. These objects
may interact with new server instances, for example, making
InterfaceAdded signals of new objects with the same name be filtered
out as duplicated, or staying allocated, but unused, if the new server
doesn't reuse the object paths. Note that as a side-effect, the
lifetime of a gdbus proxy becomes stricter: it lives at most for the
duration of a single connection to a single instance of a server
process.

11 years agocommon: Fix parsing SS control string
Lucas De Marchi [Wed, 22 May 2013 21:28:38 +0000 (18:28 -0300)]
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.

11 years agogitignore: Ignore file generated by Automake 1.13
Lucas De Marchi [Wed, 22 May 2013 23:01:48 +0000 (20:01 -0300)]
gitignore: Ignore file generated by Automake 1.13

Automake >= 1.13 enables parallel-tests option by default which uses a
test-driver script (copied by automake). Ignore this file and the files
generated by this script.

11 years agostk: Fix sizeof on memcpy
Lucas De Marchi [Wed, 22 May 2013 23:01:47 +0000 (20:01 -0300)]
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));
                                               ^

11 years agogdbus: Fix using NULL DBusPendingCall when disconnected from D-Bus
Anderson Lizardo [Sat, 4 May 2013 19:39:43 +0000 (15:39 -0400)]
gdbus: Fix using NULL DBusPendingCall when disconnected from D-Bus

From D-Bus documentation for dbus_connection_send_with_reply():

"Warning: if the connection is disconnected or you try to send Unix file
descriptors on a connection that does not support them, the
DBusPendingCall will be set to NULL, so be careful with this."

Fix these errors when killing D-Bus daemon with the client still
running:

process 5712: arguments to dbus_pending_call_set_notify() were
incorrect, assertion "pending != NULL" failed in file
../../dbus/dbus-pending-call.c line 596.
This is normally a bug in some application using the D-Bus library.
process 5712: arguments to dbus_pending_call_unref() were incorrect,
assertion "pending != NULL" failed in file
../../dbus/dbus-pending-call.c line 572.
This is normally a bug in some application using the D-Bus library.

11 years agogdbus: Fix segfault when D-Bus daemon exits
Anderson Lizardo [Sat, 4 May 2013 19:39:42 +0000 (15:39 -0400)]
gdbus: Fix segfault when D-Bus daemon exits

Fix this crash if D-Bus exits while the client is still connected to it:

==5570== Invalid read of size 1
==5570==    at 0x402D28E: strcmp (in
/usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==5570==    by 0x4070E22: g_str_equal (ghash.c:1704)
==5570==    by 0x8055F61: message_filter (client.c:1123)
==5570==    by 0x4141500: dbus_connection_dispatch (in
/lib/i386-linux-gnu/libdbus-1.so.3.5.8)
==5570==    by 0x80506F7: message_dispatch (mainloop.c:76)
==5570==    by 0x4081A7E: g_timeout_dispatch (gmain.c:3882)
==5570==    by 0x4080D85: g_main_context_dispatch (gmain.c:2539)
==5570==    by 0x4081124: g_main_context_iterate.isra.21 (gmain.c:3146)
==5570==    by 0x408156A: g_main_loop_run (gmain.c:3340)
==5570==    by 0x41BF4D2: (below main) (libc-start.c:226)
==5570==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5570==
==5570==

11 years agogdbus: Fix calling GetManagedObjects twice in a row
Luiz Augusto von Dentz [Thu, 18 Apr 2013 20:34:03 +0000 (23:34 +0300)]
gdbus: Fix calling GetManagedObjects twice in a row

Calling g_dbus_client_new followed by g_dbus_client_set_proxy_handlers
cause two calls to GetManagedObjects in a row as GetNameOwner reply is
asyncronously it triggers the second call because the handlers have
been set by g_dbus_client_set_proxy_handlers.

11 years agohandsfree-audio: Fix replying to an empty D-Bus message
Vinicius Costa Gomes [Fri, 3 May 2013 00:47:16 +0000 (21:47 -0300)]
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.

11 years agohfp_hf_bluez5: Enable WB only with defer_setup
Vinicius Costa Gomes [Thu, 25 Apr 2013 19:05:17 +0000 (16:05 -0300)]
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.

11 years agohandsfree-audio: Implement ofono_handsfree_audio_has_defer_setup()
Vinicius Costa Gomes [Thu, 25 Apr 2013 19:05:16 +0000 (16:05 -0300)]
handsfree-audio: Implement ofono_handsfree_audio_has_defer_setup()

11 years agoinclude: Add ofono_handsfree_audio_has_defer_setup()
Vinicius Costa Gomes [Thu, 25 Apr 2013 19:05:15 +0000 (16:05 -0300)]
include: Add ofono_handsfree_audio_has_defer_setup()

11 years agoRevert "hfp_hf_bluez5: UUIDs can change after Pairing"
Denis Kenzior [Thu, 25 Apr 2013 22:47:05 +0000 (17:47 -0500)]
Revert "hfp_hf_bluez5: UUIDs can change after Pairing"

This reverts commit 456b8c9723b9b73c3ea4cadc8c6f84ca90675f9a.

11 years agohfp_hf_bluez5: Register the SDP record with correct features
Vinicius Costa Gomes [Tue, 23 Apr 2013 21:21:52 +0000 (18:21 -0300)]
hfp_hf_bluez5: Register the SDP record with correct features

11 years agohfp: Add defines for HFP SDP feature bits
Vinicius Costa Gomes [Tue, 23 Apr 2013 21:21:51 +0000 (18:21 -0300)]
hfp: Add defines for HFP SDP feature bits

11 years agobluez5: Unify bt_register_profile_* into a single function
Vinicius Costa Gomes [Tue, 23 Apr 2013 21:21:50 +0000 (18:21 -0300)]
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.

11 years agocore: Add SetProperty for EchoCancelingNoiseReduction
Claudio Takahasi [Tue, 23 Apr 2013 17:21:43 +0000 (14:21 -0300)]
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.

11 years agohfpmodem: Add EchoCancelingNoiseReduction
Claudio Takahasi [Tue, 23 Apr 2013 17:21:42 +0000 (14:21 -0300)]
hfpmodem: Add EchoCancelingNoiseReduction

This patch adds echo canceling and noise reduction implementation to
hfpmodem. It adds the implementation to send the command "AT+NREC=0"
to the AG.

11 years agoinclude: Add disable_nrec to handsfree driver
Claudio Takahasi [Tue, 23 Apr 2013 17:21:41 +0000 (14:21 -0300)]
include: Add disable_nrec to handsfree driver

This patch extends the handsfree driver adding echo canceling and noise
reduction callback to allow disabling this feature in the audio gateway.

11 years agocore: Set EchoCancelingNoiseReduction to TRUE by default
Claudio Takahasi [Tue, 23 Apr 2013 17:21:40 +0000 (14:21 -0300)]
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.

11 years agocore: Add EchoCancelingNoiseReduction to GetProperties
Claudio Takahasi [Tue, 23 Apr 2013 17:21:39 +0000 (14:21 -0300)]
core: Add EchoCancelingNoiseReduction to GetProperties

This patch adds EchoCancelingNoiseReduction property to GetProperties
method of Handsfree interface.

11 years agocore: Add "echo-canceling-and-noise-reduction"
Claudio Takahasi [Tue, 23 Apr 2013 17:21:38 +0000 (14:21 -0300)]
core: Add "echo-canceling-and-noise-reduction"

This patch adds "echo-canceling-and-noise-reduction" to "Features"
property of the Handsfree interface.

11 years agodoc: Add EchoCancelingNoiseReduction to Handsfree
Claudio Takahasi [Tue, 23 Apr 2013 17:21:37 +0000 (14:21 -0300)]
doc: Add EchoCancelingNoiseReduction to Handsfree

This patch adds echo canceling and noise reduction property to Handsfree
interface, allowing the handsfree unit to disable this feature in the
audio gateway. The HFP spec defines the procedure to turn off echo
canceling and noise reduction only, it is not allowed to enable this
feature from the HF unit.

According to Bluetooth HFP 1.6 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 from the HF
unit. From then on, and until the current Service Level Connection is
dropped for any reason, the AG shall disable these functions every time
an Audio Connection is established.

11 years agohfp_ag_bluez5: Implement RequestDisconnection()
Paulo Borges [Fri, 19 Apr 2013 22:19:05 +0000 (19:19 -0300)]
hfp_ag_bluez5: Implement RequestDisconnection()

When a RequestDisconnect() is received, the socket must be closed.
This way, the related emulator will be freed.

11 years agohfp_ag_bluez5: Add watch for G_IO_HUP when connect
Paulo Borges [Fri, 19 Apr 2013 22:19:04 +0000 (19:19 -0300)]
hfp_ag_bluez5: Add watch for G_IO_HUP when connect

A watch to G_IO_HUP is added to remove the file descriptor when the
emulator is automatically disconnected when its GAtServer closes.

We use a dupped file descriptor because the events aren't delivered to
the file descriptor who originated them.

11 years agohfp_ag_bluez5: Create a hash to store connections
Paulo Borges [Fri, 19 Apr 2013 22:19:03 +0000 (19:19 -0300)]
hfp_ag_bluez5: Create a hash to store connections

We need to store active connections so we can disconnect them at
RequestDisconnect().

When we remove a connection from the hash, we also close it.

11 years agohfp_ag_bluez5: Remove unused includes
Paulo Borges [Mon, 15 Apr 2013 21:41:50 +0000 (18:41 -0300)]
hfp_ag_bluez5: Remove unused includes

11 years agohfp: Move HFP versions definitions to hfp.h
Paulo Borges [Mon, 15 Apr 2013 21:41:49 +0000 (18:41 -0300)]
hfp: Move HFP versions definitions to hfp.h

hfp.h should store all HFP related definitions.

11 years agohfp_ag_bluez5: Include hfp.h
Paulo Borges [Mon, 15 Apr 2013 21:41:48 +0000 (18:41 -0300)]
hfp_ag_bluez5: Include hfp.h

11 years agophonesim: Include hfp.h
Paulo Borges [Mon, 15 Apr 2013 21:41:47 +0000 (18:41 -0300)]
phonesim: Include hfp.h

11 years agohfp_hf_bluez5: UUIDs can change after Pairing
Vinicius Costa Gomes [Thu, 18 Apr 2013 17:50:38 +0000 (14:50 -0300)]
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.

11 years agohandsfree-audio: Add debug logging
João Paulo Rechi Vita [Tue, 16 Apr 2013 22:32:21 +0000 (19:32 -0300)]
handsfree-audio: Add debug logging

Print debug messages when Handsfree Audio Agent registers or unregisters
itself.

11 years agoemulator: Change feature check to attend HFP 1.6
Paulo Borges [Fri, 12 Apr 2013 20:41:02 +0000 (17:41 -0300)]
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.

11 years agohandsfree-audio: Toggle wideband support when the agent registers
Vinicius Costa Gomes [Mon, 15 Apr 2013 13:54:53 +0000 (10:54 -0300)]
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.

11 years agohandsfree-audio: Keep track whether defer_setup is enabled
Vinicius Costa Gomes [Mon, 15 Apr 2013 13:54:52 +0000 (10:54 -0300)]
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.

11 years agohandsfree-audio: Send the selected codec
Claudio Takahasi [Mon, 15 Apr 2013 13:54:51 +0000 (10:54 -0300)]
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.

11 years agohfp_hf_bluez5: Watch for changes in the selected codec
Vinicius Costa Gomes [Mon, 15 Apr 2013 13:54:50 +0000 (10:54 -0300)]
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.