BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
- if (ret != BLUETOOTH_ERROR_NONE) {
+ if (ret != BLUETOOTH_ERROR_NONE &&
+ ret != BLUETOOTH_ERROR_ALREADY_INITIALIZED) {
BT_ERR("Fail to init the mesh in bt-service");
return ret;
}
oal_status_t status = OAL_STATUS_SUCCESS;
BT_INFO("Mesh: Set dbus callbacks");
status = mesh_enable();
- if (OAL_STATUS_SUCCESS != status) {
+ if (OAL_STATUS_SUCCESS != status &&
+ OAL_STATUS_ALREADY_DONE != status) {
BT_ERR("Mesh: Failed to enable mesh interface, status: %d",
status);
return BLUETOOTH_ERROR_INTERNAL;
}
- BT_INFO("Mesh: Stack Initialization Done successfully");
+ BT_INFO("Mesh: Stack Initialization Done successfully: status [%d]",
+ status);
/* Register MESH event handler */
_bt_service_register_event_handler_callback(BT_MESH_MODULE,
__handle_mesh_events);
- return BLUETOOTH_ERROR_NONE;
+ return (status == OAL_STATUS_SUCCESS ? BLUETOOTH_ERROR_NONE : \
+ BLUETOOTH_ERROR_ALREADY_INITIALIZED);
}
static gboolean __bt_mesh_launch_timer_expired_cb(gpointer data)
BT_INFO("Mesh: Enable Mesh dbus");
int ret = BLUETOOTH_ERROR_NONE;
ret = __bt_mesh_enable();
- if (BLUETOOTH_ERROR_NONE != ret)
+ if (BLUETOOTH_ERROR_NONE != ret &&
+ BLUETOOTH_ERROR_ALREADY_INITIALIZED != ret)
BT_ERR("Mesh: Mesh enable failed: %d", ret);
/* Handle DBUS Context return */
__bt_mesh_handle_pending_request_info(ret,
BT_MESH_INIT,
NULL, 0);
+
+ /* Reset launch timer ID */
+ launch_timer = 0;
+
return FALSE;
}
{
int ret = BLUETOOTH_ERROR_NONE;
+ BT_INFO("Mesh: Launch Timer val [%u]", launch_timer);
if (launch_timer > 0) {
BT_INFO("Mesh: BT_MESH_INIT in progress");
return ret;