linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH ] core/gatt: Parse InProgress error code from err_msg
@ 2015-04-02  9:26 Gowtham Anandha Babu
  2015-04-08 10:31 ` Gowtham Anandha Babu
  0 siblings, 1 reply; 4+ messages in thread
From: Gowtham Anandha Babu @ 2015-04-02  9:26 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: bharat.panda, cpgs, Gowtham Anandha Babu

In Common Profile and Service Error Code descriptions (Supplement
to Bluetooth Core Specification, sections 1.2 and 2), it is
mentioned that following error codes are sent over the Attribute
Protocol.
1)Client Characteristic Configuration Descriptor Improperly Configured(0xFD)
2)Procedure Already in Progress(0xFE)
3)Out of Range(0xFF)

It should be treated as ATT Error codes. So, moved those to att-types.h
and handled org.bluez.Error.InProgress.
---
 src/gatt-database.c    |  4 +++-
 src/shared/att-types.h | 10 ++++++++++
 src/shared/att.c       | 10 ----------
 3 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/src/gatt-database.c b/src/gatt-database.c
index bbeb7cd..fd456e5 100644
--- a/src/gatt-database.c
+++ b/src/gatt-database.c
@@ -1441,7 +1441,6 @@ static bool parse_primary(GDBusProxy *proxy, bool *primary)
 
 static uint8_t dbus_error_to_att_ecode(const char *error_name)
 {
-	/* TODO: Parse error ATT ecode from error_message */
 
 	if (strcmp(error_name, "org.bluez.Error.Failed") == 0)
 		return 0x80;  /* For now return this "application error" */
@@ -1455,6 +1454,9 @@ static uint8_t dbus_error_to_att_ecode(const char *error_name)
 	if (strcmp(error_name, "org.bluez.Error.InvalidValueLength") == 0)
 		return BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN;
 
+	if (strcmp(error_name, "org.bluez.Error.InProgress") == 0)
+		return BT_ERROR_ALREADY_IN_PROGRESS;
+
 	return 0;
 }
 
diff --git a/src/shared/att-types.h b/src/shared/att-types.h
index aa7f0da..10a42f2 100644
--- a/src/shared/att-types.h
+++ b/src/shared/att-types.h
@@ -92,6 +92,16 @@ struct bt_att_pdu_error_rsp {
 #define BT_ATT_ERROR_INSUFFICIENT_RESOURCES		0x11
 
 /*
+ * Common Profile and Service Error Code descriptions (see Supplement to the
+ * Bluetooth Core Specification, sections 1.2 and 2). The error codes within
+ * 0xE0-0xFC are reserved for future use. The remaining 3 are defined as the
+ * following:
+ */
+#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED      0xfd
+#define BT_ERROR_ALREADY_IN_PROGRESS            0xfe
+#define BT_ERROR_OUT_OF_RANGE                   0xff
+
+/*
  * ATT attribute permission bitfield values. Permissions are grouped as
  * "Access", "Encryption", "Authentication", and "Authorization". A bitmask of
  * permissions is a byte that encodes a combination of these.
diff --git a/src/shared/att.c b/src/shared/att.c
index 422cc2c..b920eb8 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -43,16 +43,6 @@
 #define ATT_OP_SIGNED_MASK		0x80
 #define ATT_TIMEOUT_INTERVAL		30000  /* 30000 ms */
 
-/*
- * Common Profile and Service Error Code descriptions (see Supplement to the
- * Bluetooth Core Specification, sections 1.2 and 2). The error codes within
- * 0xE0-0xFC are reserved for future use. The remaining 3 are defined as the
- * following:
- */
-#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED	0xfd
-#define BT_ERROR_ALREADY_IN_PROGRESS		0xfe
-#define BT_ERROR_OUT_OF_RANGE			0xff
-
 /* Length of signature in write signed packet */
 #define BT_ATT_SIGNATURE_LEN		12
 
-- 
1.9.1


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

* RE: [PATCH ] core/gatt: Parse InProgress error code from err_msg
  2015-04-02  9:26 [PATCH ] core/gatt: Parse InProgress error code from err_msg Gowtham Anandha Babu
@ 2015-04-08 10:31 ` Gowtham Anandha Babu
  2015-04-13  9:33   ` Gowtham Anandha Babu
  0 siblings, 1 reply; 4+ messages in thread
From: Gowtham Anandha Babu @ 2015-04-08 10:31 UTC (permalink / raw)
  To: linux-bluetooth

Ping.

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
> Sent: Thursday, April 02, 2015 2:56 PM
> To: linux-bluetooth@vger.kernel.org
> Cc: bharat.panda@samsung.com; cpgs@samsung.com; Gowtham Anandha
> Babu
> Subject: [PATCH ] core/gatt: Parse InProgress error code from err_msg
> 
> In Common Profile and Service Error Code descriptions (Supplement to
> Bluetooth Core Specification, sections 1.2 and 2), it is mentioned that
> following error codes are sent over the Attribute Protocol.
> 1)Client Characteristic Configuration Descriptor Improperly
Configured(0xFD)
> 2)Procedure Already in Progress(0xFE) 3)Out of Range(0xFF)
> 
> It should be treated as ATT Error codes. So, moved those to att-types.h
and
> handled org.bluez.Error.InProgress.
> ---
>  src/gatt-database.c    |  4 +++-
>  src/shared/att-types.h | 10 ++++++++++
>  src/shared/att.c       | 10 ----------
>  3 files changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/src/gatt-database.c b/src/gatt-database.c index
bbeb7cd..fd456e5
> 100644
> --- a/src/gatt-database.c
> +++ b/src/gatt-database.c
> @@ -1441,7 +1441,6 @@ static bool parse_primary(GDBusProxy *proxy, bool
> *primary)
> 
>  static uint8_t dbus_error_to_att_ecode(const char *error_name)  {
> -	/* TODO: Parse error ATT ecode from error_message */
> 
>  	if (strcmp(error_name, "org.bluez.Error.Failed") == 0)
>  		return 0x80;  /* For now return this "application error" */
> @@ -1455,6 +1454,9 @@ static uint8_t dbus_error_to_att_ecode(const char
> *error_name)
>  	if (strcmp(error_name, "org.bluez.Error.InvalidValueLength") == 0)
>  		return BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN;
> 
> +	if (strcmp(error_name, "org.bluez.Error.InProgress") == 0)
> +		return BT_ERROR_ALREADY_IN_PROGRESS;
> +
>  	return 0;
>  }
> 
> diff --git a/src/shared/att-types.h b/src/shared/att-types.h index
> aa7f0da..10a42f2 100644
> --- a/src/shared/att-types.h
> +++ b/src/shared/att-types.h
> @@ -92,6 +92,16 @@ struct bt_att_pdu_error_rsp {
>  #define BT_ATT_ERROR_INSUFFICIENT_RESOURCES		0x11
> 
>  /*
> + * Common Profile and Service Error Code descriptions (see Supplement
> +to the
> + * Bluetooth Core Specification, sections 1.2 and 2). The error codes
> +within
> + * 0xE0-0xFC are reserved for future use. The remaining 3 are defined
> +as the
> + * following:
> + */
> +#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED      0xfd
> +#define BT_ERROR_ALREADY_IN_PROGRESS            0xfe
> +#define BT_ERROR_OUT_OF_RANGE                   0xff
> +
> +/*
>   * ATT attribute permission bitfield values. Permissions are grouped as
>   * "Access", "Encryption", "Authentication", and "Authorization". A
bitmask
> of
>   * permissions is a byte that encodes a combination of these.
> diff --git a/src/shared/att.c b/src/shared/att.c index 422cc2c..b920eb8
100644
> --- a/src/shared/att.c
> +++ b/src/shared/att.c
> @@ -43,16 +43,6 @@
>  #define ATT_OP_SIGNED_MASK		0x80
>  #define ATT_TIMEOUT_INTERVAL		30000  /* 30000 ms */
> 
> -/*
> - * Common Profile and Service Error Code descriptions (see Supplement to
> the
> - * Bluetooth Core Specification, sections 1.2 and 2). The error codes
within
> - * 0xE0-0xFC are reserved for future use. The remaining 3 are defined as
the
> - * following:
> - */
> -#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED	0xfd
> -#define BT_ERROR_ALREADY_IN_PROGRESS		0xfe
> -#define BT_ERROR_OUT_OF_RANGE			0xff
> -
>  /* Length of signature in write signed packet */
>  #define BT_ATT_SIGNATURE_LEN		12
> 
> --
> 1.9.1
> 
> --
> 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] 4+ messages in thread

* RE: [PATCH ] core/gatt: Parse InProgress error code from err_msg
  2015-04-08 10:31 ` Gowtham Anandha Babu
