Nokia N9 specific quirks
v4 cover Nokia N9 specific quirks
From: Timo Mueller <[email protected]>
Hi,
this is the same as v3 with the changes suggested by Denis.
v4 changes:
* Retry CLCC request on outgoing callsetup is now a N9 specific quirk
* Third patch has been split up according to HACKING rules
The idea of setting the vendor during runtime was to use the "Model" string of the ofono_modem (analogous to what the wavecom modem does). But as the Nokia N9 does not support the device ID profile and the BT address has an OUI from Texas Instruments, I wasn't able to determine that the hfpmodem is a Nokia N9. Maybe you have some ideas on how this can be determined properly?
As currently there's no functionality to detect the vendor of a hfpmodem on runtime the clcc quirk can be enabled for all vendors by patching the needs_callheld_clcc_quirk method.
Regards,
Timo
Timo Mueller (8):
hfpmodem: Add modem vendor stub
hfpmodem: Add vendor header to makefile
hfpmodem: Add vendor information to voicecall data
hfp_hf_bluez4: Pass vendor on voicecall creation
hfp_hf_bluez5: Pass vendor on voicecall creation
hfpmodem: Add method to query if CLCC quirks are needed
hfpmodem: Add N9 quirk for outgoing callsetup
hfpmodem: Add N9 quirk for callheld=<2 or 3>
Makefile.am | 3 +- drivers/hfpmodem/vendor.h | 26 +++++++++++++++ drivers/hfpmodem/voicecall.c | 77 +++++++++++++++++++++++++++++++++++++++++--- plugins/hfp_hf_bluez4.c | 4 ++- plugins/hfp_hf_bluez5.c | 5 ++- 5 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 drivers/hfpmodem/vendor.h
Signature · 1 line
1.7.11.7
PATCH v4 1/8 hfpmodem: Add modem vendor stub
From: Timo Mueller <[email protected]>
--- drivers/hfpmodem/vendor.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 drivers/hfpmodem/vendor.h
drivers/hfpmodem/vendor.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* +* oFono - Open Source Telephony +* +* Copyright (C) 2008-2011 Intel Corporation. All rights reserved. +* Copyright (C) 2013 BWM Car IT GmbH. All rights reserved. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +* +*/ + +enum ofono_vendor { +OFONO_VENDOR_GENERIC =0 +};
Signature · 1 line
1.7.11.7
PATCH v4 2/8 hfpmodem: Add vendor header to makefile
From: Timo Mueller <[email protected]>
--- Makefile.am | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Makefile.am +2 -1
@@ -310,7 +310,8 @@ builtin_sources += drivers/atmodem/atutil.h \ drivers/hfpmodem/network-registration.c \ drivers/hfpmodem/call-volume.c \ drivers/hfpmodem/devinfo.c \ - drivers/hfpmodem/handsfree.c + drivers/hfpmodem/handsfree.c \ + drivers/hfpmodem/vendor.h builtin_modules += speedupmodem builtin_sources += drivers/atmodem/atutil.h \
Signature · 1 line
1.7.11.7
PATCH v4 3/8 hfpmodem: Add vendor information to voicecall data
From: Timo Mueller <[email protected]>
--- drivers/hfpmodem/voicecall.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/hfpmodem/voicecall.c +3 -0
@@ -35,6 +35,7 @@#include <ofono/log.h> #include <ofono/modem.h> #include <ofono/voicecall.h> +#include "vendor.h" #include "common.h"
@@ -60,6 +61,7 @@ struct voicecall_data {unsigned int clcc_source;unsigned int expect_release_source;unsigned int clip_source; +enum ofono_vendor vendor; };struct release_id_req {
@@ -1135,6 +1137,7 @@ static int hfp_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor, vd->chat =g_at_chat_clone (info->chat); vd->ag_features = info->ag_features; vd->ag_mpty_features = info->ag_mpty_features; + vd->vendor = vendor;memcpy (vd->cind_pos, info->cind_pos,HFP_INDICATOR_LAST );memcpy (vd->cind_val, info->cind_val,HFP_INDICATOR_LAST );
Signature · 1 line
1.7.11.7
PATCH v4 4/8 hfp_hf_bluez4: Pass vendor on voicecall creation
From: Timo Mueller <[email protected]>
--- plugins/hfp_hf_bluez4.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
plugins/hfp_hf_bluez4.c +3 -1
@@ -46,6 +46,7 @@#include <ofono/handsfree.h> #include <drivers/hfpmodem/slc.h> +#include <drivers/hfpmodem/vendor.h> #include "bluez4.h"
@@ -482,11 +483,12 @@ static int hfp_disable(struct ofono_modem *modem)static void hfp_pre_sim (struct ofono_modem *modem) {struct hfp_data *data =ofono_modem_get_data (modem); +enum ofono_vendor vendor =OFONO_VENDOR_GENERIC ;DBG ("%p" , modem);ofono_devinfo_create (modem,0 ,"hfpmodem" , data->handsfree_address); -ofono_voicecall_create (modem,0 ,"hfpmodem" , &data->info); +ofono_voicecall_create (modem, vendor,"hfpmodem" , &data->info);ofono_netreg_create (modem,0 ,"hfpmodem" , &data->info);ofono_call_volume_create (modem,0 ,"hfpmodem" , &data->info);ofono_handsfree_create (modem,0 ,"hfpmodem" , &data->info);
Signature · 1 line
1.7.11.7
PATCH v4 5/8 hfp_hf_bluez5: Pass vendor on voicecall creation
From: Timo Mueller <[email protected]>
--- plugins/hfp_hf_bluez5.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
plugins/hfp_hf_bluez5.c +4 -1
@@ -50,6 +50,7 @@#include <ofono/handsfree-audio.h> #include <drivers/hfpmodem/slc.h> +#include <drivers/hfpmodem/vendor.h> #include "bluetooth.h" #include "bluez5.h"
@@ -283,12 +284,14 @@ static int hfp_disable(struct ofono_modem *modem)static void hfp_pre_sim (struct ofono_modem *modem) {struct hfp *hfp =ofono_modem_get_data (modem); +enum ofono_vendor vendor =OFONO_VENDOR_GENERIC ; +char *address = (char *)ofono_modem_get_string (modem,"Remote" );DBG ("%p" , modem);ofono_devinfo_create (modem,0 ,"hfpmodem" , address); -ofono_voicecall_create (modem,0 ,"hfpmodem" , &hfp->info); +ofono_voicecall_create (modem, vendor,"hfpmodem" , &hfp->info);ofono_netreg_create (modem,0 ,"hfpmodem" , &hfp->info);ofono_handsfree_create (modem,0 ,"hfpmodem" , &hfp->info);ofono_call_volume_create (modem,0 ,"hfpmodem" , &hfp->info);
Signature · 1 line
1.7.11.7
PATCH v4 6/8 hfpmodem: Add method to query if CLCC quirks are needed
From: Timo Mueller <[email protected]>
--- drivers/hfpmodem/vendor.h | 3 ++- drivers/hfpmodem/voicecall.c | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)
drivers/hfpmodem/vendor.h +2 -1
@@ -21,5 +21,6 @@*/ enum ofono_vendor { -OFONO_VENDOR_GENERIC =0 +OFONO_VENDOR_GENERIC =0 , +OFONO_VENDOR_NOKIA_N9 };
drivers/hfpmodem/voicecall.c +12 -0
@@ -95,6 +95,18 @@ static GSList *find_dialing(GSList *calls)return c; } +static gboolean needs_callheld_clcc_quirk (int vendor) +{ +switch (vendor) { +case OFONO_VENDOR_NOKIA_N9 : +return TRUE; +case OFONO_VENDOR_GENERIC : +return FALSE; + } + +return FALSE; +} +static void voicecall_notify (gpointer value,gpointer user) {struct ofono_call *call = value;
Signature · 1 line
1.7.11.7
PATCH v4 7/8 hfpmodem: Add N9 quirk for outgoing callsetup
From: Timo Mueller <[email protected]>
Currently the list of current calls is requested right after an outgoing callsetup has been reported by the AG device. If the AG device updates the list after reporting the callsetup the +CLCC response may not contain the new call and it is not registered with oFono.
In this case AT+CLCC should be requested again once after a small delay.
AT sequence that exhibited the failure (AG device was a Nokia N9 placing an outgoing call)
< \r\n+CIEV: 5,2\r\n
Quoted 1 line
AT+CLCC\r
< \r\nOK\r\n
< \r\n+VGS=7\r\n
< \r\n+VGM=7\r\n
< \r\n+CIEV: 5,3\r\n
< \r\n+CIEV: 4,1\r\n
< \r\n+CIEV: 5,0\r\n
--- drivers/hfpmodem/voicecall.c | 50 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 45 insertions(+), 5 deletions(-)
drivers/hfpmodem/voicecall.c +45 -5
@@ -217,11 +217,10 @@ static void release_with_status(struct ofono_voicecall *vc, int status) } } -static void clcc_poll_cb (gboolean ok,GAtResult *result,gpointer user_data) +static void handle_clcc_response (gboolean ok,GSList *calls,gpointer user_data) {struct ofono_voicecall *vc = user_data;struct voicecall_data *vd =ofono_voicecall_get_data (vc); -GSList *calls;GSList *n, *o;struct ofono_call *nc, *oc;unsigned int num_active =0 ;
@@ -231,8 +230,6 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data)if (!ok)return ; - calls =at_util_parse_clcc (result); - n = calls; o = vd->calls;
@@ -309,6 +306,43 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data) vc); } +static void clcc_poll_cb (gboolean ok,GAtResult *result,gpointer user_data) +{ +GSList *calls; + +if (!ok) +return ; + + calls =at_util_parse_clcc (result); + +handle_clcc_response (ok, calls, user_data); +} + +static void clcc_poll_dialing_cb (gboolean ok,GAtResult *result, +gpointer user_data) +{ +struct ofono_voicecall *vc = user_data; +struct voicecall_data *vd =ofono_voicecall_get_data (vc); +GSList *calls, *dialing; + +if (!ok) +return ; + + calls =at_util_parse_clcc (result); + dialing =find_dialing (calls); + +if (dialing ==NULL ) { +if (vd->clcc_source) +g_source_remove (vd->clcc_source); + + vd->clcc_source =g_timeout_add (POLL_CLCC_DELAY , + poll_clcc, vc); +return ; + } + +handle_clcc_response (ok, calls, user_data); +} +static gboolean poll_clcc (gpointer user_data) {struct ofono_voicecall *vc = user_data;
@@ -990,8 +1024,14 @@ static void ciev_callsetup_notify(struct ofono_voicecall *vc,* from HF: query and sync the phone number. * from AG: query and create call. */ -g_at_chat_send (vd->chat,"AT+CLCC" , clcc_prefix, +if (needs_callheld_clcc_quirk (vd->vendor)) { +g_at_chat_send (vd->chat,"AT+CLCC" , clcc_prefix, + clcc_poll_dialing_cb, vc,NULL ); + }else { +g_at_chat_send (vd->chat,"AT+CLCC" , clcc_prefix, clcc_poll_cb, vc,NULL ); + } +break ;case 3 :
Signature · 1 line
1.7.11.7
PATCH v4 8/8 hfpmodem: Add N9 quirk for callheld=<2 or 3>
From: Timo Mueller <[email protected]>
On the Nokia N9 with a call being active, placing a second call on the AG device will lead to the active call being put on hold. During the transition the phone does not update the list of current calls. This leads to an +CLCC response that does not contain the new outgoing call, even though an outgoing callsetup was reported.
The list will be updated once the active call was put on hold and callheld=2 is reported. In this case the list has to be requested again (AT+CLCC).
AT sequence that exhibited the failure (AG device was a Nokia N9 having an active outgoing call and placing a second outgoing call)
< \r\n+CIEV: 5,2\r\n
Quoted 1 line
AT+CLCC\r
< \r\n+CLCC: 1,0,0,0,0,"+49xxx1",145\r\n
< \r\nOK\r\n
< \r\n+CIEV: 6,2\r\n
< \r\n+CIEV: 5,3\r\n
< \r\n+CIEV: 6,1\r\n
Quoted 1 line
AT+CLCC\r
< \r\n+CIEV: 5,0\r\n
< \r\n+CLCC: 1,0,1,0,0,"+49xxx1",145\r\n
< \r\n+CLCC: 2,0,0,0,0,"+49xxx2",145\r\n
< \r\nOK\r\n
--- drivers/hfpmodem/voicecall.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/hfpmodem/voicecall.c +12 -0
@@ -1063,8 +1063,10 @@ static void ciev_callheld_notify(struct ofono_voicecall *vc, {struct voicecall_data *vd =ofono_voicecall_get_data (vc);GSList *l; +GSList *dialing;struct ofono_call *call;unsigned int callheld = vd->cind_val[HFP_INDICATOR_CALLHELD ]; +unsigned int callsetup = vd->cind_val[HFP_INDICATOR_CALLSETUP ];switch (value) {case 0 :
@@ -1100,6 +1102,16 @@ static void ciev_callheld_notify(struct ofono_voicecall *vc, call->status =CALL_STATUS_HELD ;ofono_voicecall_notify (vc, call); } + +if (needs_callheld_clcc_quirk (vd->vendor)) { +if (callsetup ==2 || callsetup ==3 ) { + dialing =find_dialing (vd->calls); + +if (dialing ==NULL ) +g_at_chat_send (vd->chat,"AT+CLCC" , clcc_prefix, + clcc_poll_cb, vc,NULL ); + } + } }else if (callheld ==1 ) {if (vd->clcc_source)g_source_remove (vd->clcc_source);
Signature · 1 line
1.7.11.7
Timo Mueller wrote, On 28.03.2013 14:36:
Quoted 34 lines
From: Timo Mueller <[email protected]>
Hi,
this is the same as v3 with the changes suggested by Denis.
v4 changes:
* Retry CLCC request on outgoing callsetup is now a N9 specific quirk
* Third patch has been split up according to HACKING rulesThe idea of setting the vendor during runtime was to use the "Model" string of the
ofono_modem(analogous to what the wavecom modem does). But as the Nokia N9 does not support the device ID profile and the BT address has an OUI from Texas Instruments, I wasn't able to determine that the hfpmodem is a Nokia N9. Maybe you have some ideas on how this can be determined properly?As currently there's no functionality to detect the vendor of a hfpmodem on runtime the clcc quirk can be enabled for all vendors by patching the
needs_callheld_clcc_quirkmethod.Regards,
TimoTimo Mueller (8):
hfpmodem: Add modem vendor stub
hfpmodem: Add vendor header to makefile
hfpmodem: Add vendor information to voicecall data
hfp_hf_bluez4: Pass vendor on voicecall creation
hfp_hf_bluez5: Pass vendor on voicecall creation
hfpmodem: Add method to query if CLCC quirks are needed
hfpmodem: Add N9 quirk for outgoing callsetup
hfpmodem: Add N9 quirk for callheld=<2 or 3>
Quoted 8 lines
Makefile.am | 3 +- drivers/hfpmodem/vendor.h | 26 +++++++++++++++ drivers/hfpmodem/voicecall.c | 77 +++++++++++++++++++++++++++++++++++++++++--- plugins/hfp_hf_bluez4.c | 4 ++- plugins/hfp_hf_bluez5.c | 5 ++- 5 files changed, 107 insertions(+), 8 deletions(-)create mode 100644
drivers/hfpmodem/vendor.h
Ping
Timo Müller wrote, On 15.04.2013 16:10:
Quoted 45 lines
Timo Mueller wrote, On 28.03.2013 14:36:
Quoted 34 lines
From: Timo Mueller <[email protected]>
Hi,
this is the same as v3 with the changes suggested by Denis.
v4 changes:
* Retry CLCC request on outgoing callsetup is now a N9 specific quirk
* Third patch has been split up according to HACKING rulesThe idea of setting the vendor during runtime was to use the "Model" string of the
ofono_modem(analogous to what the wavecom modem does). But as the Nokia N9 does not support the device ID profile and the BT address has an OUI from Texas Instruments, I wasn't able to determine that the hfpmodem is a Nokia N9. Maybe you have some ideas on how this can be determined properly?As currently there's no functionality to detect the vendor of a hfpmodem on runtime the clcc quirk can be enabled for all vendors by patching the
needs_callheld_clcc_quirkmethod.Regards,
TimoTimo Mueller (8):
hfpmodem: Add modem vendor stub
hfpmodem: Add vendor header to makefile
hfpmodem: Add vendor information to voicecall data
hfp_hf_bluez4: Pass vendor on voicecall creation
hfp_hf_bluez5: Pass vendor on voicecall creation
hfpmodem: Add method to query if CLCC quirks are needed
hfpmodem: Add N9 quirk for outgoing callsetup
hfpmodem: Add N9 quirk for callheld=<2 or 3>Quoted 9 lines
Makefile.am | 3 +- drivers/hfpmodem/vendor.h | 26 +++++++++++++++ drivers/hfpmodem/voicecall.c | 77 +++++++++++++++++++++++++++++++++++++++++--- plugins/hfp_hf_bluez4.c | 4 ++- plugins/hfp_hf_bluez5.c | 5 ++- 5 files changed, 107 insertions(+), 8 deletions(-)create mode 100644
drivers/hfpmodem/vendor.h
Quoted 1 line
Ping
Ping