From 09c48519ad3ff07acd01ba9c037271c368989000 Mon Sep 17 00:00:00 2001 From: Daniel Wagner Date: Wed, 6 Apr 2011 15:55:16 +0200 Subject: [PATCH] session: Rename the Realtime flag to Priority Also change the meaning of the flag, back to the original proposal from Marcel Holtmann. --- doc/session-api.txt | 27 ++++++++++++++++++++++++--- src/session.c | 24 ++++++++++++------------ 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/doc/session-api.txt b/doc/session-api.txt index 019e244..e20449b 100644 --- a/doc/session-api.txt +++ b/doc/session-api.txt @@ -105,12 +105,33 @@ Settings string Bearer [readonly] can be delayed based on the speed of the bearer. It is done to avoid congestion on bearers like 3G etc. - boolean Realtime [readwrite] + boolean Priority [readwrite] - This indicates if the application uses realtime traffic. + This allows a session to mark itself as priority or + not. In general application are not allowed to make + themselves more important than others. + + The priority handling is done internally by usage + and first come, first serve order. By default this + settings is of course false. + + Internally there can be different priorities for + different application, but these are defined by a + configuration file and not via this interface. + + An application that calls the method to connect + a session is preferred over other sessions. This + priority value is more for application that want to + push themselves up in the asychronization notification + queue once a bearer becomes online. + + This actual priority order also depends on the + allowed bearers and other factors. This is setting + is just a little indicator of one application being + notified before another one. For example a streaming session should set the - realtime value. As soon as realtime data is involved + priority value. As soon as realtime data is involved then this should be set. An email client should not set this value. diff --git a/src/session.c b/src/session.c index ed40a45..6ee8435 100644 --- a/src/session.c +++ b/src/session.c @@ -51,7 +51,7 @@ struct connman_session { const char *name; char *ifname; connman_bool_t online; - connman_bool_t realtime; + connman_bool_t priority; GSList *allowed_bearers; connman_bool_t avoid_handover; connman_bool_t stay_connected; @@ -320,8 +320,8 @@ static void append_notify_all(DBusMessageIter *dict, append_service(dict, session); - connman_dbus_dict_append_basic(dict, "Realtime", - DBUS_TYPE_BOOLEAN, &session->realtime); + connman_dbus_dict_append_basic(dict, "Priority", + DBUS_TYPE_BOOLEAN, &session->priority); connman_dbus_dict_append_array(dict, "AllowedBearers", DBUS_TYPE_STRING, @@ -695,14 +695,14 @@ static DBusMessage *change_session(DBusConnection *conn, } break; case DBUS_TYPE_BOOLEAN: - if (g_str_equal(name, "Realtime") == TRUE) { - dbus_message_iter_get_basic(&value, &session->realtime); + if (g_str_equal(name, "Priority") == TRUE) { + dbus_message_iter_get_basic(&value, &session->priority); - /* update_realtime(); */ + /* update_priority(); */ - connman_dbus_dict_append_basic(&reply_dict, "Realtime", + connman_dbus_dict_append_basic(&reply_dict, "Priority", DBUS_TYPE_BOOLEAN, - &session->realtime); + &session->priority); } else if (g_str_equal(name, "AvoidHandover") == TRUE) { dbus_message_iter_get_basic(&value, @@ -800,7 +800,7 @@ int __connman_session_create(DBusMessage *msg) DBusMessageIter iter, array; struct connman_session *session; - connman_bool_t realtime = FALSE, avoid_handover = FALSE; + connman_bool_t priority = FALSE, avoid_handover = FALSE; connman_bool_t stay_connected = FALSE, ecall = FALSE; enum connman_session_roaming_policy roaming_policy = CONNMAN_SESSION_ROAMING_POLICY_FORBIDDEN; @@ -835,9 +835,9 @@ int __connman_session_create(DBusMessage *msg) } break; case DBUS_TYPE_BOOLEAN: - if (g_str_equal(key, "Realtime") == TRUE) { + if (g_str_equal(key, "Priority") == TRUE) { dbus_message_iter_get_basic(&value, - &realtime); + &priority); } else if (g_str_equal(key, "AvoidHandover") == TRUE) { dbus_message_iter_get_basic(&value, &avoid_handover); @@ -904,7 +904,7 @@ int __connman_session_create(DBusMessage *msg) session->bearer = ""; session->online = FALSE; - session->realtime = realtime; + session->priority = priority; session->avoid_handover = avoid_handover; session->stay_connected = stay_connected; session->periodic_connect = periodic_connect; -- 2.7.4