/* Attribute write call back for the Descriptor V8D2 attribute.  */
static ssize_t write_des_v8d2(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)
/* Attribute write call back for the Descriptor V8D2 attribute.  */
static ssize_t write_des_v8d2(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)
{
	uint8_t *value = attr->user_data;
	if (offset >= sizeof(des_v8d2_value))
		return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET);
	if (offset + len > sizeof(des_v8d2_value))
		return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN);
	if (!bAuthorized)
		return BT_GATT_ERR(BT_ATT_ERR_AUTHORIZATION);
	memcpy(value + offset, buf, len);
	return len;
}