From: "Dirk-Jan C. Binnema" <djcb.bulk@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: "Dirk-Jan C. Binnema" <djcb@djcbsoftware.nl>
Subject: [PATCH 2/2] Use GATT_OPT_CHR_UUID for bt_uuid_t*, GATT_OPT_CHR_UUID16 for uint16 chrs
Date: Wed, 24 Jul 2013 20:51:55 +0300 [thread overview]
Message-ID: <1374688315-9435-2-git-send-email-djcb.bulk@gmail.com> (raw)
In-Reply-To: <1374688315-9435-1-git-send-email-djcb.bulk@gmail.com>
From: "Dirk-Jan C. Binnema" <djcb@djcbsoftware.nl>
This renames GATT_OPT_CHR_UUID into GATT_OPT_CHR_UUID16, and renames the
(temporary) GATT_OPT_CHR_BT_UUID_T into GATT_OPT_CHR_UUID. Also, updates all
in-tree users.
---
attrib/gatt-service.c | 6 +++---
attrib/gatt-service.h | 2 +-
plugins/gatt-example.c | 2 +-
profiles/alert/server.c | 16 ++++++++--------
profiles/proximity/immalert.c | 2 +-
profiles/proximity/linkloss.c | 2 +-
profiles/time/server.c | 8 ++++----
7 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c
index e4ca78c..86e0093 100644
--- a/attrib/gatt-service.c
+++ b/attrib/gatt-service.c
@@ -68,12 +68,12 @@ static GSList *parse_opts(gatt_option opt1, va_list args)
while (opt != GATT_OPT_INVALID) {
switch (opt) {
- case GATT_OPT_CHR_UUID:
+ case GATT_OPT_CHR_UUID16:
bt_uuid16_create(&info->uuid, va_arg(args, int));
/* characteristic declaration and value */
info->num_attrs += 2;
break;
- case GATT_OPT_CHR_BT_UUID_T:
+ case GATT_OPT_CHR_UUID:
memcpy(&info->uuid, va_arg(args, bt_uuid_t *),
sizeof(bt_uuid_t));
/* characteristic declaration and value */
@@ -114,7 +114,7 @@ static GSList *parse_opts(gatt_option opt1, va_list args)
}
opt = va_arg(args, gatt_option);
- if (opt == GATT_OPT_CHR_UUID || opt == GATT_OPT_CHR_BT_UUID_T) {
+ if (opt == GATT_OPT_CHR_UUID16 || opt == GATT_OPT_CHR_UUID) {
info = g_new0(struct gatt_info, 1);
l = g_slist_append(l, info);
}
diff --git a/attrib/gatt-service.h b/attrib/gatt-service.h
index 5c3e15d..2c05c7d 100644
--- a/attrib/gatt-service.h
+++ b/attrib/gatt-service.h
@@ -24,8 +24,8 @@
typedef enum {
GATT_OPT_INVALID = 0,
+ GATT_OPT_CHR_UUID16,
GATT_OPT_CHR_UUID,
- GATT_OPT_CHR_BT_UUID_T,
GATT_OPT_CHR_PROPS,
GATT_OPT_CHR_VALUE_CB,
GATT_OPT_CHR_AUTHENTICATION,
diff --git a/plugins/gatt-example.c b/plugins/gatt-example.c
index 37972e8..b926947 100644
--- a/plugins/gatt-example.c
+++ b/plugins/gatt-example.c
@@ -114,7 +114,7 @@ static gboolean register_battery_service(struct btd_adapter *adapter)
return gatt_service_add(adapter, GATT_PRIM_SVC_UUID, &uuid,
/* battery state characteristic */
- GATT_OPT_CHR_UUID, BATTERY_STATE_UUID,
+ GATT_OPT_CHR_UUID16, BATTERY_STATE_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_READ |
ATT_CHAR_PROPER_NOTIFY,
GATT_OPT_CHR_VALUE_CB, ATTRIB_READ,
diff --git a/profiles/alert/server.c b/profiles/alert/server.c
index 8da1928..4565470 100644
--- a/profiles/alert/server.c
+++ b/profiles/alert/server.c
@@ -789,7 +789,7 @@ static void register_phone_alert_service(struct alert_adapter *al_adapter)
/* Phone Alert Status Service */
gatt_service_add(al_adapter->adapter, GATT_PRIM_SVC_UUID, &uuid,
/* Alert Status characteristic */
- GATT_OPT_CHR_UUID, ALERT_STATUS_CHR_UUID,
+ GATT_OPT_CHR_UUID16, ALERT_STATUS_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_READ |
ATT_CHAR_PROPER_NOTIFY,
GATT_OPT_CHR_VALUE_CB, ATTRIB_READ,
@@ -799,12 +799,12 @@ static void register_phone_alert_service(struct alert_adapter *al_adapter)
GATT_OPT_CHR_VALUE_GET_HANDLE,
&al_adapter->hnd_value[NOTIFY_ALERT_STATUS],
/* Ringer Control Point characteristic */
- GATT_OPT_CHR_UUID, RINGER_CP_CHR_UUID,
+ GATT_OPT_CHR_UUID16, RINGER_CP_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_WRITE_WITHOUT_RESP,
GATT_OPT_CHR_VALUE_CB, ATTRIB_WRITE,
ringer_cp_write, NULL,
/* Ringer Setting characteristic */
- GATT_OPT_CHR_UUID, RINGER_SETTING_CHR_UUID,
+ GATT_OPT_CHR_UUID16, RINGER_SETTING_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_READ |
ATT_CHAR_PROPER_NOTIFY,
GATT_OPT_CHR_VALUE_CB, ATTRIB_READ,
@@ -892,35 +892,35 @@ static void register_alert_notif_service(struct alert_adapter *al_adapter)
/* Alert Notification Service */
gatt_service_add(al_adapter->adapter, GATT_PRIM_SVC_UUID, &uuid,
/* Supported New Alert Category */
- GATT_OPT_CHR_UUID, SUPP_NEW_ALERT_CAT_CHR_UUID,
+ GATT_OPT_CHR_UUID16, SUPP_NEW_ALERT_CAT_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_READ,
GATT_OPT_CHR_VALUE_CB, ATTRIB_READ,
supp_new_alert_cat_read, al_adapter->adapter,
GATT_OPT_CHR_VALUE_GET_HANDLE,
&al_adapter->supp_new_alert_cat_handle,
/* New Alert */
- GATT_OPT_CHR_UUID, NEW_ALERT_CHR_UUID,
+ GATT_OPT_CHR_UUID16, NEW_ALERT_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_NOTIFY,
GATT_OPT_CCC_GET_HANDLE,
&al_adapter->hnd_ccc[NOTIFY_NEW_ALERT],
GATT_OPT_CHR_VALUE_GET_HANDLE,
&al_adapter->hnd_value[NOTIFY_NEW_ALERT],
/* Supported Unread Alert Category */
- GATT_OPT_CHR_UUID, SUPP_UNREAD_ALERT_CAT_CHR_UUID,
+ GATT_OPT_CHR_UUID16, SUPP_UNREAD_ALERT_CAT_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_READ,
GATT_OPT_CHR_VALUE_CB, ATTRIB_READ,
supp_unread_alert_cat_read, al_adapter->adapter,
GATT_OPT_CHR_VALUE_GET_HANDLE,
&al_adapter->supp_unread_alert_cat_handle,
/* Unread Alert Status */
- GATT_OPT_CHR_UUID, UNREAD_ALERT_CHR_UUID,
+ GATT_OPT_CHR_UUID16, UNREAD_ALERT_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_NOTIFY,
GATT_OPT_CCC_GET_HANDLE,
&al_adapter->hnd_ccc[NOTIFY_UNREAD_ALERT],
GATT_OPT_CHR_VALUE_GET_HANDLE,
&al_adapter->hnd_value[NOTIFY_UNREAD_ALERT],
/* Alert Notification Control Point */
- GATT_OPT_CHR_UUID, ALERT_NOTIF_CP_CHR_UUID,
+ GATT_OPT_CHR_UUID16, ALERT_NOTIF_CP_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_WRITE,
GATT_OPT_CHR_VALUE_CB, ATTRIB_WRITE,
alert_notif_cp_write, NULL,
diff --git a/profiles/proximity/immalert.c b/profiles/proximity/immalert.c
index 06e8eb8..2f8d4e7 100644
--- a/profiles/proximity/immalert.c
+++ b/profiles/proximity/immalert.c
@@ -249,7 +249,7 @@ void imm_alert_register(struct btd_adapter *adapter)
svc_added = gatt_service_add(adapter,
GATT_PRIM_SVC_UUID, &uuid,
/* Alert level characteristic */
- GATT_OPT_CHR_UUID, ALERT_LEVEL_CHR_UUID,
+ GATT_OPT_CHR_UUID16, ALERT_LEVEL_CHR_UUID,
GATT_OPT_CHR_PROPS,
ATT_CHAR_PROPER_WRITE_WITHOUT_RESP,
GATT_OPT_CHR_VALUE_CB, ATTRIB_WRITE,
diff --git a/profiles/proximity/linkloss.c b/profiles/proximity/linkloss.c
index cb87b12..a7ed96c 100644
--- a/profiles/proximity/linkloss.c
+++ b/profiles/proximity/linkloss.c
@@ -290,7 +290,7 @@ void link_loss_register(struct btd_adapter *adapter)
svc_added = gatt_service_add(adapter,
GATT_PRIM_SVC_UUID, &uuid,
/* Alert level characteristic */
- GATT_OPT_CHR_UUID, ALERT_LEVEL_CHR_UUID,
+ GATT_OPT_CHR_UUID16, ALERT_LEVEL_CHR_UUID,
GATT_OPT_CHR_PROPS,
ATT_CHAR_PROPER_READ | ATT_CHAR_PROPER_WRITE,
GATT_OPT_CHR_VALUE_CB, ATTRIB_READ,
diff --git a/profiles/time/server.c b/profiles/time/server.c
index 518a29f..178d4d2 100644
--- a/profiles/time/server.c
+++ b/profiles/time/server.c
@@ -152,14 +152,14 @@ static gboolean register_current_time_service(struct btd_adapter *adapter)
/* Current Time service */
return gatt_service_add(adapter, GATT_PRIM_SVC_UUID, &uuid,
/* CT Time characteristic */
- GATT_OPT_CHR_UUID, CT_TIME_CHR_UUID,
+ GATT_OPT_CHR_UUID16, CT_TIME_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_READ |
ATT_CHAR_PROPER_NOTIFY,
GATT_OPT_CHR_VALUE_CB, ATTRIB_READ,
current_time_read, adapter,
/* Local Time Information characteristic */
- GATT_OPT_CHR_UUID, LOCAL_TIME_INFO_CHR_UUID,
+ GATT_OPT_CHR_UUID16, LOCAL_TIME_INFO_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_READ,
GATT_OPT_CHR_VALUE_CB, ATTRIB_READ,
local_time_info_read, adapter,
@@ -215,14 +215,14 @@ static gboolean register_ref_time_update_service(struct btd_adapter *adapter)
/* Reference Time Update service */
return gatt_service_add(adapter, GATT_PRIM_SVC_UUID, &uuid,
/* Time Update control point */
- GATT_OPT_CHR_UUID, TIME_UPDATE_CTRL_CHR_UUID,
+ GATT_OPT_CHR_UUID16, TIME_UPDATE_CTRL_CHR_UUID,
GATT_OPT_CHR_PROPS,
ATT_CHAR_PROPER_WRITE_WITHOUT_RESP,
GATT_OPT_CHR_VALUE_CB, ATTRIB_WRITE,
time_update_control, adapter,
/* Time Update status */
- GATT_OPT_CHR_UUID, TIME_UPDATE_STAT_CHR_UUID,
+ GATT_OPT_CHR_UUID16, TIME_UPDATE_STAT_CHR_UUID,
GATT_OPT_CHR_PROPS, ATT_CHAR_PROPER_READ,
GATT_OPT_CHR_VALUE_CB, ATTRIB_READ,
time_update_status, adapter,
--
1.8.3.2
next prev parent reply other threads:[~2013-07-24 17:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 13:47 [PATCH] attrib/gatt_service_add: support 128-bit uuids for characteristics Dirk-Jan C. Binnema
2013-07-24 4:57 ` Johan Hedberg
2013-07-24 7:25 ` Dirk-Jan C. Binnema
2013-07-24 7:32 ` Dirk-Jan C. Binnema
2013-07-24 10:55 ` Anderson Lizardo
2013-07-24 16:43 ` Dirk-Jan C. Binnema
2013-07-24 17:03 ` Johan Hedberg
2013-07-24 17:51 ` [PATCH 1/2] Add support for 128-bit UUIDs " Dirk-Jan C. Binnema
2013-07-24 17:51 ` Dirk-Jan C. Binnema [this message]
2013-07-24 17:38 ` [PATCH] attrib/gatt_service_add: support 128-bit uuids " Anderson Lizardo
2013-07-24 18:04 ` Dirk-Jan C. Binnema
2013-07-25 4:35 ` [PATCH 1/3] gatt-service: fix assertion in gatt_service_add for 128-bit uuids Dirk-Jan C. Binnema
2013-07-25 4:35 ` [PATCH 2/3] gatt_service_add: add support for 128-bit uuids for characteristics Dirk-Jan C. Binnema
2013-07-25 4:35 ` [PATCH 3/3] Use GATT_OPT_CHR_UUID for bt_uuid_t*, GATT_OPT_CHR_UUID16 for uint16 chrs Dirk-Jan C. Binnema
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=1374688315-9435-2-git-send-email-djcb.bulk@gmail.com \
--to=djcb.bulk@gmail.com \
--cc=djcb@djcbsoftware.nl \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.