From: Daniel Wagner <[email protected]>
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 fc9d89b..8389120 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;
@@ -299,8 +299,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,
@@ -665,14 +665,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,
@@ -770,7 +770,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;
@@ -805,9 +805,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);
@@ -874,7 +874,7 @@ int __connman_session_create(DBusMessage *msg)
session->bearer = "";
session->online = FALSE;
- session->realtime = realtime;
+ session->priority = priority;
session->allowed_bearers = allowed_bearers;
session->avoid_handover = avoid_handover;
session->stay_connected = stay_connected;
--
1.7.4
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman