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.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.h')
-rw-r--r-- | mesh/mesh.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mesh/mesh.h b/mesh/mesh.h index e0a3e1b96..c72632b15 100644 --- a/mesh/mesh.h +++ b/mesh/mesh.h @@ -30,9 +30,12 @@ enum mesh_io_type; +typedef void (*mesh_ready_func_t)(void *user_data, bool success); typedef void (*prov_rx_cb_t)(void *user_data, const uint8_t *data, uint16_t len); -bool mesh_init(const char *in_config_name, enum mesh_io_type type, void *opts); + +bool mesh_init(const char *in_config_name, enum mesh_io_type type, void *opts, + mesh_ready_func_t cb, void *user_data); void mesh_cleanup(void); bool mesh_dbus_init(struct l_dbus *dbus); |