platform/upstream/ofono.git
11 years agobluez5: Add bt_register_profile_with_role
Paulo Borges [Fri, 1 Mar 2013 21:58:59 +0000 (18:58 -0300)]
bluez5: Add bt_register_profile_with_role

This function allows to specify which role is registering when the
profile does not have specific UUIDs for each role.

11 years agohandsfree-audio: Check CVSD when registering agent
Claudio Takahasi [Thu, 28 Feb 2013 18:52:50 +0000 (15:52 -0300)]
handsfree-audio: Check CVSD when registering agent

This patch makes CVSD codec mandatory when registering a Handsfree
Audio Agent.

11 years agobluez5: Move ref / unref handsfree audio
Paulo Borges [Wed, 27 Feb 2013 21:49:13 +0000 (18:49 -0300)]
bluez5: Move ref / unref handsfree audio

This commit moves the ref / unref to hfp_hf_bluez5 to make
bluez5 more generic and reusable.

11 years agohfp_hf_bluez5: Remove Card on RequestDisconnection
Claudio Takahasi [Thu, 28 Feb 2013 16:01:10 +0000 (13:01 -0300)]
hfp_hf_bluez5: Remove Card on RequestDisconnection

For local initiated disconnection the GAtChat disconnect callback is not
called. For this case, Audio Card remove function needs to be called.

11 years agohfp_hf_bluez5: Remove Card when modem is disabled
Claudio Takahasi [Thu, 28 Feb 2013 16:01:09 +0000 (13:01 -0300)]
hfp_hf_bluez5: Remove Card when modem is disabled

11 years agohfp_hf_bluez5: Remove Card if SLC is disconnected
Claudio Takahasi [Thu, 28 Feb 2013 16:01:08 +0000 (13:01 -0300)]
hfp_hf_bluez5: Remove Card if SLC is disconnected

This patch removes previous registered Audio Card when the remote
Bluetooth device triggers the service level disconnection.

11 years agohfp_hf_bluez5: Remove Card when SLC fails
Claudio Takahasi [Thu, 28 Feb 2013 16:01:07 +0000 (13:01 -0300)]
hfp_hf_bluez5: Remove Card when SLC fails

This patch removes the previously created Audio Card if the service
level negotiation fails.

11 years agohfp_hf_bluez5: Add local address to Audio Card
Claudio Takahasi [Thu, 28 Feb 2013 16:01:06 +0000 (13:01 -0300)]
hfp_hf_bluez5: Add local address to Audio Card

11 years agohfp_hf_bluez5: Add registering Audio Card
Claudio Takahasi [Thu, 28 Feb 2013 16:01:05 +0000 (13:01 -0300)]
hfp_hf_bluez5: Add registering Audio Card

This patch registers the Handsfree Audio Card when the service level
connection is established.

11 years agohandsfree-audio: properly increment next_card_id
Denis Kenzior [Tue, 26 Feb 2013 21:46:43 +0000 (15:46 -0600)]
handsfree-audio: properly increment next_card_id

11 years agodoc: Add possible handsfree-audio API errors
Claudio Takahasi [Tue, 26 Feb 2013 15:59:03 +0000 (12:59 -0300)]
doc: Add possible handsfree-audio API errors

This patch adds possible errors that can be returned by Register and
Unregister methods of the Manager interface.

11 years agobluez4: Increase Bluez 4 D-Bus timeouts to 60 seconds
Patrik Flykt [Tue, 26 Feb 2013 11:15:52 +0000 (13:15 +0200)]
bluez4: Increase Bluez 4 D-Bus timeouts to 60 seconds

RequestAuthorization method call may trigger pairing and/or pop up a
dialog in the remote device to which the user needs to react. Thus
increase D-Bus timeouts to 60 seconds for the Bluez 4 plugin.

11 years agohandsfree-audio: Impelement CardRemoved signal
Denis Kenzior [Tue, 26 Feb 2013 20:12:09 +0000 (14:12 -0600)]
handsfree-audio: Impelement CardRemoved signal

