From 94210770fdf1cbefb6a01be3672184a5708b733b Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 2 Feb 2016 14:59:55 +0200 Subject: [PATCH] drivers/nble: Only call ready callback once get_version completes There could be commands that depend on the firmware version the stack needs to wait until version is complete. Change-Id: If8ded19c4cd4eb3c33df64b3cde29da11b0de8df Signed-off-by: Luiz Augusto von Dentz --- drivers/nble/gap.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/nble/gap.c b/drivers/nble/gap.c index 0445f0c3f5e..6eaf6064605 100644 --- a/drivers/nble/gap.c +++ b/drivers/nble/gap.c @@ -38,10 +38,6 @@ void on_nble_up(void) { BT_DBG(""); - if (bt_ready_cb) { - bt_ready_cb(0); - } - ble_get_version_req(NULL); } @@ -50,6 +46,11 @@ void on_ble_get_version_rsp(const struct ble_version_response *rsp) BT_DBG("VERSION: %d.%d.%d %.20s", rsp->version.major, rsp->version.minor, rsp->version.patch, rsp->version.version_string); + + if (bt_ready_cb) { + bt_ready_cb(0); + bt_ready_cb = NULL; + } } int bt_enable(bt_ready_cb_t cb)