Commit Graph

1298 Commits

Author SHA1 Message Date
Claudio Takahasi cf6dce3445 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.
2013-04-23 10:28:46 -05:00
Paulo Borges 2e9cb14e26 hfp: Move HFP versions definitions to hfp.h
hfp.h should store all HFP related definitions.
2013-04-18 08:43:21 -05:00
Vinicius Costa Gomes df1f9bf730 hfpmodem: Send AT+BAC with the supported codecs
Before, the AT+BAC command was being sent with fixed information,
now we send the command (that inform the AG of the codecs supported by
the HF) with the codecs supported by the registered Handsfree Audio
Agent.
2013-04-09 14:33:41 -05:00
Denis Kenzior b18963af33 drivers: Include hfp.h 2013-04-09 14:33:41 -05:00
Anthony Viallard 8650c1019a sim: Add SIMCOM SIM card ready quirk
SIM is busy right after pin is entered. Use the quirk which
add a CPIN? pooling check until having "CPIN: READY" answer.
2013-04-01 21:38:26 -05: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 2fa7a4a66e netreg: Fix broken CMER behavior on MBM 2013-01-21 10:23:34 -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
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 b67e68e753 sim: Fix whitespace violation 2013-01-15 12:16:08 -06:00
Christopher Vogl 404f2e3cb9 sim: return from cpin when sim ready for telit
Especially for Telit HE910 it is not enough to wait for
entering a PIN code.
If we do not wait for #QSS: 3, subsequent commands,
like +CMER will report SIM BUSY and the network registration
atom will be removed as a consequence.
2012-12-17 09:50:22 -06:00
Daniel Wagner 79453f3284 atutil: Remove unused macro
With commit 6ee21a3fc1
the usage DECLARE_FAILURE was removed.
2012-12-17 09:50:22 -06:00
Denis Kenzior fb1d1c3426 hfp: use ofono_handsfree_battchg_notify 2012-12-17 09:50:22 -06:00
Mingli Wu 911eeb6565 atmodem: remove pending idle callbacks at removal
If device probe and removal happen in short succession, it's possible
that the idle handler registered in the probe function doesn't run before
the device is removed.  In this case, the idle handler needs to be
unregistered so that it does not run and try to access the data that's
destroyed during the removal.
2012-12-04 23:48:14 -06:00
Denis Kenzior 25e7ecd3c7 atmodem: Re-work the CBS driver
We might have mis-interpreted how 27.007 intends for CBS to work.  After
studying the implementation notes of the IMC 6260 modem, the spec intent
made a little bit more sense.
2012-12-04 23:47:58 -06:00
Marcel Holtmann 788922cbdf qmi: Include persistent device configuration service 2012-12-04 05:42:14 +01:00
Marcel Holtmann 15f309742c qmi: Print service number if name is not known 2012-12-01 21:37:22 +01:00
Denis Kenzior 68df0eb758 ifx: Fix the case of modem-originated call
During STK Set Up Call, we have modem-originated calls that do not go
through the core 'Dial' method.  Make sure the calls are still detected
in this case.
2012-11-28 10:31:15 -06:00
Denis Kenzior b26f7c73d3 atmodem: For IFX XSIMSTATE 7 should never occur
in the case of a PIN entry, XSIMSTATE of 7 (Ready to Attach) should
never occur
2012-11-28 10:31:14 -06:00
Marcel Holtmann 076abafb03 qmimodem: Fix reporting of PIN or PUK states 2012-11-27 23:31:52 +01:00
Denis Kenzior 2528b74491 atmodem: Always quote data in CRSM write operations 2012-11-23 07:22:25 -06:00
Denis Kenzior 291f4e0bb0 atmodem: Support CRSM with paths
For GET STATUS and READ BINARY variations, support appending of the
optional path in the CRSM command
2012-11-23 07:22:25 -06:00
Marcel Holtmann 67670a659f qmimodem: Add support for UIM service handling 2012-11-25 20:11:29 +01:00
Marcel Holtmann 56e4798e1e qmimodem: Print error string instead of code if available 2012-11-25 10:19:40 +01:00
Marcel Holtmann 9b4d69cf8d qmimodem: Pretty print service name in debug logs 2012-11-25 00:05:54 +01:00
Marcel Holtmann 535e16c8a4 qmimodem: Fix debug printing of messages 2012-11-25 00:05:15 +01:00
Marcel Holtmann 7feb9e2711 qmimodem: Add helper for error message strings 2012-11-25 00:04:14 +01:00
Denis Kenzior 57692483a9 atmodem: Update sim driver to the new api 2012-11-22 10:26:34 -06:00
Denis Kenzior 180f91f6c9 qmi: Update sim-legacy driver to the new API 2012-11-22 10:26:34 -06:00
Denis Kenzior d32c6451bd isi: Update UICC driver to the new API 2012-11-22 10:26:34 -06:00
Denis Kenzior 6451d012ec isimodem: Update sim driver to the new API 2012-11-22 10:26:34 -06:00
Marcel Holtmann 48a5fec5cc atmodem: Monitor IFX technology and band changes 2012-11-23 16:20:15 +01:00
Cedric Jehasse b728a02981 atmodem: add PIN retry count for Alcatel modems 2012-11-15 12:31:06 -06:00
Cedric Jehasse 5f9c1e9e34 atmodem: Poll SIM state after entering PIN
Encountered a problem of CME ERROR 14: SIM busy on Alcatel and Huawei modem.
The Huawei modem has a ^SIMST unsollicited sim state indication, but not all
Huawei modems support this.
So poll the SIM state, as was already done for ZTE modems.
2012-11-12 13:30:38 -06:00
Cedric Jehasse 0f242c9714 atmodem: Add ALCATEL vendor 2012-11-12 13:30:13 -06:00
Holger Hans Peter Freyther 2b9b1ae6d3 sim: Fix the quirk handling of CPIN for Wavecom
The Wavecom Q2XXX support broke in commit 72ce19bf3e.
This is because at_cpin_cb called decode_at_error with final and not
with OK. This lead to an error being set in the error variable and the
new code returns early when an error is set.