11 years agohandsfree-audio: Implement CardAdded signal
Denis Kenzior [Tue, 26 Feb 2013 20:03:04 +0000 (14:03 -0600)]
handsfree-audio: Implement CardAdded signal

11 years agohandsfree-audio: Implement the GetCards method
Denis Kenzior [Tue, 26 Feb 2013 19:48:46 +0000 (13:48 -0600)]
handsfree-audio: Implement the GetCards method

11 years agohandsfree-audio: Implement card GetProperties
Denis Kenzior [Tue, 26 Feb 2013 19:35:38 +0000 (13:35 -0600)]
handsfree-audio: Implement card GetProperties

11 years agohandsfree-audio: Unregister from DBus on removal
Denis Kenzior [Tue, 26 Feb 2013 20:09:15 +0000 (14:09 -0600)]
handsfree-audio: Unregister from DBus on removal

11 years agohandsfree-audio: Add skeleton D-Bus registration
Denis Kenzior [Tue, 26 Feb 2013 19:22:02 +0000 (13:22 -0600)]
handsfree-audio: Add skeleton D-Bus registration

For HandsfreeAudioCard objects

11 years agohandsfree-audio: Don't hardcode '/' path
Denis Kenzior [Tue, 26 Feb 2013 20:01:47 +0000 (14:01 -0600)]
handsfree-audio: Don't hardcode '/' path

Use OFONO_MANAGER_PATH instead

11 years agoinclude: Add handsfree card register method
Denis Kenzior [Tue, 26 Feb 2013 19:21:32 +0000 (13:21 -0600)]
include: Add handsfree card register method

11 years agohandsfree-audio: Implement card create / remove
Denis Kenzior [Tue, 26 Feb 2013 17:03:00 +0000 (11:03 -0600)]
handsfree-audio: Implement card create / remove

11 years agoinclude: Add handsfree card create / remove API
Denis Kenzior [Tue, 26 Feb 2013 17:02:43 +0000 (11:02 -0600)]
include: Add handsfree card create / remove API

11 years agoaudio-settings: Fix unneeded async for GetProperties
Claudio Takahasi [Mon, 25 Feb 2013 13:48:39 +0000 (10:48 -0300)]
audio-settings: Fix unneeded async for GetProperties

GetProperties method call for Audio settings returns the reply in the
same iteraction, it doesn't need to be asynchronous.

11 years agogdbus: Always unreference the message in g_dbus_send_message()
Tomasz Bursztyka [Fri, 8 Feb 2013 13:58:10 +0000 (15:58 +0200)]
gdbus: Always unreference the message in g_dbus_send_message()

A quick fix on g_dbus_send_message(), if check_signal() fails it returns
FALSE without unreferencing the message as it should. This patch fixes
it.

11 years agoAUTHORS: Mention Paulo's contributions
Denis Kenzior [Fri, 22 Feb 2013 17:29:26 +0000 (11:29 -0600)]
AUTHORS: Mention Paulo's contributions

11 years agodundee: Fix typo in dundee-disconnect test
Paulo Borges [Fri, 22 Feb 2013 17:01:12 +0000 (14:01 -0300)]
dundee: Fix typo in dundee-disconnect test

11 years agodundee: Fix typo in Manager's signal DeviceAdded
Paulo Borges [Fri, 22 Feb 2013 17:01:11 +0000 (14:01 -0300)]
dundee: Fix typo in Manager's signal DeviceAdded

This typo was preventing dundee from sending the signal.

11 years agohfpmodem: Fix segfault in CIEV GAtChat callback
Claudio Takahasi [Thu, 21 Feb 2013 22:24:42 +0000 (19:24 -0300)]
hfpmodem: Fix segfault in CIEV GAtChat callback

This patch fixes segmentation fault when the network registration
watch is called without being initialized. CIEV GAtChat callback can
be called before ofono_netreg_register().

