diff options
author | Inga Stotland <inga.stotland@intel.com> | 2019-11-14 15:52:10 -0800 |
---|---|---|
committer | Brian Gix <brian.gix@intel.com> | 2019-11-15 09:23:16 -0800 |
commit | dcc46d4cee21a711e781e493ca50cf70b74bd020 (patch) | |
tree | bfe1bdf313cf6ecc4090e452b1708d0c1dacc98a /mesh/mesh-io.h | |
parent | d64f6c885580ef23eb28e53edf1a007bb3628804 (diff) | |
download | bluez-dcc46d4cee21a711e781e493ca50cf70b74bd020.tar.gz |
mesh: Fix io inititalization sequence
This introduces a chain of callbacks to indicate whether mesh io
is initialized and mesh network is ready to use.
This fixes the reported situation when the receive callbacks
were setup before the HCI was fully initialized. In other words,
BT_HCI_CMD_LE_SET_SCAN_PARAMETERS was called before BT_HCI_CMD_RESET
and, as the result, the callback issueing BT_HCI_CMD_LE_SET_SCAN_ENABLE
command was not called.
Diffstat (limited to 'mesh/mesh-io.h')
-rw-r--r-- | mesh/mesh-io.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mesh/mesh-io.h b/mesh/mesh-io.h index 1c10779aa..45ff00a3c 100644 --- a/mesh/mesh-io.h +++ b/mesh/mesh-io.h @@ -81,7 +81,11 @@ typedef void (*mesh_io_recv_func_t)(void *user_data, typedef void (*mesh_io_status_func_t)(void *user_data, int status, uint8_t filter_id); -struct mesh_io *mesh_io_new(enum mesh_io_type type, void *opts); +typedef void (*mesh_io_ready_func_t)(void *user_data, bool result); + + +struct mesh_io *mesh_io_new(enum mesh_io_type type, void *opts, + mesh_io_ready_func_t cb, void *user_data); void mesh_io_destroy(struct mesh_io *io); bool mesh_io_get_caps(struct mesh_io *io, struct mesh_io_caps *caps); |