Commit Graph

6937 Commits

Author SHA1 Message Date
Paulo Borges 08a8eb7fa8 dundee: Fix typo in Manager's signal DeviceAdded
This typo was preventing dundee from sending the signal.
2013-02-22 11:28:57 -06:00
Claudio Takahasi 0772fda92e 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
2013-02-21 17:09:54 -06:00
Denis Kenzior 2f8b9ab50c bluez5: ref / unref handsfree audio 2013-02-21 08:30:03 -06:00
Denis Kenzior 951e03dfea handsfree-audio: Add ref / unref support 2013-02-21 08:27:55 -06:00
Denis Kenzior 3e16bc5e88 include: Add skeleton for handsfree-audio 2013-02-21 08:27:32 -06:00
Claudio Takahasi 28603a98ce hfp_ag_bluez5: Send HFP version when registering 2013-02-20 21:39:06 -06:00
Claudio Takahasi f765427b22 hfp_hf_bluez5: Send HFP version when registering 2013-02-20 21:36:49 -06:00
Claudio Takahasi 6672f41fd6 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.
2013-02-20 21:35:44 -06:00
Claudio Takahasi 8a1cd911d8 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.
2013-02-20 21:31:04 -06:00
Denis Kenzior 5f787fed4e handsfree-audio: Don't go over 80 characters 2013-02-20 21:28:01 -06:00
Claudio Takahasi 555a883ecb handsfree-audio: Add Agent tracking
This patch tracks when the Handsfree Audio Agent leaves the system BUS,
and free agent allocated resources.
2013-02-20 21:27:01 -06:00
Claudio Takahasi 7a7bb7399a handsfree-audio: Call Agent "Release" when exiting
This patch notifies the Agent implementation that it is no longer
registered to the service daemon.
2013-02-20 21:26:57 -06:00
Claudio Takahasi 19f50c6a3b 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.
2013-02-20 21:25:38 -06:00
Claudio Takahasi a76e4d71f5 handsfree-audio: Free agent when exiting
Free agent allocated resources when oFono exits.
2013-02-20 21:23:01 -06:00
Vinicius Costa Gomes 9b77d65bf9 handsfree-audio: Add codec array validation
This patch checks if the codec array included in the "Register" method
contains valid codec ID's.
2013-02-20 21:22:45 -06:00
Claudio Takahasi 16246e120e 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.
2013-02-20 21:22:17 -06:00
Claudio Takahasi 55a9b0411e main: Call handsfree audio manager init and cleanup 2013-02-20 21:20:26 -06:00
Claudio Takahasi 850c1811fc 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.
2013-02-20 21:19:27 -06:00
Denis Kenzior 57a44e8d23 doc: Add experimental handsfree-audio API 2013-02-19 09:47:57 -06:00
Denis Kenzior 7ba9521f10 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.
2013-02-14 08:47:10 -06:00
Denis Kenzior 83b43c8abd 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.
2013-02-14 08:47:10 -06:00
Denis Kenzior 825feb8cd5 hfp_hf_bluez5: Use faster method of disable() 2013-02-14 08:47:10 -06:00
Denis Kenzior 69820a7136 modem: Implement ofono_modem_find 2013-02-14 08:47:10 -06:00
Denis Kenzior 47b24507fc include: Add ofono_modem_find 2013-02-14 08:47:10 -06:00
Claudio Takahasi 39f1480155 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.
2013-02-14 08:47:10 -06:00
Denis Kenzior 4394a362eb hfp_hf_bluez5: Use some tricks to optimize code 2013-02-14 08:47:10 -06:00
Denis Kenzior 1d4d3f1fb9 gdbus: Add g_dbus_proxy_set_removed_watch 2013-02-14 08:47:10 -06:00
Vinicius Costa Gomes 233b1ecca4 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.
2013-02-14 08:47:10 -06:00
Claudio Takahasi a2b698dc40 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.
2013-02-14 08:47:10 -06:00
Vinicius Costa Gomes 22f05f7832 bluez5: Add support for Connecting/Disconnecting per UUID
This adds supports for sending the ConnectProfile() and
DisconnectProfile() messages for the org.bluez.Device1 interface.
2013-02-14 08:47:10 -06:00
Claudio Takahasi 86224f5724 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.
2013-02-14 08:47:10 -06:00
Vinicius Costa Gomes f93a6a2d06 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.
2013-02-14 15:17:39 +01:00
Marcel Holtmann 8910e64f84 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.
2013-02-11 20:22:42 +01:00
Johan Hedberg 0b1694f4ba 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.
2013-02-01 22:06:14 +01:00
Frédéric Danis e59fed9c96 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.
2013-01-31 16:15:03 -06:00
Claudio Takahasi 39e72e0178 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.
2013-01-31 16:03:48 -06:00
Claudio Takahasi f044c6c1fa 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.
2013-01-31 16:01:04 -06:00
Vinicius Costa Gomes 852ea612c8 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().
2013-01-31 15:57:55 -06:00
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