From e4582107f4514986c936026a2dc029290f0fca02 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 9 Feb 2016 11:22:43 +0200 Subject: [PATCH] drivers/nble: Fix log order when receiving a write event For example when writing to CCC descriptor it may give the impression that a handle is being written twice when in fact it is just calling a callback. Change-Id: I7aca87a1678789547224ef8d64f1f6c55af8022d Signed-off-by: Luiz Augusto von Dentz --- drivers/nble/gatt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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;