diff --git a/drivers/nble/gatt.c b/drivers/nble/gatt.c index 4eceab1af1d..82b1a393cb2 100644 --- a/drivers/nble/gatt.c +++ b/drivers/nble/gatt.c @@ -431,13 +431,13 @@ void on_ble_gatts_write_evt(const struct ble_gatt_wr_evt *evt, const struct bt_gatt_attr *attr = evt->attr; struct ble_gatts_rw_reply_params reply_data; + BT_DBG("handle 0x%04x buf %p len %u", attr->handle, buf, buflen); + if (attr->write) { reply_data.status = attr->write(NULL, attr, buf, buflen, evt->offset); } - BT_DBG("handle 0x%04x buf %p len %u", attr->handle, buf, buflen); - if (evt->reply) { reply_data.conn_handle = evt->conn_handle; reply_data.offset = evt->offset;