==15101== Invalid read of size 8
==15101==    at 0x492B56: ofono_netreg_register (network.c:2073)
==15101==    by 0x47245E: hfp_netreg_probe (network-registration.c:311)
==15101==    by 0x492A8D: ofono_netreg_create (network.c:1881)
==15101==    by 0x4849D5: hfp_pre_sim (hfp_hf_bluez5.c:288)
==15101==    by 0x48C486: ofono_modem_set_powered (modem.c:1194)
==15101==    by 0x484E9D: slc_established (hfp_hf_bluez5.c:85)
==15101==    by 0x4702AD: chld_cb (slc.c:147)
==15101==    by 0x440457: at_chat_finish_command (gatchat.c:461)
==15101==    by 0x44109F: new_bytes (gatchat.c:532)
==15101==    by 0x4433B7: received_data (gatio.c:122)
==15101==    by 0x3CBAA47824: g_main_context_dispatch (gmain.c:2539)
==15101==    by 0x3CBAA47B57: g_main_context_iterate.isra.23
(gmain.c:3146)
==15101==  Address 0x18 is not stack'd, malloc'd or (recently) free'd

11 years agobluez5: ref / unref handsfree audio
Denis Kenzior [Thu, 21 Feb 2013 14:30:03 +0000 (08:30 -0600)]
bluez5: ref / unref handsfree audio

11 years agohandsfree-audio: Add ref / unref support
Denis Kenzior [Thu, 21 Feb 2013 14:27:55 +0000 (08:27 -0600)]
handsfree-audio: Add ref / unref support

11 years agoinclude: Add skeleton for handsfree-audio
Denis Kenzior [Thu, 21 Feb 2013 14:27:32 +0000 (08:27 -0600)]
include: Add skeleton for handsfree-audio

11 years agohfp_ag_bluez5: Send HFP version when registering
Claudio Takahasi [Wed, 20 Feb 2013 22:26:19 +0000 (19:26 -0300)]
hfp_ag_bluez5: Send HFP version when registering

11 years agohfp_hf_bluez5: Send HFP version when registering
Claudio Takahasi [Wed, 20 Feb 2013 22:26:19 +0000 (19:26 -0300)]
hfp_hf_bluez5: Send HFP version when registering

11 years agobluez5: Add profile version argument
Claudio Takahasi [Wed, 20 Feb 2013 22:26:19 +0000 (19:26 -0300)]
bluez5: Add profile version argument

This patch adds sending of the Version argument to RegisterProfile
method.  The version is required to create the service record
containing the correct profile version.

11 years agohfp_hf_bluez5: Add local HFP version tracking
Claudio Takahasi [Wed, 20 Feb 2013 22:26:18 +0000 (19:26 -0300)]
hfp_hf_bluez5: Add local HFP version tracking

Fallback to HFP 1.5 if defer setup is not supported since it is not
possible to proceed with codec negotiation.

11 years agohandsfree-audio: Don't go over 80 characters
Denis Kenzior [Thu, 21 Feb 2013 03:28:01 +0000 (21:28 -0600)]
handsfree-audio: Don't go over 80 characters

11 years agohandsfree-audio: Add Agent tracking
Claudio Takahasi [Wed, 20 Feb 2013 21:55:51 +0000 (18:55 -0300)]
handsfree-audio: Add Agent tracking

This patch tracks when the Handsfree Audio Agent leaves the system BUS,
and free agent allocated resources.

11 years agohandsfree-audio: Call Agent "Release" when exiting
Claudio Takahasi [Wed, 20 Feb 2013 21:55:49 +0000 (18:55 -0300)]
handsfree-audio: Call Agent "Release" when exiting

This patch notifies the Agent implementation that it is no longer
registered to the service daemon.

11 years agohandsfree-audio: Add Agent "Unregister"
Claudio Takahasi [Wed, 20 Feb 2013 21:55:50 +0000 (18:55 -0300)]
handsfree-audio: Add Agent "Unregister"

This patch implements the "Unregister" method of the Handsfree Audio
Manager. The agent is unregistered if sender and path match.

11 years agohandsfree-audio: Free agent when exiting
Claudio Takahasi [Wed, 20 Feb 2013 21:55:48 +0000 (18:55 -0300)]
handsfree-audio: Free agent when exiting

Free agent allocated resources when oFono exits.

