From: Szymon Janc <szymon.janc@tieto.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/2] android/handsfree: Don't disconnect on unknown command in SLC
Date: Mon, 09 Feb 2015 15:18:16 +0100 [thread overview]
Message-ID: <1676628.j94jvBEq7a@leonov> (raw)
In-Reply-To: <1423477896-5082-1-git-send-email-szymon.janc@tieto.com>
On Monday 09 of February 2015 11:31:35 Szymon Janc wrote:
> When connecting HFP simply reply with ERROR to any command not related
> to SLC creation but don't disconnect in such case.
>
> This fix connection issue with Jaguar XF 2009 carkit that sends
> AT+CPIN? command before AT+BRSF.
> ---
> android/handsfree.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/android/handsfree.c b/android/handsfree.c
> index 76f5653..4020ed5 100644
> --- a/android/handsfree.c
> +++ b/android/handsfree.c
> @@ -315,12 +315,6 @@ static void at_cmd_unknown(const char *command, void
> *user_data) uint8_t buf[IPC_MTU];
> struct hal_ev_handsfree_unknown_at *ev = (void *) buf;
>
> - if (dev->state != HAL_EV_HANDSFREE_CONN_STATE_SLC_CONNECTED) {
> - hfp_gw_send_result(dev->gw, HFP_RESULT_ERROR);
> - hfp_gw_disconnect(dev->gw);
> - return;
> - }
> -
> bdaddr2android(&dev->bdaddr, ev->bdaddr);
>
> /* copy while string including terminating NULL */
> @@ -1147,6 +1141,8 @@ static void at_cmd_ckpd(struct hfp_context *result,
> enum hfp_gw_cmd_type type,
>
> static void register_post_slc_at(struct hf_device *dev)
> {
> + hfp_gw_set_command_handler(dev->gw, at_cmd_unknown, dev, NULL);
> +
> if (dev->hsp) {
> hfp_gw_register(dev->gw, at_cmd_ckpd, "+CKPD", dev, NULL);
> hfp_gw_register(dev->gw, at_cmd_vgs, "+VGS", dev, NULL);
> @@ -1468,7 +1464,6 @@ static void connect_cb(GIOChannel *chan, GError *err,
> gpointer user_data) g_io_channel_set_close_on_unref(chan, FALSE);
>
> hfp_gw_set_close_on_unref(dev->gw, true);
> - hfp_gw_set_command_handler(dev->gw, at_cmd_unknown, dev, NULL);
> hfp_gw_set_disconnect_handler(dev->gw, disconnect_watch, dev, NULL);
>
> if (dev->hsp) {
Applied.
--
BR
Szymon Janc
prev parent reply other threads:[~2015-02-09 14:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-09 10:31 [PATCH 1/2] android/handsfree: Don't disconnect on unknown command in SLC Szymon Janc
2015-02-09 10:31 ` [PATCH 2/2] android/handsfree: Relax AT+CMER handling Szymon Janc
2015-02-09 14:18 ` Szymon Janc [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1676628.j94jvBEq7a@leonov \
--to=szymon.janc@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox