Commit Graph

1189 Commits

Author SHA1 Message Date
Paulo Borges 4245df6200 hfp_ag_bluez5: Include hfp.h 2013-04-18 08:42:44 -05:00
Paulo Borges f1e29338ba phonesim: Include hfp.h 2013-04-18 08:42:28 -05:00
Vinicius Costa Gomes 456b8c9723 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.
2013-04-18 08:37:17 -05:00
Vinicius Costa Gomes 4e7f0690e9 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.
2013-04-15 07:00:39 -05:00
Denis Kenzior 4610d3dad2 hfp_hf_bluez5: Include hfp.h 2013-04-09 14:33:41 -05:00
Denis Kenzior 3715103654 hfp_hf_bluez5: Remove redundant parentheses 2013-04-09 14:33:41 -05:00
Vinicius Costa Gomes 3697794f9e hfp_hf_bluez5: Add audio card .connect() for HFP 1.6 2013-04-09 14:33:41 -05:00
Vinicius Costa Gomes a36ffa872a hfp_hf_bluez5: Use 1.6 card driver 2013-04-05 12:25:10 -05:00
Claudio Takahasi dd24a39d2f hfp_hf_bluez5: Add extracting version
This patch parses and reads the profile "Version" that comes in the fd
dictionary of the NewConnection method. "Version" is input for Audio Card
registration.
2013-04-05 12:14:00 -05:00
Forest Bond 692e59f108 huawei: Use AlwaysOnline for CDMA modems 2013-04-01 21:42:44 -05:00
Denis Kenzior 2f50d25ab5 hfp_hf_bluez5: Make sure to call the callback 2013-03-28 09:30:45 -05:00
Vinicius Costa Gomes 759cf25614 hfp_hf_bluez5: Add a card driver for HFP 1.6
This is just the skeleton of a Handsfree Audio Card for the HF side of
HFP 1.6.
2013-03-28 09:29:50 -05:00
Denis Kenzior 93ac1669a0 sim900: Fix disable cleanup procedure 2013-03-26 10:53:41 -05:00
Denis Kenzior 32cece7b09 sim900: Fix compile error
make --no-print-directory all-am
  CC     plugins/sim900.o
  cc1: warnings being treated as errors
  plugins/sim900.c: In function ‘shutdown_device’:
  plugins/sim900.c:180:9: error: unused variable ‘fd’
  make[1]: *** [plugins/sim900.o] Error 1
  make: *** [all] Error 2
2013-03-26 10:36:25 -05:00
Denis Kenzior 548611e939 sim900: Remove unneeded goto / label 2013-03-26 10:35:59 -05:00
Denis Kenzior b4518caa50 sim900: Properly clean up device IOChannel on error 2013-03-26 10:34:09 -05:00
Renat Zaripov 2d09257855 sim900: Add multiplexer support
Also add gprs and call-volume support.
2013-03-26 10:29:08 -05:00
Denis Kenzior d8a9bf776b sim900: Fix leak of options hash table 2013-03-26 10:21:14 -05:00
Denis Kenzior 2864624c56 hfp_ag_bluez5: Fix sanity check
We should be checking that modems != NULL, not modems->data.  This is
because the list can be empty and we would crash.
2013-03-21 10:19:00 -05:00
Denis Kenzior 823215ff66 dun_gw_bluez5: Fix sanity check
We should be checking that modems != NULL, not modems->data.  This is
because the list can be empty and we would crash.
2013-03-21 10:18:11 -05:00
Denis Kenzior 439712a937 dun_gw_bluez5: Fix copy-paste error 2013-03-21 10:15:16 -05:00
Frédéric Danis 770cb38352 dun_gw: Add BlueZ 5 version
This patch adds initial implementation of the D-Bus Profile1
interface and methods responsible for handling Bluetooth connections.

The DUN GW profile interface is registered as soon as a GPRS capable
modem is registered in oFono.
2013-03-21 10:12:42 -05:00
Frédéric Danis 8a1bd0d657 bluetooth: Rename DUN GW plugin
As BlueZ 5 introduced backwards incompatible API changes, and we want to
keep support for BlueZ 4 based DUN GW plugin for some time, we need to
separate DUN GW plugin which is based on BlueZ 4 from the one based on
BlueZ 5.

