diff --git a/attrib/gatt-service.c b/attrib/gatt-service.c
index 3d623de..b8f2503 100644
--- a/attrib/gatt-service.c
+++ b/attrib/gatt-service.c
int authorization;
GSList *callbacks;
unsigned int num_attrs;
+ uint16_t *value_handle;
};
struct attrib_cb {
cb->fn = va_arg(args, void *);
info->callbacks = g_slist_append(info->callbacks, cb);
break;
+ case GATT_OPT_CHR_VALUE_GET_HANDLE:
+ info->value_handle = va_arg(args, void *);
+ break;
case GATT_OPT_CHR_AUTHENTICATION:
info->authentication = va_arg(args, gatt_option);
break;
}
}
+ if (info->value_handle)
+ *info->value_handle = a->handle;
+
/* client characteristic configuration descriptor */
if (info->props & (ATT_CHAR_PROPER_NOTIFY | ATT_CHAR_PROPER_INDICATE)) {
uint8_t cfg_val[2];
diff --git a/attrib/gatt-service.h b/attrib/gatt-service.h
index 4cb91ce..d627ca1 100644
--- a/attrib/gatt-service.h
+++ b/attrib/gatt-service.h
GATT_OPT_CHR_AUTHENTICATION,
GATT_OPT_CHR_AUTHORIZATION,
+ /* Get attribute handle for characteristic value */
+ GATT_OPT_CHR_VALUE_GET_HANDLE,
+
/* arguments for authentication/authorization */
GATT_CHR_VALUE_READ,
GATT_CHR_VALUE_WRITE,