session: Rename the Realtime flag to Priority
authorDaniel Wagner <daniel.wagner@bmw-carit.de>
Wed, 6 Apr 2011 13:55:16 +0000 (15:55 +0200)
committerDaniel Wagner <daniel.wagner@bmw-carit.de>
Thu, 7 Apr 2011 14:35:20 +0000 (16:35 +0200)
Also change the meaning of the flag, back to the original proposal
from Marcel Holtmann.

doc/session-api.txt
src/session.c

index 019e244..e20449b 100644 (file)
@@ -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.
 
index ed40a45..6ee8435 100644 (file)
@@ -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;