@ 2015-04-13  9:33   ` Gowtham Anandha Babu
  2015-04-13 15:07     ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 4+ messages in thread
From: Gowtham Anandha Babu @ 2015-04-13  9:33 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: cpgs

Ping.

> -----Original Message-----
> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
> Sent: Wednesday, April 08, 2015 4:01 PM
> To: linux-bluetooth@vger.kernel.org
> Subject: RE: [PATCH ] core/gatt: Parse InProgress error code from err_msg
> 
> Ping.
> 
> > -----Original Message-----
> > From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
> > owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
> > Sent: Thursday, April 02, 2015 2:56 PM
> > To: linux-bluetooth@vger.kernel.org
> > Cc: bharat.panda@samsung.com; cpgs@samsung.com; Gowtham Anandha
> Babu
> > Subject: [PATCH ] core/gatt: Parse InProgress error code from err_msg
> >
> > In Common Profile and Service Error Code descriptions (Supplement to
> > Bluetooth Core Specification, sections 1.2 and 2), it is mentioned
> > that following error codes are sent over the Attribute Protocol.
> > 1)Client Characteristic Configuration Descriptor Improperly
> Configured(0xFD)
> > 2)Procedure Already in Progress(0xFE) 3)Out of Range(0xFF)
> >
> > It should be treated as ATT Error codes. So, moved those to
> > att-types.h
> and
> > handled org.bluez.Error.InProgress.
> > ---
> >  src/gatt-database.c    |  4 +++-
> >  src/shared/att-types.h | 10 ++++++++++
> >  src/shared/att.c       | 10 ----------
> >  3 files changed, 13 insertions(+), 11 deletions(-)
> >
> > diff --git a/src/gatt-database.c b/src/gatt-database.c index
> bbeb7cd..fd456e5
> > 100644
> > --- a/src/gatt-database.c
> > +++ b/src/gatt-database.c
> > @@ -1441,7 +1441,6 @@ static bool parse_primary(GDBusProxy *proxy,
> > bool
> > *primary)
> >
> >  static uint8_t dbus_error_to_att_ecode(const char *error_name)  {
> > -	/* TODO: Parse error ATT ecode from error_message */
> >
> >  	if (strcmp(error_name, "org.bluez.Error.Failed") == 0)
> >  		return 0x80;  /* For now return this "application error" */
> @@
> > -1455,6 +1454,9 @@ static uint8_t dbus_error_to_att_ecode(const char
> > *error_name)
> >  	if (strcmp(error_name, "org.bluez.Error.InvalidValueLength") == 0)
> >  		return BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN;
> >
> > +	if (strcmp(error_name, "org.bluez.Error.InProgress") == 0)
> > +		return BT_ERROR_ALREADY_IN_PROGRESS;
> > +
> >  	return 0;
> >  }
> >
> > diff --git a/src/shared/att-types.h b/src/shared/att-types.h index
> > aa7f0da..10a42f2 100644
> > --- a/src/shared/att-types.h
> > +++ b/src/shared/att-types.h
> > @@ -92,6 +92,16 @@ struct bt_att_pdu_error_rsp {
> >  #define BT_ATT_ERROR_INSUFFICIENT_RESOURCES		0x11
> >
> >  /*
> > + * Common Profile and Service Error Code descriptions (see Supplement
> > +to the
> > + * Bluetooth Core Specification, sections 1.2 and 2). The error codes
> > +within
> > + * 0xE0-0xFC are reserved for future use. The remaining 3 are defined
> > +as the
> > + * following:
> > + */
> > +#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED      0xfd
> > +#define BT_ERROR_ALREADY_IN_PROGRESS            0xfe
> > +#define BT_ERROR_OUT_OF_RANGE                   0xff
> > +
> > +/*
> >   * ATT attribute permission bitfield values. Permissions are grouped as
> >   * "Access", "Encryption", "Authentication", and "Authorization". A
> bitmask
> > of
> >   * permissions is a byte that encodes a combination of these.
> > diff --git a/src/shared/att.c b/src/shared/att.c index
> > 422cc2c..b920eb8
> 100644
> > --- a/src/shared/att.c
> > +++ b/src/shared/att.c
> > @@ -43,16 +43,6 @@
> >  #define ATT_OP_SIGNED_MASK		0x80
> >  #define ATT_TIMEOUT_INTERVAL		30000  /* 30000 ms */
> >
> > -/*
> > - * Common Profile and Service Error Code descriptions (see Supplement
> > to the
> > - * Bluetooth Core Specification, sections 1.2 and 2). The error codes
> within
> > - * 0xE0-0xFC are reserved for future use. The remaining 3 are defined
> > as
> the
> > - * following:
> > - */
> > -#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED	0xfd
> > -#define BT_ERROR_ALREADY_IN_PROGRESS		0xfe
> > -#define BT_ERROR_OUT_OF_RANGE			0xff
> > -
> >  /* Length of signature in write signed packet */
> >  #define BT_ATT_SIGNATURE_LEN		12
> >
> > --
> > 1.9.1
> >
> > --
> > 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
> 
> --
> 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] 4+ messages in thread

* Re: [PATCH ] core/gatt: Parse InProgress error code from err_msg
  2015-04-13  9:33   ` Gowtham Anandha Babu