The addition of the terminator in at_sim_probe for Wavecom broke in
git commit ac524be99f because
terminators can not be added on cloned chats.

Move the addition of the terminator from the atmodem to the wavecom
plugin. Use the same terminator for Q2XXX and the normal Wavecom
class. The WAVECOM terminator has been tested on a Q2XXX modem.

Apply the CPIN quirk for both WAVECOM and WAVECOM_Q2XXX inside the
sim.c file. Introduce needs_wavecom_sim_quirk to handle it for
WAVECOM and WAVECOM_Q2XXX.
2012-11-01 04:56:51 -05:00
Denis Kenzior bddfb9bfc5 isimodem: Fix style issues in previous commit 2012-09-11 23:30:25 -05:00
Jarko Poutiainen dc2dc41bcf isimodem: voicecall answer fix for Nemo on N9
Voicecall answering in Mer/Nemomobile run on Nokia N9 will fail
unless call id is passed to modem.
2012-09-11 23:29:43 -05:00
Denis Kenzior b274e74102 netreg: Remove netreg atom in case init fails 2012-09-11 23:21:48 -05:00
Denis Kenzior bb0f308223 netreg: Don't register for CIEV twice 2012-09-11 23:20:53 -05:00
Christopher Vogl edbf04cded netreg: Add telit version for ciev notification 2012-09-11 23:16:32 -05:00
Christopher Vogl b87619a43a netreg: Query and select supported CMER modes 2012-09-11 22:54:43 -05:00
Philippe Nunes 006a37cdf8 atmodem: specify class for call barring query
class is specified when querying the call barring status if
the class is not the default (7 - voice, data and fax)
2012-09-05 15:04:18 -05:00
Christopher Vogl 90c7bdfc8d sim: return from CPIN when SIM unlocked for telit
Only return from CPIN when the modem informs that the SIM is ready
2012-08-22 18:44:18 -05:00
August Mayer 4293e4ea63 gprs: data bearer for telit with PSNT
Telit neither supports '+CPSB' nor reports the data bearer through
'+CGREG'. It has its own +PSNT command.
2012-08-16 01:10:56 -05:00
Denis Kenzior b264440737 sim: Minor formatting nitpicks 2012-08-16 01:05:54 -05:00