Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Send the Extended Error result code, if requested in the failure cases
@ 2012-01-11 16:03 Syam Sidhardhan
  2012-01-11 16:42 ` Johan Hedberg
  0 siblings, 1 reply; 3+ messages in thread
From: Syam Sidhardhan @ 2012-01-11 16:03 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Syam Sidhardhan

If HF has already requested for the Extended Error result code reporting,
then send the same in certain failure cases. Earlier in this case we were
sending normal Error.
---
 audio/headset.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/audio/headset.c b/audio/headset.c
index 6aef6a8..5455340 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -1331,7 +1331,13 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond,
 		if (err == -EINVAL) {
 			error("Badly formated or unrecognized command: %s",
 					&slc->buf[slc->data_start]);
-			err = headset_send(hs, "\r\nERROR\r\n");
+
+			if (slc->cme_enabled)
+				err = headset_send(hs, "\r\n+CME ERROR: %d\r\n",
+						CME_ERROR_NOT_SUPPORTED);
+			else
+				err = headset_send(hs, "\r\nERROR\r\n");
+
 			if (err < 0)
 				goto failed;
 		} else if (err < 0)
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Send the Extended Error result code, if requested in the failure cases
  2012-01-11 16:03 [PATCH] Send the Extended Error result code, if requested in the failure cases Syam Sidhardhan
@ 2012-01-11 16:42 ` Johan Hedberg
  2012-01-12 15:35   ` Syam Sidhardhan
  0 siblings, 1 reply; 3+ messages in thread
From: Johan Hedberg @ 2012-01-11 16:42 UTC (permalink / raw)
  To: Syam Sidhardhan; +Cc: linux-bluetooth

Hi Syam,

On Wed, Jan 11, 2012, Syam Sidhardhan wrote:
> If HF has already requested for the Extended Error result code reporting,
> then send the same in certain failure cases. Earlier in this case we were
> sending normal Error.
> ---
>  audio/headset.c |    8 +++++++-
>  1 files changed, 7 insertions(+), 1 deletions(-)
> 
> diff --git a/audio/headset.c b/audio/headset.c
> index 6aef6a8..5455340 100644
> --- a/audio/headset.c
> +++ b/audio/headset.c
> @@ -1331,7 +1331,13 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, GIOCondition cond,
>  		if (err == -EINVAL) {
>  			error("Badly formated or unrecognized command: %s",
>  					&slc->buf[slc->data_start]);
> -			err = headset_send(hs, "\r\nERROR\r\n");
> +
> +			if (slc->cme_enabled)
> +				err = headset_send(hs, "\r\n+CME ERROR: %d\r\n",
> +						CME_ERROR_NOT_SUPPORTED);
> +			else
> +				err = headset_send(hs, "\r\nERROR\r\n");
> +
>  			if (err < 0)
>  				goto failed;
>  		} else if (err < 0)

In this case it'd be easier to just do this:

	err = telephony_generic_rsp(device, CME_ERROR_NOT_SUPPORTED);

It'll do the cme_enabled check for you and send the right response
string.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Send the Extended Error result code, if requested in the failure cases
  2012-01-11 16:42 ` Johan Hedberg
@ 2012-01-12 15:35   ` Syam Sidhardhan
  0 siblings, 0 replies; 3+ messages in thread
From: Syam Sidhardhan @ 2012-01-12 15:35 UTC (permalink / raw)
  To: Johan Hedberg; +Cc: linux-bluetooth

Hi Johan,

----- Original Message ----- 
From: "Johan Hedberg" <johan.hedberg@gmail.com>
To: "Syam Sidhardhan" <s.syam@samsung.com>
Cc: <linux-bluetooth@vger.kernel.org>
Sent: Wednesday, January 11, 2012 10:12 PM
Subject: Re: [PATCH] Send the Extended Error result code, if requested in 
the failure cases


> Hi Syam,
>
> On Wed, Jan 11, 2012, Syam Sidhardhan wrote:
>> If HF has already requested for the Extended Error result code reporting,
>> then send the same in certain failure cases. Earlier in this case we were
>> sending normal Error.
>> ---
>>  audio/headset.c |    8 +++++++-
>>  1 files changed, 7 insertions(+), 1 deletions(-)
>>
>> diff --git a/audio/headset.c b/audio/headset.c
>> index 6aef6a8..5455340 100644
>> --- a/audio/headset.c
>> +++ b/audio/headset.c
>> @@ -1331,7 +1331,13 @@ static gboolean rfcomm_io_cb(GIOChannel *chan, 
>> GIOCondition cond,
>>  if (err == -EINVAL) {
>>  error("Badly formated or unrecognized command: %s",
>>  &slc->buf[slc->data_start]);
>> - err = headset_send(hs, "\r\nERROR\r\n");
>> +
>> + if (slc->cme_enabled)
>> + err = headset_send(hs, "\r\n+CME ERROR: %d\r\n",
>> + CME_ERROR_NOT_SUPPORTED);
>> + else
>> + err = headset_send(hs, "\r\nERROR\r\n");
>> +
>>  if (err < 0)
>>  goto failed;
>>  } else if (err < 0)
>
> In this case it'd be easier to just do this:
>
> err = telephony_generic_rsp(device, CME_ERROR_NOT_SUPPORTED);
>
> It'll do the cme_enabled check for you and send the right response
> string.
>
> Johan

I'll correct it and send a new patch.

-Syam
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" 
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-12 15:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 16:03 [PATCH] Send the Extended Error result code, if requested in the failure cases Syam Sidhardhan
2012-01-11 16:42 ` Johan Hedberg
2012-01-12 15:35   ` Syam Sidhardhan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox