/* Attribute write call back for the Value V6 attribute.  */
static ssize_t write_value_v6(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 Value V6 attribute.  */
static ssize_t write_value_v6(struct bt_conn *conn, const struct bt_gatt_attr *attr, const void *buf, uint16_t len, uint16_t offset, uint8_t flags)
{
	uint16_t *value = attr->user_data;
	uint16_t value_v6_conv = sys_cpu_to_le16(*value);
	if (offset >= sizeof(value_v6_value))
		return BT_GATT_ERR(BT_ATT_ERR_INVALID_OFFSET);
	if (offset + len > sizeof(value_v6_value))
		return BT_GATT_ERR(BT_ATT_ERR_INVALID_ATTRIBUTE_LEN);
	memcpy((uint8_t *)&value_v6_conv + offset, buf, len);
	*value = sys_le16_to_cpu(value_v6_conv);
	return len;
}