is_online(info->entry->state) == TRUE;
info->online = FALSE;
- info->reason = CONNMAN_SESSION_REASON_UNKNOWN;
info->entry->reason = CONNMAN_SESSION_REASON_UNKNOWN;
service = info->entry->service;
g_timeout_add_seconds(0, call_disconnect, service);
}
-static void deselect_and_disconnect(struct connman_session *session)
+static void deselect_and_disconnect(struct connman_session *session,
+ enum connman_session_reason reason)
{
struct session_info *info = session->info;
deselect_service(info);
+
+ info->reason = reason;
}
static void select_online_service(struct session_info *info,
* This service is not part of this
* session anymore.
*/
- deselect_and_disconnect(session);
+ deselect_and_disconnect(session, info->reason);
}
}
break;
case CONNMAN_SESSION_TRIGGER_DISCONNECT:
- deselect_and_disconnect(session);
+ deselect_and_disconnect(session,
+ CONNMAN_SESSION_REASON_DISCONNECT);
break;
case CONNMAN_SESSION_TRIGGER_PERIODIC:
* Therefore we want to restart the algorithm. Before we
* can do that we have to cleanup a potientional old entry.
*/
- deselect_and_disconnect(session);
- info->reason = CONNMAN_SESSION_REASON_CONNECT; /* restore value */
+ deselect_and_disconnect(session,
+ CONNMAN_SESSION_REASON_CONNECT);
DBG("Retry to find a matching session");
/*
case CONNMAN_SESSION_TRIGGER_ECALL:
if (info->online == FALSE && info->entry != NULL &&
info->entry->service != NULL) {
- deselect_and_disconnect(session);
+ deselect_and_disconnect(session, info->reason);
}
break;
g_dbus_unregister_interface(connection, session->session_path,
CONNMAN_SESSION_INTERFACE);
- deselect_and_disconnect(session);
+ deselect_and_disconnect(session,
+ CONNMAN_SESSION_REASON_DISCONNECT);
g_hash_table_remove(session_hash, session->session_path);