diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c
index b8f2503..3199830 100644
--- a/attrib/gatt-service.c
+++ b/attrib/gatt-service.c
GSList *callbacks;
unsigned int num_attrs;
uint16_t *value_handle;
+ uint16_t *ccc_handle;
};
struct attrib_cb {
case GATT_OPT_CHR_VALUE_GET_HANDLE:
info->value_handle = va_arg(args, void *);
break;
+ case GATT_OPT_CCC_GET_HANDLE:
+ info->ccc_handle = va_arg(args, void *);
+ break;
case GATT_OPT_CHR_AUTHENTICATION:
info->authentication = va_arg(args, gatt_option);
break;
bt_uuid16_create(&bt_uuid, GATT_CLIENT_CHARAC_CFG_UUID);
cfg_val[0] = 0x00;
cfg_val[1] = 0x00;
- attrib_db_add(h++, &bt_uuid, ATT_NONE, ATT_AUTHENTICATION,
+ a = attrib_db_add(h++, &bt_uuid, ATT_NONE, ATT_AUTHENTICATION,
cfg_val, sizeof(cfg_val));
+
+ if (info->ccc_handle)
+ *info->ccc_handle = a->handle;
}
*handle = h;
diff --git a/attrib/gatt-service.h b/attrib/gatt-service.h
index d627ca1..6525dc0 100644
--- a/attrib/gatt-service.h
+++ b/attrib/gatt-service.h
/* Get attribute handle for characteristic value */
GATT_OPT_CHR_VALUE_GET_HANDLE,
+ /* Get handle for ccc attribute */
+ GATT_OPT_CCC_GET_HANDLE,
+
/* arguments for authentication/authorization */
GATT_CHR_VALUE_READ,
GATT_CHR_VALUE_WRITE,