The dun_gw.c plugin is renamed to dun_gw_bluez4. This will make it easy
to add a DUN GW plugin for BlueZ 5.
2013-03-21 10:08:41 -05:00
Denis Kenzior afb4470558 hfp_hf_bluez5: Set remote and local information 2013-03-18 13:57:30 -05:00
Denis Kenzior 0f973d7150 hfp_hf_bluez5: Update to the new API 2013-03-18 13:42:46 -05:00
Claudio Takahasi b64357f690 hfp_hf_bluez5: Remove duplicated include 2013-03-12 13:03:42 -05:00
Claudio Takahasi e51f734881 hfp_hf_bluez5: Remove SCO handling
This patch moves the SCO socket handling from hfp_hf_bluez5 plugin.  It
will be instead handled by the handsfree-audio functionality. This is
the initial step to be able to support sending the file descriptor
through the Agent NewConnection method.
2013-03-04 16:16:24 -06:00
Claudio Takahasi 3b8d84d19d hfp_hf_bluez5: Use new bluetooth.h header 2013-03-04 16:13:31 -06:00
Claudio Takahasi 3373fae662 bluez5: Remove Bluetooth related utilities 2013-03-04 16:13:18 -06:00
Paulo Borges 08eea76ea8 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.
2013-03-04 12:04:54 -06:00
Paulo Borges 80212a3db2 bluez5: Move ref / unref handsfree audio
This commit moves the ref / unref to hfp_hf_bluez5 to make
bluez5 more generic and reusable.
2013-03-01 13:22:35 -06:00
Claudio Takahasi cf6137c187 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.
2013-02-28 10:11:05 -06:00
Claudio Takahasi bff9432007 hfp_hf_bluez5: Remove Card when modem is disabled 2013-02-28 10:10:54 -06:00
Claudio Takahasi 134b237344 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.
2013-02-28 10:10:41 -06:00
Claudio Takahasi 1ee6c6ea09 hfp_hf_bluez5: Remove Card when SLC fails
This patch removes the previously created Audio Card if the service
level negotiation fails.
2013-02-28 10:10:30 -06:00
Claudio Takahasi fb9b54bc2c hfp_hf_bluez5: Add local address to Audio Card 2013-02-28 10:10:13 -06:00
Claudio Takahasi 4ef4d620e4 hfp_hf_bluez5: Add registering Audio Card
This patch registers the Handsfree Audio Card when the service level
connection is established.
2013-02-28 10:09:33 -06:00
Patrik Flykt 71551c98a9 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.
2013-02-26 14:15:44 -06:00
Denis Kenzior 2f8b9ab50c bluez5: ref / unref handsfree audio 2013-02-21 08:30:03 -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 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
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
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
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
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 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
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
Denis Kenzior 8bd6b7c6c5 phonesim: Add support for SIM hotswap 2013-01-01 23:16:05 -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
Christopher Vogl 157c365ca5 telit: set baud rate to 115200
Telit HE910 needs the baud rate to be set.
2012-12-17 10:17:19 -06:00
Denis Kenzior 6e3a6156b3 ifx: Bump the setup timeout
The newer IFX firmware was changed, it no longer accepts AT commands
until the UA frame has been sent back to the AP.  The commands are
simply dropped on the floor.  This requires a proper fix in GAtMux, but
until then simply bump up the timeout to get around this issue.
2012-11-28 10:31:15 -06:00
Denis Kenzior e9d15ae899 ifx: Rework SIM state handling
When performing a SIM REFRESH, particularly NAA Initialization, we need
to wait until the modem sends XSIMSTATE: 7, not XSIMSTATE:2.  Even on
normal initialization it seems safer to wait until XSIMSTATE:2.
2012-11-28 10:31:14 -06:00
Marcel Holtmann 6df6688f61 udev: Let Huawei detection also check for cdc_wdm drivers 2012-11-25 20:00:38 +01:00
Marcel Holtmann adf93dc436 udev: Use Qualcomm Gobi driver if QMI based modem 2012-11-25 20:00:07 +01:00
Marcel Holtmann 589a8997c0 udev: Handle USB descriptors from Vodafone K5005 modem 2012-11-25 19:57:43 +01:00
Marcel Holtmann 93688c390e gobi: Use UIM service is available 2012-11-25 19:56:42 +01:00
Denis Kenzior 8b339a4754 ifx: Move connman atom to post_sim state 2012-11-22 06:50:09 -06:00
Denis Kenzior 792c9c02f8 ifx: Get rid of have_sim tracking 2012-11-22 06:50:08 -06:00
Marcel Holtmann d36e4b7580 ifx: Add comments about unhandled SIM states 2012-11-23 16:41:23 +01:00
Cedric Jehasse f61cf95765 alcatel: create sim atom with vendor alcatel 2012-11-15 12:31:02 -06:00
Denis Kenzior 2bc5871d52 mbm: Fix SIM not inserted detection 2012-11-07 07:59:57 -06:00
Denis Kenzior f8e856a4c4 stktest: Label stktest modem as type TEST 2012-11-02 14:04:49 -05:00