summaryrefslogtreecommitdiff
path: root/attrib/gatt-service.c
diff options
context:
space:
mode:
Diffstat (limited to 'attrib/gatt-service.c')
-rwxr-xr-xattrib/gatt-service.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c
index 629d9cfd..e434d3b5 100755
--- a/attrib/gatt-service.c
+++ b/attrib/gatt-service.c
@@ -81,17 +81,26 @@ static GSList *parse_opts(gatt_option opt1, va_list args)
while (opt != GATT_OPT_INVALID) {
switch (opt) {
case GATT_OPT_CHR_UUID16:
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ case GATT_OPT_DESC_UUID16:
+#endif
bt_uuid16_create(&info->uuid, va_arg(args, int));
/* characteristic declaration and value */
info->num_attrs += 2;
break;
case GATT_OPT_CHR_UUID:
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ case GATT_OPT_DESC_UUID:
+#endif
memcpy(&info->uuid, va_arg(args, bt_uuid_t *),
sizeof(bt_uuid_t));
/* characteristic declaration and value */
info->num_attrs += 2;
break;
case GATT_OPT_CHR_PROPS:
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ case GATT_OPT_DESC_PROPS:
+#endif
info->props = va_arg(args, int);
if (info->props & (GATT_CHR_PROP_NOTIFY |
@@ -103,6 +112,9 @@ static GSList *parse_opts(gatt_option opt1, va_list args)
* descriptor, but it is not supported yet. */
break;
case GATT_OPT_CHR_VALUE_CB:
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ case GATT_OPT_DESC_VALUE_CB:
+#endif
cb = g_new0(struct attrib_cb, 1);
cb->event = va_arg(args, attrib_event_t);
cb->fn = va_arg(args, void *);
@@ -130,7 +142,12 @@ static GSList *parse_opts(gatt_option opt1, va_list args)
}
opt = va_arg(args, gatt_option);
+#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
+ if (opt == GATT_OPT_CHR_UUID16 || opt == GATT_OPT_CHR_UUID ||
+ opt == GATT_OPT_DESC_UUID16 || opt == GATT_OPT_DESC_UUID) {
+#else
if (opt == GATT_OPT_CHR_UUID16 || opt == GATT_OPT_CHR_UUID) {
+#endif
info = g_new0(struct gatt_info, 1);
l = g_slist_append(l, info);
}
@@ -268,6 +285,10 @@ static gboolean add_characteristic(struct btd_adapter *adapter,
if (info->value_handle != NULL)
*info->value_handle = a->handle;
+#ifndef TIZEN_FEATURE_BLUEZ_MODIFY
+/* Since old attrib service implementation add descriptor by default
+ * if notification and indication properties are set, As per new gatt server implemenation
+ * CCCD are added by the application*/
/* client characteristic configuration descriptor */
if (info->props & (GATT_CHR_PROP_NOTIFY | GATT_CHR_PROP_INDICATE)) {
uint8_t cfg_val[2];
@@ -283,6 +304,7 @@ static gboolean add_characteristic(struct btd_adapter *adapter,
if (info->ccc_handle != NULL)
*info->ccc_handle = a->handle;
}
+#endif
*handle = h;