@ 2015-04-13 15:07     ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 4+ messages in thread
From: Luiz Augusto von Dentz @ 2015-04-13 15:07 UTC (permalink / raw)
  To: Gowtham Anandha Babu; +Cc: linux-bluetooth@vger.kernel.org, cpgs

Hi Gowtham,

On Mon, Apr 13, 2015 at 12:33 PM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Ping.
>
>> -----Original Message-----
>> From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
>> Sent: Wednesday, April 08, 2015 4:01 PM
>> To: linux-bluetooth@vger.kernel.org
>> Subject: RE: [PATCH ] core/gatt: Parse InProgress error code from err_msg
>>
>> Ping.
>>
>> > -----Original Message-----
>> > From: linux-bluetooth-owner@vger.kernel.org [mailto:linux-bluetooth-
>> > owner@vger.kernel.org] On Behalf Of Gowtham Anandha Babu
>> > Sent: Thursday, April 02, 2015 2:56 PM
>> > To: linux-bluetooth@vger.kernel.org
>> > Cc: bharat.panda@samsung.com; cpgs@samsung.com; Gowtham Anandha
>> Babu
>> > Subject: [PATCH ] core/gatt: Parse InProgress error code from err_msg
>> >
>> > In Common Profile and Service Error Code descriptions (Supplement to
>> > Bluetooth Core Specification, sections 1.2 and 2), it is mentioned
>> > that following error codes are sent over the Attribute Protocol.
>> > 1)Client Characteristic Configuration Descriptor Improperly
>> Configured(0xFD)
>> > 2)Procedure Already in Progress(0xFE) 3)Out of Range(0xFF)
>> >
>> > It should be treated as ATT Error codes. So, moved those to
>> > att-types.h
>> and
>> > handled org.bluez.Error.InProgress.
>> > ---
>> >  src/gatt-database.c    |  4 +++-
>> >  src/shared/att-types.h | 10 ++++++++++
>> >  src/shared/att.c       | 10 ----------
>> >  3 files changed, 13 insertions(+), 11 deletions(-)
>> >
>> > diff --git a/src/gatt-database.c b/src/gatt-database.c index
>> bbeb7cd..fd456e5
>> > 100644
>> > --- a/src/gatt-database.c
>> > +++ b/src/gatt-database.c
>> > @@ -1441,7 +1441,6 @@ static bool parse_primary(GDBusProxy *proxy,
>> > bool
>> > *primary)
>> >
>> >  static uint8_t dbus_error_to_att_ecode(const char *error_name)  {
>> > -   /* TODO: Parse error ATT ecode from error_message */
>> >
>> >     if (strcmp(error_name, "org.bluez.Error.Failed") == 0)
>> >             return 0x80;  /* For now return this "application error" */
>> @@
>> > -1455,6 +1454,9 @@ static uint8_t dbus_error_to_att_ecode(const char
>> > *error_name)
>> >     if (strcmp(error_name, "org.bluez.Error.InvalidValueLength") == 0)
>> >             return BT_ATT_ERROR_INVALID_ATTRIBUTE_VALUE_LEN;
>> >
>> > +   if (strcmp(error_name, "org.bluez.Error.InProgress") == 0)
>> > +           return BT_ERROR_ALREADY_IN_PROGRESS;
>> > +
>> >     return 0;
>> >  }
>> >
>> > diff --git a/src/shared/att-types.h b/src/shared/att-types.h index
>> > aa7f0da..10a42f2 100644
>> > --- a/src/shared/att-types.h
>> > +++ b/src/shared/att-types.h
>> > @@ -92,6 +92,16 @@ struct bt_att_pdu_error_rsp {
>> >  #define BT_ATT_ERROR_INSUFFICIENT_RESOURCES                0x11
>> >
>> >  /*
>> > + * Common Profile and Service Error Code descriptions (see Supplement
>> > +to the
>> > + * Bluetooth Core Specification, sections 1.2 and 2). The error codes
>> > +within
>> > + * 0xE0-0xFC are reserved for future use. The remaining 3 are defined
>> > +as the
>> > + * following:
>> > + */
>> > +#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED      0xfd
>> > +#define BT_ERROR_ALREADY_IN_PROGRESS            0xfe
>> > +#define BT_ERROR_OUT_OF_RANGE                   0xff
>> > +
>> > +/*
>> >   * ATT attribute permission bitfield values. Permissions are grouped as
>> >   * "Access", "Encryption", "Authentication", and "Authorization". A
>> bitmask
>> > of
>> >   * permissions is a byte that encodes a combination of these.
>> > diff --git a/src/shared/att.c b/src/shared/att.c index
>> > 422cc2c..b920eb8
>> 100644
>> > --- a/src/shared/att.c
>> > +++ b/src/shared/att.c
>> > @@ -43,16 +43,6 @@
>> >  #define ATT_OP_SIGNED_MASK         0x80
>> >  #define ATT_TIMEOUT_INTERVAL               30000  /* 30000 ms */
>> >
>> > -/*
>> > - * Common Profile and Service Error Code descriptions (see Supplement
>> > to the
>> > - * Bluetooth Core Specification, sections 1.2 and 2). The error codes
>> within
>> > - * 0xE0-0xFC are reserved for future use. The remaining 3 are defined
>> > as
>> the
>> > - * following:
>> > - */
>> > -#define BT_ERROR_CCC_IMPROPERLY_CONFIGURED 0xfd
>> > -#define BT_ERROR_ALREADY_IN_PROGRESS               0xfe
>> > -#define BT_ERROR_OUT_OF_RANGE                      0xff
>> > -
>> >  /* Length of signature in write signed packet */
>> >  #define BT_ATT_SIGNATURE_LEN               12
>> >
>> > --
>> > 1.9.1
>> >
>> > --
>> > 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
>>
>> --
>> 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

Applied, thanks.


-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2015-04-13 15:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-02  9:26 [PATCH ] core/gatt: Parse InProgress error code from err_msg Gowtham Anandha Babu
2015-04-08 10:31 ` Gowtham Anandha Babu
2015-04-13  9:33   ` Gowtham Anandha Babu
2015-04-13 15:07     ` Luiz Augusto von Dentz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).