public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] GATT: Rename Characteristic Configuration constants
@ 2012-05-29 13:58 Claudio Takahasi
  2012-05-29 13:58 ` [PATCH BlueZ 2/2] GATT: Move GATT assigned numbers to GATT header Claudio Takahasi
  2012-05-30  7:39 ` [PATCH BlueZ 1/2] GATT: Rename Characteristic Configuration constants Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Claudio Takahasi @ 2012-05-29 13:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

This patch renames the constants related to Client Characteristic
Configuration bit field to use a proper name since it is related to
GATT instead of ATT.
---
 attrib/att.h              |    4 ++--
 thermometer/thermometer.c |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/attrib/att.h b/attrib/att.h
index 1e128a7..9bf9092 100644
--- a/attrib/att.h
+++ b/attrib/att.h
@@ -107,8 +107,8 @@
 #define ATT_CHAR_PROPER_EXT_PROPER		0x80
 
 /* Client Characteristic Configuration bit field */
-#define ATT_CLIENT_CHAR_CONF_NOTIFICATION	0x0001
-#define ATT_CLIENT_CHAR_CONF_INDICATION		0x0002
+#define GATT_CLIENT_CHARAC_CFG_NOTIF_BIT	0x0001
+#define GATT_CLIENT_CHARAC_CFG_IND_BIT		0x0002
 
 #define ATT_MAX_MTU				256
 #define ATT_DEFAULT_L2CAP_MTU			48
diff --git a/thermometer/thermometer.c b/thermometer/thermometer.c
index 7ffd401..4df9d2c 100644
--- a/thermometer/thermometer.c
+++ b/thermometer/thermometer.c
@@ -363,7 +363,7 @@ static void process_thermometer_desc(struct descriptor *desc)
 			if (g_slist_length(ch->t->fwatchers) == 0)
 				return;
 