11 years agohandsfree-audio: Add codec array validation
Vinicius Costa Gomes [Wed, 20 Feb 2013 21:55:47 +0000 (18:55 -0300)]
handsfree-audio: Add codec array validation

This patch checks if the codec array included in the "Register" method
contains valid codec ID's.

11 years agohandsfree-audio: Add Agent "Register" method
Claudio Takahasi [Wed, 20 Feb 2013 21:55:46 +0000 (18:55 -0300)]
handsfree-audio: Add Agent "Register" method

This patch adds the initial Handsfree Audio Manager "Register"
method implementation. It adds the parsing of the arguments included
in the message and checks if there is an agent registered already.

11 years agomain: Call handsfree audio manager init and cleanup
Claudio Takahasi [Wed, 20 Feb 2013 21:55:45 +0000 (18:55 -0300)]
main: Call handsfree audio manager init and cleanup

11 years agohandsfree-audio: Add Manager registration
Claudio Takahasi [Wed, 20 Feb 2013 21:55:45 +0000 (18:55 -0300)]
handsfree-audio: Add Manager registration

Adds the initial implementation of new experimental Handsfree Audio
Manager interface. This patch adds the interface registration and
the declaration of it's methods.

11 years agodoc: Add experimental handsfree-audio API
Denis Kenzior [Tue, 19 Feb 2013 15:47:08 +0000 (09:47 -0600)]
doc: Add experimental handsfree-audio API

11 years agohfp_hf_bluez5: Ensure active SLC for SCO links
Denis Kenzior [Thu, 14 Feb 2013 02:40:30 +0000 (20:40 -0600)]
hfp_hf_bluez5: Ensure active SLC for SCO links

Whenever a SCO connection is attempted, ensure that the SLC link is
already active between us and the same remote peer.

11 years agohfp_hf_bluez5: Remove use of hash table
Denis Kenzior [Thu, 14 Feb 2013 02:30:21 +0000 (20:30 -0600)]
hfp_hf_bluez5: Remove use of hash table

The number of paired devices is quite small, so the use of the hash
table for lookup seems unnecessary.  The typical user will have no more
than 1-2 devices paired, maybe half a dozen in a less common case.

11 years agohfp_hf_bluez5: Use faster method of disable()
Denis Kenzior [Thu, 14 Feb 2013 02:14:32 +0000 (20:14 -0600)]
hfp_hf_bluez5: Use faster method of disable()

11 years agomodem: Implement ofono_modem_find
Denis Kenzior [Thu, 7 Feb 2013 20:53:44 +0000 (14:53 -0600)]
modem: Implement ofono_modem_find

11 years agoinclude: Add ofono_modem_find
Denis Kenzior [Thu, 7 Feb 2013 20:53:34 +0000 (14:53 -0600)]
include: Add ofono_modem_find

11 years agohfp_hf_bluez5: Remove unneeded modem hash lookup
Claudio Takahasi [Fri, 1 Feb 2013 13:24:30 +0000 (10:24 -0300)]
hfp_hf_bluez5: Remove unneeded modem hash lookup

Modem object is created when the Device Proxy is added, and it is
paired. Another path is when the Device "Paired" property changes
to True.

11 years agohfp_hf_bluez5: Use some tricks to optimize code
Denis Kenzior [Thu, 7 Feb 2013 16:36:19 +0000 (10:36 -0600)]
hfp_hf_bluez5: Use some tricks to optimize code

11 years agogdbus: Add g_dbus_proxy_set_removed_watch
Denis Kenzior [Thu, 7 Feb 2013 16:22:57 +0000 (10:22 -0600)]
gdbus: Add g_dbus_proxy_set_removed_watch

11 years agohfp_hf_bluez5: Add support for Enabling/Disabling the modem
Vinicius Costa Gomes [Fri, 1 Feb 2013 23:33:09 +0000 (20:33 -0300)]
hfp_hf_bluez5: Add support for Enabling/Disabling the modem

Now that we have the support for sending the correct messages
to BlueZ, we are able to dynamically power up/down the HFP modem.

We add another property to the modem to be able to get the D-Bus
object path that represents the remote device.