-			val = ATT_CLIENT_CHAR_CONF_INDICATION;
+			val = GATT_CLIENT_CHARAC_CFG_IND_BIT;
 			msg = g_strdup("Enable Temperature Measurement "
 								"indication");
 		} else if (g_strcmp0(ch->attr.uuid,
@@ -371,12 +371,12 @@ static void process_thermometer_desc(struct descriptor *desc)
 			if (g_slist_length(ch->t->iwatchers) == 0)
 				return;
 
-			val = ATT_CLIENT_CHAR_CONF_NOTIFICATION;
+			val = GATT_CLIENT_CHARAC_CFG_NOTIF_BIT;
 			msg = g_strdup("Enable Intermediate Temperature "
 								"notification");
 		} else if (g_strcmp0(ch->attr.uuid,
 					MEASUREMENT_INTERVAL_UUID) == 0) {
-			val = ATT_CLIENT_CHAR_CONF_INDICATION;
+			val = GATT_CLIENT_CHARAC_CFG_IND_BIT;
 			msg = g_strdup("Enable Measurement Interval "
 								"indication");
 		} else
-- 
1.7.8.6


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

* [PATCH BlueZ 2/2] GATT: Move GATT assigned numbers to GATT header
  2012-05-29 13:58 [PATCH BlueZ 1/2] GATT: Rename Characteristic Configuration constants Claudio Takahasi
@ 2012-05-29 13:58 ` Claudio Takahasi
  2012-05-30  7:39 ` [PATCH BlueZ 1/2] GATT: Rename Characteristic Configuration constants Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Claudio Takahasi @ 2012-05-29 13:58 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

---
 attrib/att.h           |   27 ---------------------------
 attrib/gatt-service.c  |    3 ++-
 attrib/gatt.h          |   28 ++++++++++++++++++++++++++++
 plugins/gatt-example.c |    1 +
 proximity/immalert.c   |    3 ++-
 proximity/linkloss.c   |    3 ++-
 proximity/reporter.c   |    3 ++-
 src/attrib-server.c    |    3 ++-
 time/server.c          |    3 ++-
 9 files changed, 41 insertions(+), 33 deletions(-)

diff --git a/attrib/att.h b/attrib/att.h
index 9bf9092..d12a7f2 100644
--- a/attrib/att.h
+++ b/attrib/att.h
@@ -22,29 +22,6 @@
  *
  */
 
-/* GATT Profile Attribute types */
-#define GATT_PRIM_SVC_UUID		0x2800
-#define GATT_SND_SVC_UUID		0x2801
-#define GATT_INCLUDE_UUID		0x2802
-#define GATT_CHARAC_UUID		0x2803
-
-/* GATT Characteristic Types */
-#define GATT_CHARAC_DEVICE_NAME			0x2A00
-#define GATT_CHARAC_APPEARANCE			0x2A01
-#define GATT_CHARAC_PERIPHERAL_PRIV_FLAG	0x2A02
-#define GATT_CHARAC_RECONNECTION_ADDRESS	0x2A03
-#define GATT_CHARAC_PERIPHERAL_PREF_CONN	0x2A04
-#define GATT_CHARAC_SERVICE_CHANGED		0x2A05
-
-/* GATT Characteristic Descriptors */
-#define GATT_CHARAC_EXT_PROPER_UUID	0x2900
-#define GATT_CHARAC_USER_DESC_UUID	0x2901
-#define GATT_CLIENT_CHARAC_CFG_UUID	0x2902
-#define GATT_SERVER_CHARAC_CFG_UUID	0x2903
-#define GATT_CHARAC_FMT_UUID		0x2904
-#define GATT_CHARAC_AGREG_FMT_UUID	0x2905
-#define GATT_CHARAC_VALID_RANGE_UUID	0x2906
-
 /* Attribute Protocol Opcodes */
 #define ATT_OP_ERROR			0x01
 #define ATT_OP_MTU_REQ			0x02
@@ -106,10 +83,6 @@
 #define ATT_CHAR_PROPER_AUTH			0x40
 #define ATT_CHAR_PROPER_EXT_PROPER		0x80
 
-/* Client Characteristic Configuration bit field */
-#define GATT_CLIENT_CHARAC_CFG_NOTIF_BIT	0x0001
-#define GATT_CLIENT_CHARAC_CFG_IND_BIT		0x0002
-
 #define ATT_MAX_MTU				256
 #define ATT_DEFAULT_L2CAP_MTU			48
 #define ATT_DEFAULT_LE_MTU			23
diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c
index d8f7b37..a9de98c 100644
--- a/attrib/gatt-service.c
+++ b/attrib/gatt-service.c
@@ -31,9 +31,10 @@
 #include <bluetooth/sdp.h>
 #include <adapter.h>
 
+#include "gattrib.h"
 #include "att.h"
+#include "gatt.h"
 #include "att-database.h"
-#include "gattrib.h"
 #include "attrib-server.h"
 #include "gatt-service.h"
 #include "log.h"
diff --git a/attrib/gatt.h b/attrib/gatt.h
index 1732270..9ffe58f 100644
--- a/attrib/gatt.h
+++ b/attrib/gatt.h
@@ -21,8 +21,36 @@
  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
+
 #include <bluetooth/sdp.h>
 
+/* GATT Profile Attribute types */
+#define GATT_PRIM_SVC_UUID		0x2800
+#define GATT_SND_SVC_UUID		0x2801
+#define GATT_INCLUDE_UUID		0x2802
+#define GATT_CHARAC_UUID		0x2803
+
+/* GATT Characteristic Types */
+#define GATT_CHARAC_DEVICE_NAME			0x2A00
+#define GATT_CHARAC_APPEARANCE			0x2A01
+#define GATT_CHARAC_PERIPHERAL_PRIV_FLAG	0x2A02
+#define GATT_CHARAC_RECONNECTION_ADDRESS	0x2A03
+#define GATT_CHARAC_PERIPHERAL_PREF_CONN	0x2A04
+#define GATT_CHARAC_SERVICE_CHANGED		0x2A05
+
+/* GATT Characteristic Descriptors */
+#define GATT_CHARAC_EXT_PROPER_UUID	0x2900
+#define GATT_CHARAC_USER_DESC_UUID	0x2901
+#define GATT_CLIENT_CHARAC_CFG_UUID	0x2902
+#define GATT_SERVER_CHARAC_CFG_UUID	0x2903
+#define GATT_CHARAC_FMT_UUID		0x2904
+#define GATT_CHARAC_AGREG_FMT_UUID	0x2905
+#define GATT_CHARAC_VALID_RANGE_UUID	0x2906
+
+/* Client Characteristic Configuration bit field */
+#define GATT_CLIENT_CHARAC_CFG_NOTIF_BIT	0x0001
+#define GATT_CLIENT_CHARAC_CFG_IND_BIT		0x0002
+
 typedef void (*gatt_cb_t) (GSList *l, guint8 status, gpointer user_data);
 
 struct gatt_primary {
diff --git a/plugins/gatt-example.c b/plugins/gatt-example.c
index 482bc2d..cd2c481 100644
--- a/plugins/gatt-example.c
+++ b/plugins/gatt-example.c
@@ -37,6 +37,7 @@
 #include "gattrib.h"
 #include "gatt-service.h"
 #include "att.h"
+#include "gatt.h"
 #include "att-database.h"
 #include "attrib-server.h"
 
diff --git a/proximity/immalert.c b/proximity/immalert.c
index 4aa973f..1540b61 100644
--- a/proximity/immalert.c
+++ b/proximity/immalert.c
@@ -32,9 +32,10 @@
 #include <gdbus.h>
 
 #include "log.h"
+#include "gattrib.h"
 #include "att.h"
+#include "gatt.h"
 #include "att-database.h"
-#include "gattrib.h"
 #include "gatt-service.h"
 #include "attrib-server.h"
 #include "device.h"
diff --git a/proximity/linkloss.c b/proximity/linkloss.c
index 239eba9..14403cb 100644
--- a/proximity/linkloss.c
+++ b/proximity/linkloss.c
@@ -32,9 +32,10 @@
 #include <gdbus.h>
 
 #include "log.h"
-#include "att.h"
 #include "att-database.h"
 #include "gattrib.h"
+#include "att.h"
+#include "gatt.h"
 #include "gatt-service.h"
 #include "attrib-server.h"
 #include "device.h"
diff --git a/proximity/reporter.c b/proximity/reporter.c
index b9872ab..20779a8 100644
--- a/proximity/reporter.c
+++ b/proximity/reporter.c
@@ -40,9 +40,10 @@
 #include "error.h"
 #include "device.h"
 #include "hcid.h"
+#include "gattrib.h"
 #include "att.h"
+#include "gatt.h"
 #include "att-database.h"
-#include "gattrib.h"
 #include "attrib-server.h"
 #include "reporter.h"
 #include "linkloss.h"
diff --git a/src/attrib-server.c b/src/attrib-server.c
index dd1bba4..a6262d0 100644
--- a/src/attrib-server.c
+++ b/src/attrib-server.c
@@ -45,9 +45,10 @@
 #include "adapter.h"
 #include "device.h"
 #include "manager.h"
+#include "gattrib.h"
 #include "att.h"
+#include "gatt.h"
 #include "att-database.h"
-#include "gattrib.h"
 #include "storage.h"
 
 #include "attrib-server.h"
diff --git a/time/server.c b/time/server.c
index 58d0bcc..13a7bbe 100644
--- a/time/server.c
+++ b/time/server.c
@@ -32,9 +32,10 @@
 #include <bluetooth/uuid.h>
 #include <adapter.h>
 
+#include "gattrib.h"
 #include "att.h"
+#include "gatt.h"
 #include "att-database.h"
-#include "gattrib.h"
 #include "attrib-server.h"
 #include "gatt-service.h"
 #include "log.h"
-- 
1.7.8.6


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

* Re: [PATCH BlueZ 1/2] GATT: Rename Characteristic Configuration constants
  2012-05-29 13:58 [PATCH BlueZ 1/2] GATT: Rename Characteristic Configuration constants Claudio Takahasi
  2012-05-29 13:58 ` [PATCH BlueZ 2/2] GATT: Move GATT assigned numbers to GATT header Claudio Takahasi
@ 2012-05-30  7:39 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-05-30  7:39 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: linux-bluetooth

Hi Claudio,

On Tue, May 29, 2012, Claudio Takahasi wrote:
> This patch renames the constants related to Client Characteristic
> Configuration bit field to use a proper name since it is related to
> GATT instead of ATT.
> ---
>  attrib/att.h              |    4 ++--
>  thermometer/thermometer.c |    6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)

Both patches have been applied. Thanks.

Johan

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

end of thread, other threads:[~2012-05-30  7:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-29 13:58 [PATCH BlueZ 1/2] GATT: Rename Characteristic Configuration constants Claudio Takahasi
2012-05-29 13:58 ` [PATCH BlueZ 2/2] GATT: Move GATT assigned numbers to GATT header Claudio Takahasi
2012-05-30  7:39 ` [PATCH BlueZ 1/2] GATT: Rename Characteristic Configuration constants Johan Hedberg

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