11 years agohfp_hf_bluez5: Add Profile RequestDisconnection
Claudio Takahasi [Fri, 1 Feb 2013 23:33:08 +0000 (20:33 -0300)]
hfp_hf_bluez5: Add Profile RequestDisconnection

This patch implements RequestDisconnection method of the Profile1
interface. This method gets called when the profile gets disconnected.
The profile implementation needs to cleanup the resources related to
the informed device.

11 years agobluez5: Add support for Connecting/Disconnecting per UUID
Vinicius Costa Gomes [Fri, 1 Feb 2013 23:33:07 +0000 (20:33 -0300)]
bluez5: Add support for Connecting/Disconnecting per UUID

This adds supports for sending the ConnectProfile() and
DisconnectProfile() messages for the org.bluez.Device1 interface.

11 years agobluez5: Rename BlueZ Profile registration functions
Claudio Takahasi [Fri, 1 Feb 2013 23:33:06 +0000 (20:33 -0300)]
bluez5: Rename BlueZ Profile registration functions

This patch renames external profile registration functions replacing the
prefix from 'bluetooth_' to 'bt_' in order to follow the name convention
adopted for bluez5 functions.

11 years agogdbus: Fix missing PropertiesChanged signal
Vinicius Costa Gomes [Thu, 7 Feb 2013 17:40:31 +0000 (14:40 -0300)]
gdbus: Fix missing PropertiesChanged signal

If D-Bus ObjectManager is not supported, InterfacesAdded signal
checking needs to be ignored otherwise PropertiesChanged signal
will never be sent.

11 years agogdbus: Don't call property changed callback during client init
Marcel Holtmann [Mon, 11 Feb 2013 19:19:10 +0000 (20:19 +0100)]
gdbus: Don't call property changed callback during client init

When the client uses ObjectManager to init properties, do not call
property changed callbacks. They should only be called once the proxy
added has been successfully signaled since the proxy itself provides
a full copy of available properties.

11 years agogdbus: Fix unpublished interface signal emission
Johan Hedberg [Fri, 1 Feb 2013 15:03:22 +0000 (09:03 -0600)]
gdbus: Fix unpublished interface signal emission

If we haven't published an interface yet (i.e. it's in the data->added
list), we should just ignore any property changed indications as the
values for the properties will anyway be part of the InterfacesAdded
signal.

11 years agohfp_ag: Add BlueZ 5 version
Frédéric Danis [Tue, 29 Jan 2013 10:42:40 +0000 (11:42 +0100)]
hfp_ag: Add BlueZ 5 version

This patch adds initial implementation of the D-Bus Profile1
interface and methods responsible for handling Bluetooth connections.

The HFP AG profile interface is registered as soon as a voice capable
modem is registered in oFono.

11 years agohfp_hf_bluez5: Remove BlueZ devices proxies hash
Claudio Takahasi [Thu, 31 Jan 2013 19:01:54 +0000 (16:01 -0300)]
hfp_hf_bluez5: Remove BlueZ devices proxies hash

The hash table to track the devices is not necessary anymore since
dynamic modem registration on NewConnection was removed.

11 years agohfp_hf_bluez5: Fix registering modem on NewConnection
Claudio Takahasi [Thu, 31 Jan 2013 19:01:53 +0000 (16:01 -0300)]
hfp_hf_bluez5: Fix registering modem on NewConnection

HFP modem will be registered when Proxy Added callback gets called
or when Pair is True. This patch removes the support for dynamic modem
registration when a new connection is notified and there isn't a modem
associated with the Bluetooth remote device.

BlueZ behaviour has been changed and a NewConnection is not notified
before the service discovery finishes.

11 years agohfp_hf_bluez5: Remove unneeded error handling
Vinicius Costa Gomes [Thu, 31 Jan 2013 18:30:08 +0000 (15:30 -0300)]
hfp_hf_bluez5: Remove unneeded error handling

Apart from g_io_channel_unix_new() not setting errno, it never
returns an NULL pointer on error, because in practice it only
calls g_new().

11 years agobluetooth: Rename HFP AG plugin
Frédéric Danis [Tue, 29 Jan 2013 10:42:39 +0000 (11:42 +0100)]
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.

11 years agohfp_hf_bluez5: Only register modems for Paired devices
Vinicius Costa Gomes [Wed, 30 Jan 2013 16:24:16 +0000 (13:24 -0300)]
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.

11 years agohfp_hf_bluez5: Improve Proxy property changed handling
Claudio Takahasi [Wed, 30 Jan 2013 16:24:15 +0000 (13:24 -0300)]
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.

11 years agoTODO: Add task for supporting BlueZ 5 in dundee
Vinicius Costa Gomes [Wed, 30 Jan 2013 21:12:30 +0000 (18:12 -0300)]
TODO: Add task for supporting BlueZ 5 in dundee

11 years agohfp_hf_bluez5: Fix missing fd close
Claudio Takahasi [Tue, 29 Jan 2013 20:38:40 +0000 (17:38 -0300)]
hfp_hf_bluez5: Fix missing fd close

This patch fix an unusual scenario, service_level_connection() fails if
GIOChannel or GAtChat memory allocation fails.

11 years agohfp_hf_bluez5: Rename 'Address' to 'Remote'
Vinicius Costa Gomes [Tue, 29 Jan 2013 20:38:37 +0000 (17:38 -0300)]
hfp_hf_bluez5: Rename 'Address' to 'Remote'

Rename this property to better indicate that it is the remote Address
being referred to.

11 years agobluez5: Add RFCOMM socket address declaration
Claudio Takahasi [Mon, 28 Jan 2013 21:11:06 +0000 (18:11 -0300)]
bluez5: Add RFCOMM socket address declaration

This patch adds a copy of Bluetooth RFCOMM socket declaration.

11 years agobluez5: Add bt_bacmp()
Claudio Takahasi [Mon, 28 Jan 2013 21:11:05 +0000 (18:11 -0300)]
bluez5: Add bt_bacmp()

Adds a copy of BlueZ bacmp() function.

11 years agobluez5: Add bt_ba2str()
Claudio Takahasi [Mon, 28 Jan 2013 21:11:04 +0000 (18:11 -0300)]
bluez5: Add bt_ba2str()

Adds a copy of BlueZ ba2str() function.

11 years agohfp_hf_bluez5: Add SCO listen socket
Claudio Takahasi [Mon, 28 Jan 2013 21:11:03 +0000 (18:11 -0300)]
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.

11 years agobluez5: Add bt_bacpy()
Claudio Takahasi [Mon, 28 Jan 2013 21:11:02 +0000 (18:11 -0300)]
bluez5: Add bt_bacpy()

Adds a copy of BlueZ bacpy() function.

11 years agobluez5: Add SCO socket declarations
Claudio Takahasi [Mon, 28 Jan 2013 21:11:01 +0000 (18:11 -0300)]
bluez5: Add SCO socket declarations

Adds local copy of SCO Bluetooth sockets declarations, since the
objective to avoid including BlueZ library headers.

11 years agohfp_hf_bluez5: Add SLC establishment procedure
Vinicius Costa Gomes [Wed, 23 Jan 2013 23:08:29 +0000 (20:08 -0300)]
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.

11 years agohfp_hf_bluez5: Handle NewConnection from BlueZ
Vinicius Costa Gomes [Wed, 23 Jan 2013 18:27:56 +0000 (15:27 -0300)]
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.

11 years agohfp_hf_bluez5: Follow HFP AG device Alias property
Vinicius Costa Gomes [Wed, 23 Jan 2013 18:27:55 +0000 (15:27 -0300)]
hfp_hf_bluez5: Follow HFP AG device Alias property

If the device Alias property changes we should also change the name of
the modem.

11 years agohfp_hf_bluez5: Register modem for HFP AG devices
Vinicius Costa Gomes [Wed, 23 Jan 2013 18:27:54 +0000 (15:27 -0300)]
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.

11 years agobluez5: Add HFP_AG_UUID
Vinicius Costa Gomes [Wed, 23 Jan 2013 18:27:54 +0000 (15:27 -0300)]
bluez5: Add HFP_AG_UUID

11 years agohfp_hf_bluez5: Add tracking of bluetooth devices
Vinicius Costa Gomes [Wed, 23 Jan 2013 18:27:53 +0000 (15:27 -0300)]
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.

11 years agohfp_hf_bluez5: Initial GDBusClient for BlueZ
Vinicius Costa Gomes [Wed, 23 Jan 2013 18:27:52 +0000 (15:27 -0300)]
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.

11 years agobluez5: Add additional defines
Vinicius Costa Gomes [Wed, 23 Jan 2013 18:27:52 +0000 (15:27 -0300)]
bluez5: Add additional defines

11 years agobluez5: Fix copy paste error
Denis Kenzior [Wed, 23 Jan 2013 19:02:05 +0000 (13:02 -0600)]
bluez5: Fix copy paste error

11 years agonetreg: Fix broken CMER behavior on MBM
Denis Kenzior [Mon, 21 Jan 2013 16:23:34 +0000 (10:23 -0600)]
netreg: Fix broken CMER behavior on MBM

11 years agombm: Delay init until EMRDY
Denis Kenzior [Mon, 21 Jan 2013 16:22:45 +0000 (10:22 -0600)]
mbm: Delay init until EMRDY

If we send these commands before the EMRDY notification has been seen,
they will simply return an error.

11 years agohfpmodem: Add comment for previous commit
Denis Kenzior [Mon, 21 Jan 2013 15:41:27 +0000 (09:41 -0600)]
hfpmodem: Add comment for previous commit

11 years agohfpmodem: Fix release-and-swap without +CIEV
Mikel Astiz [Mon, 21 Jan 2013 15:30:24 +0000 (16:30 +0100)]
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

11 years agohfpmodem: Avoid transitional voicecall states
Mikel Astiz [Mon, 21 Jan 2013 15:30:23 +0000 (16:30 +0100)]
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.

11 years agohfpmodem: Refactor voicecall notify with foreach
Mikel Astiz [Mon, 21 Jan 2013 15:30:22 +0000 (16:30 +0100)]
hfpmodem: Refactor voicecall notify with foreach

Define a helper function in order to use foreach statements when
ofono_voicecall_notify() needs to be called.

11 years agogdbus: Check for valid path before handling properties
Marcel Holtmann [Mon, 21 Jan 2013 02:25:12 +0000 (18:25 -0800)]
gdbus: Check for valid path before handling properties

11 years agohfpmodem: Add support for sending the supported codecs
Vinicius Costa Gomes [Thu, 17 Jan 2013 15:13:06 +0000 (12:13 -0300)]
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."

11 years agohfpmodem: Add version defines for HFP 1.6
Vinicius Costa Gomes [Thu, 17 Jan 2013 15:13:05 +0000 (12:13 -0300)]
hfpmodem: Add version defines for HFP 1.6

11 years agoAUTHORS: Mention Claudio's contributions
Denis Kenzior [Wed, 16 Jan 2013 20:15:39 +0000 (14:15 -0600)]
AUTHORS: Mention Claudio's contributions

11 years agobuild: Use AM_CPPFLAGS instead of INCLUDES
Lucas De Marchi [Wed, 16 Jan 2013 21:11:23 +0000 (19:11 -0200)]
build: Use AM_CPPFLAGS instead of INCLUDES

Makefile.am:518: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')

11 years agobuild: Do not use deprecated AM_CONFIG_HEADER
Lucas De Marchi [Wed, 16 Jan 2013 21:11:22 +0000 (19:11 -0200)]
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.

11 years agostorage: Include sys/types.h for ssize_t
Lucas De Marchi [Wed, 16 Jan 2013 21:11:24 +0000 (19:11 -0200)]
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'

11 years agohfp_hf_bluez5: Add BlueZ Profile handler
Claudio Takahasi [Wed, 16 Jan 2013 13:31:31 +0000 (10:31 -0300)]
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.

11 years agobluez5: Add a couple of defines
Claudio Takahasi [Wed, 16 Jan 2013 13:31:31 +0000 (10:31 -0300)]
bluez5: Add a couple of defines