[PATCH 1/5] stk: Add agent registration and logic.
by Andrzej Zaborowski
This patch adds a skeleton that command implementations use in the
subsequent patches.
Icons and text attributes are not implemented in this series, I'll
send them separately. There are slight differences from
doc/stk-api.txt, for example org.ofono.Error.EndSession can be used
to terminate either a user-initiated or UICC-initiated session.
Should we change the ".Error" part to something like ".Navigation",
since these are not error conditions and may be confusing?
---
src/stk.c | 396 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 396 insertions(+), 0 deletions(-)
diff --git a/src/stk.c b/src/stk.c
index 556dc68..3ccb7e9 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -46,6 +46,28 @@ struct stk_timer {
time_t start;
};
+enum stk_agent_result {
+ STK_AGENT_RESULT_OK,
+ STK_AGENT_RESULT_BACK,
+ STK_AGENT_RESULT_TERMINATE,
+ STK_AGENT_RESULT_HELP,
+ STK_AGENT_RESULT_TIMEOUT,
+ STK_AGENT_RESULT_CANCEL,
+};
+
+struct stk_app_agent {
+ char *path;
+ char *bus;
+ DBusMessage *msg;
+ DBusPendingCall *call;
+ guint watch;
+ guint cmd_timeout;
+ void (*cmd_send)(struct ofono_stk *stk, DBusMessage *call);
+ void (*cmd_cb)(struct ofono_stk *stk, enum stk_agent_result result,
+ DBusMessage *reply);
+ struct ofono_stk *stk;
+};
+
struct ofono_stk {
const struct ofono_stk_driver *driver;
void *driver_data;
@@ -57,6 +79,10 @@ struct ofono_stk {
struct stk_timer timers[8];
guint timers_source;
+ int timeout;
+ int short_timeout;
+ struct stk_app_agent *primary_agent;
+ struct stk_app_agent *default_agent;
struct sms_submit_req *sms_submit_req;
char *idle_mode_text;
};
@@ -76,6 +102,10 @@ struct sms_submit_req {
#define ENVELOPE_RETRIES_DEFAULT 5
+#define OFONO_NAVIGATION_PREFIX OFONO_SERVICE ".Error"
+#define OFONO_NAVIGATION_GOBACK OFONO_NAVIGATION_PREFIX ".GoBack"
+#define OFONO_NAVIGATION_TERMINATED OFONO_NAVIGATION_PREFIX ".EndSession"
+
static void envelope_queue_run(struct ofono_stk *stk);
static void timers_update(struct ofono_stk *stk);
@@ -255,8 +285,361 @@ static DBusMessage *stk_get_properties(DBusConnection *conn,
return reply;
}
+static void app_agent_request_send_cancel(struct stk_app_agent *agent)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+ DBusMessage *message;
+
+ message = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_SIM_APP_INTERFACE,
+ "Cancel");
+ if (message == NULL)
+ return;
+
+ dbus_message_set_no_reply(message, TRUE);
+
+ g_dbus_send_message(conn, message);
+}
+
+static void app_agent_request_end(struct stk_app_agent *agent)
+{
+ agent->cmd_send = NULL;
+ agent->cmd_cb = NULL;
+
+ if (agent->cmd_timeout) {
+ g_source_remove(agent->cmd_timeout);
+ agent->cmd_timeout = 0;
+ }
+
+ if (agent->msg) {
+ dbus_message_unref(agent->msg);
+ agent->msg = NULL;
+ }
+
+ if (agent->call) {
+ dbus_pending_call_cancel(agent->call);
+ dbus_pending_call_unref(agent->call);
+ agent->call = NULL;
+ }
+}
+
+static void app_agent_request_cancel(struct stk_app_agent *agent)
+{
+ if (!agent->cmd_send)
+ return;
+
+ agent->cmd_cb(agent->stk, STK_AGENT_RESULT_CANCEL, NULL);
+
+ app_agent_request_end(agent);
+
+ app_agent_request_send_cancel(agent);
+}
+
+static void stk_agent_request_cancel(struct ofono_stk *stk)
+{
+ if (stk->primary_agent)
+ app_agent_request_cancel(stk->primary_agent);
+
+ if (stk->default_agent)
+ app_agent_request_cancel(stk->default_agent);
+}
+
+static gboolean app_agent_request_timeout(gpointer user_data)
+{
+ struct stk_app_agent *agent = user_data;
+
+ agent->cmd_timeout = 0;
+
+ agent->cmd_cb(agent->stk, STK_AGENT_RESULT_TIMEOUT, NULL);
+
+ app_agent_request_end(agent);
+
+ app_agent_request_send_cancel(agent);
+
+ return FALSE;
+}
+
+static void app_agent_request_terminate(struct stk_app_agent *agent)
+{
+ agent->cmd_cb(agent->stk, STK_AGENT_RESULT_TERMINATE, NULL);
+
+ app_agent_request_end(agent);
+}
+
+static void app_agent_remove(void *user_data)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+ struct stk_app_agent *agent = user_data;
+
+ if (agent->watch) {
+ DBusMessage *message;
+
+ if (agent->cmd_cb) {
+ app_agent_request_terminate(agent);
+
+ app_agent_request_send_cancel(agent);
+ }
+
+ message = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_SIM_APP_INTERFACE,
+ "Release");
+ if (message) {
+ dbus_message_set_no_reply(message, TRUE);
+
+ g_dbus_send_message(conn, message);
+ }
+
+ g_dbus_remove_watch(conn, agent->watch);
+ agent->watch = 0;
+ } else {
+ if (agent->cmd_cb)
+ app_agent_request_terminate(agent);
+ }
+
+ if (agent->stk->primary_agent == agent)
+ agent->stk->primary_agent = NULL;
+ if (agent->stk->default_agent == agent)
+ agent->stk->default_agent = NULL;
+
+ if (agent->remove_agent_source) {
+ g_source_remove(agent->remove_agent_source);
+ agent->remove_agent_source = 0;
+ }
+
+ g_free(agent->path);
+ g_free(agent->bus);
+ g_free(agent);
+}
+
+static gboolean app_agent_remove_cb(gpointer user_data)
+{
+ struct stk_app_agent *agent = user_data;
+
+ agent->remove_agent_source = 0;
+
+ app_agent_remove(user_data);
+
+ return FALSE;
+}
+
+static void app_agent_request_reply_handle(DBusPendingCall *call, void *data)
+{
+ struct stk_app_agent *agent = data;
+ DBusError err;
+ DBusMessage *reply = dbus_pending_call_steal_reply(call);
+ enum stk_agent_result result = STK_AGENT_RESULT_OK;
+
+ dbus_error_init(&err);
+ if (dbus_set_error_from_message(&err, reply)) {
+ ofono_error("SimAppAgent %s replied with error %s, %s",
+ agent->path, err.name, err.message);
+
+ if (g_str_has_prefix(err.name, OFONO_NAVIGATION_GOBACK))
+ result = STK_AGENT_RESULT_BACK;
+ else
+ result = STK_AGENT_RESULT_TERMINATE;
+
+ dbus_error_free(&err);
+ }
+
+ agent->cmd_cb(agent->stk, result, reply);
+
+ app_agent_request_end(agent);
+
+ dbus_message_unref(reply);
+
+ if (result != STK_AGENT_RESULT_TERMINATE)
+ return;
+
+ if (agent->stk->primary_agent != agent)
+ return;
+
+ app_agent_remove(agent);
+}
+
+static gboolean app_agent_request_send(struct stk_app_agent *agent)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ /*
+ * The cmd_send callback needs to set the method name to
+ * something different than "Cancel".
+ */
+ agent->msg = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_SIM_APP_INTERFACE,
+ "Cancel");
+ if (agent->msg == NULL) {
+ ofono_error("Couldn't make a DBusMessage");
+ return FALSE;
+ }
+
+ agent->cmd_send(agent->stk, agent->msg);
+
+ if (dbus_connection_send_with_reply(conn,
+ agent->msg, &agent->call, INT_MAX) == FALSE ||
+ agent->call == NULL) {
+ dbus_message_unref(agent->msg);
+ agent->msg = NULL;
+
+ ofono_error("Couldn't send a method call");
+ return FALSE;
+ }
+
+ dbus_pending_call_set_notify(agent->call,
+ app_agent_request_reply_handle,
+ agent, NULL);
+
+ return TRUE;
+}
+
+static void app_agent_request_start(struct ofono_stk *stk,
+ void (*send)(struct ofono_stk *stk,
+ DBusMessage *call),
+ void (*cb)(struct ofono_stk *stk,
+ enum stk_agent_result result,
+ DBusMessage *reply),
+ int timeout)
+{
+ struct stk_app_agent *agent = stk->default_agent;
+
+ if (stk->primary_agent)
+ agent = stk->primary_agent;
+
+ if (agent == NULL) {
+ cb(stk, STK_AGENT_RESULT_TERMINATE, NULL);
+
+ return;
+ }
+
+ if (agent->cmd_cb)
+ app_agent_request_cancel(agent);
+
+ agent->cmd_send = send;
+ agent->cmd_cb = cb;
+
+ if (!app_agent_request_send(agent)) {
+ app_agent_request_terminate(agent);
+
+ return;
+ }
+
+ /* Use the timeout value specified in the command or the default. */
+ if (timeout == 0)
+ timeout = stk->timeout * 1000;
+
+ if (timeout < 0)
+ return;
+
+ agent->cmd_timeout = g_timeout_add(timeout, app_agent_request_timeout,
+ agent);
+}
+
+static void app_agent_disconnect_cb(DBusConnection *conn, void *user_data)
+{
+ struct stk_app_agent *agent = user_data;
+
+ ofono_debug("Agent exited without calling Unregister");
+
+ agent->watch = 0;
+
+ app_agent_remove(user_data);
+}
+
+static struct stk_app_agent *app_agent_create(struct ofono_stk *stk,
+ const char *path,
+ const char *sender)
+{
+ struct stk_app_agent *agent = g_try_new0(struct stk_app_agent, 1);
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ if (!agent)
+ return NULL;
+
+ agent->path = g_strdup(path);
+ agent->bus = g_strdup(sender);
+ agent->stk = stk;
+
+ agent->watch = g_dbus_add_disconnect_watch(conn, sender,
+ app_agent_disconnect_cb,
+ agent, NULL);
+
+ return agent;
+}
+
+static DBusMessage *stk_register_agent(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct ofono_stk *stk = data;
+ const char *agent_path;
+
+ if (stk->default_agent)
+ return __ofono_error_busy(msg);
+
+ if (dbus_message_get_args(msg, NULL,
+ DBUS_TYPE_OBJECT_PATH, &agent_path,
+ DBUS_TYPE_INVALID) == FALSE)
+ return __ofono_error_invalid_args(msg);
+
+ stk->default_agent = app_agent_create(stk, agent_path,
+ dbus_message_get_sender(msg));
+ if (!stk->default_agent)
+ return __ofono_error_failed(msg);
+
+ return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *stk_unregister_agent(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct ofono_stk *stk = data;
+ const char *agent_path;
+ const char *agent_bus = dbus_message_get_sender(msg);
+
+ if (dbus_message_get_args(msg, NULL,
+ DBUS_TYPE_OBJECT_PATH, &agent_path,
+ DBUS_TYPE_INVALID) == FALSE)
+ return __ofono_error_invalid_args(msg);
+
+ if (!stk->default_agent)
+ return __ofono_error_failed(msg);
+
+ if (strcmp(stk->default_agent->path, agent_path))
+ return __ofono_error_failed(msg);
+ if (strcmp(stk->default_agent->bus, agent_bus))
+ return __ofono_error_failed(msg);
+
+ app_agent_remove(stk->default_agent);
+
+ return dbus_message_new_method_return(msg);
+}
+
+static DBusMessage *stk_select_item(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct ofono_stk *stk = data;
+ const char *agent_path;
+ unsigned char selection;
+
+ if (stk->primary_agent)
+ return __ofono_error_busy(msg);
+
+ if (dbus_message_get_args(msg, NULL,
+ DBUS_TYPE_BYTE, &selection,
+ DBUS_TYPE_OBJECT_PATH, &agent_path,
+ DBUS_TYPE_INVALID) == FALSE)
+ return __ofono_error_invalid_args(msg);
+
+ /* TODO */
+
+ return NULL;
+}
+
static GDBusMethodTable stk_methods[] = {
{ "GetProperties", "", "a{sv}",stk_get_properties },
+ { "SelectItem", "yo", "", stk_select_item,
+ G_DBUS_METHOD_FLAG_ASYNC },
+ { "RegisterAgent", "o", "", stk_register_agent },
+ { "UnregisterAgent", "o", "", stk_unregister_agent },
{ }
};
@@ -576,6 +959,11 @@ static void stk_proactive_command_cancel(struct ofono_stk *stk)
void ofono_stk_proactive_session_end_notify(struct ofono_stk *stk)
{
stk_proactive_command_cancel(stk);
+
+ if (stk->primary_agent) {
+ app_agent_remove(stk->primary_agent);
+ stk->primary_agent = NULL;
+ }
}
void ofono_stk_proactive_command_notify(struct ofono_stk *stk,
@@ -687,6 +1075,12 @@ static void stk_unregister(struct ofono_atom *atom)
struct ofono_modem *modem = __ofono_atom_get_modem(atom);
const char *path = __ofono_atom_get_path(atom);
+ if (stk->primary_agent)
+ app_agent_remove(stk->primary_agent);
+
+ if (stk->default_agent)
+ app_agent_remove(stk->default_agent);
+
if (stk->pending_cmd) {
stk_command_free(stk->pending_cmd);
stk->pending_cmd = NULL;
@@ -778,6 +1172,8 @@ void ofono_stk_register(struct ofono_stk *stk)
__ofono_atom_register(stk->atom, stk_unregister);
+ stk->timeout = 600; /* 10 minutes */
+ stk->short_timeout = 20; /* 20 seconds */
stk->envelope_q = g_queue_new();
}
--
1.7.1.86.g0e460.dirty
10 years, 6 months
[PATCH] watch: Free service data in service_reply
by Zhenhua Zhang
Avoid the memory leak of server_data.
---
gdbus/watch.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/gdbus/watch.c b/gdbus/watch.c
index 1d479fa..ccdbb64 100644
--- a/gdbus/watch.c
+++ b/gdbus/watch.c
@@ -468,8 +468,10 @@ static void service_reply(DBusPendingCall *call, void *user_data)
dbus_bool_t has_owner;
reply = dbus_pending_call_steal_reply(call);
- if (reply == NULL)
+ if (reply == NULL) {
+ g_free(data);
return;
+ }
dbus_error_init(&error);
@@ -490,6 +492,7 @@ static void service_reply(DBusPendingCall *call, void *user_data)
done:
dbus_message_unref(reply);
+ g_free(data);
}
static void check_service(DBusConnection *connection, const char *name,
--
1.7.0.4
10 years, 6 months
[PATCH 0/5] Add oFono DUN emulator
by Zhenhua Zhang
Hi,
These are the updated patches for DUN emulator. First, it listens modem "Online" signal to register itself to bluetooth library. Second, it register DUN record through D-Bus interface. Btio library from Obex is simplified to only keep RFCOMM part.
Thanks,
Zhenhua
10 years, 6 months
TODO update
by Denis Kenzior
Hi Everyone,
I added some STK related tasks to the TODO list. You might find your
name as the Owner of some of them. Hopefully there are no surprises there.
As always, if I screwed something up, let me know ;)
Regards,
-Denis
10 years, 6 months
[PATCH 0/2] convert img to xpm
by Kristen Carlson Accardi
Kristen Carlson Accardi (2):
stkutil: convert img to xpm
test-stkutil: unit test for img to xpm converter
src/stkutil.c | 108 ++++++++++++++++++++++++
src/stkutil.h | 1 +
unit/test-stkutil.c | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 342 insertions(+), 0 deletions(-)
10 years, 6 months
[PATCH] sim: Read EFust and EFest
by Yang Gu
---
src/sim.c | 77 +++++++++++++++++++++++++++++++++++++++++++-
src/simutil.h | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 173 insertions(+), 2 deletions(-)
diff --git a/src/sim.c b/src/sim.c
index 2514e7b..2e304dd 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -95,6 +95,8 @@ struct ofono_sim {
void *driver_data;
struct ofono_atom *atom;
DBusMessage *pending;
+ gboolean service_alloc[88];
+ gboolean service_actv[3];
};
struct msisdn_set_request {
@@ -1059,6 +1061,77 @@ static void sim_retrieve_imsi(struct ofono_sim *sim)
sim->driver->read_imsi(sim, sim_imsi_cb, sim);
}
+static void sim_efest_read_cb(int ok, int length, int record,
+ const unsigned char *data,
+ int record_length, void *userdata)
+{
+ struct ofono_sim *sim = userdata;
+ int i;
+ int size;
+
+ if (!ok)
+ return;
+
+ if (length < 1) {
+ ofono_error("EFest shall contain at least one byte");
+ return;
+ }
+
+ size = sizeof(sim->service_actv) / sizeof(*sim->service_actv);
+ for (i = 0; i < size; i++) {
+ if (i / 8 >= length)
+ sim->service_actv[i] = 0;
+ else
+ sim->service_actv[i] = (data[i / 8] >> (i % 8)) & 1;
+ }
+}
+
+static void sim_retrieve_efest(struct ofono_sim *sim)
+{
+ ofono_sim_read(sim, SIM_EFEST_FILEID,
+ OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
+ sim_efest_read_cb, sim);
+}
+
+static void sim_efust_read_cb(int ok, int length, int record,
+ const unsigned char *data,
+ int record_length, void *userdata)
+{
+ struct ofono_sim *sim = userdata;
+ int i;
+ int size;
+
+ if (!ok)
+ return;
+
+ if (length < 1) {
+ ofono_error("EFust shall contain at least one byte");
+ return;
+ }
+
+ size = sizeof(sim->service_alloc) / sizeof(*sim->service_alloc);
+ for (i = 0; i < size; i++) {
+ if (i / 8 >= length)
+ sim->service_alloc[i] = 0;
+ else
+ sim->service_alloc[i] = (data[i / 8] >> (i % 8)) & 1;
+ }
+}
+
+static void sim_retrieve_efust(struct ofono_sim *sim)
+{
+ ofono_sim_read(sim, SIM_EFUST_FILEID,
+ OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
+ sim_efust_read_cb, sim);
+}
+
+static void sim_service_request(struct ofono_sim *sim)
+{
+ sim_retrieve_efust(sim);
+ sim_retrieve_efest(sim);
+ sim_retrieve_imsi(sim);
+}
+
static void sim_pin_query_cb(const struct ofono_error *error,
enum ofono_sim_password_type pin_type,
void *data)
@@ -1088,13 +1161,13 @@ static void sim_pin_query_cb(const struct ofono_error *error,
checkdone:
if (pin_type == OFONO_SIM_PASSWORD_NONE)
- sim_retrieve_imsi(sim);
+ sim_service_request(sim);
}
static void sim_pin_check(struct ofono_sim *sim)
{
if (!sim->driver->query_passwd_state) {
- sim_retrieve_imsi(sim);
+ sim_service_request(sim);
return;
}
diff --git a/src/simutil.h b/src/simutil.h
index 29194ca..76ac433 100644
--- a/src/simutil.h
+++ b/src/simutil.h
@@ -26,9 +26,11 @@ enum sim_fileid {
SIM_EF_CPHS_MWIS_FILEID = 0x6f11,
SIM_EF_CPHS_INFORMATION_FILEID = 0x6f16,
SIM_EF_CPHS_MBDN_FILEID = 0x6f17,
+ SIM_EFUST_FILEID = 0x6f38,
SIM_EFMSISDN_FILEID = 0x6f40,
SIM_EFSPN_FILEID = 0x6f46,
SIM_EFSDN_FILEID = 0x6f49,
+ SIM_EFEST_FILEID = 0x6f56,
SIM_EFAD_FILEID = 0x6fad,
SIM_EFPHASE_FILEID = 0x6fae,
SIM_EFPNN_FILEID = 0x6fc5,
@@ -53,6 +55,102 @@ enum sim_file_access {
SIM_FILE_ACCESS_NEVER = 15,
};
+/* 131.102 Section 4.2.8 */
+enum usim_alloc_service {
+ USIM_ALLOC_SERVICE_LOCAL_PHONE_BOOK = 0,
+ USIM_ALLOC_SERVICE_FDN = 1,
+ USIM_ALLOC_SERVICE_EXT_2 = 2,
+ USIM_ALLOC_SERVICE_SDN = 3,
+ USIM_ALLOC_SERVICE_EXT_3 = 4,
+ USIM_ALLOC_SERVICE_BDN = 5,
+ USIM_ALLOC_SERVICE_EXT_4 = 6,
+ USIM_ALLOC_SERVICE_OCI_OCT = 7,
+ USIM_ALLOC_SERVICE_ICI_ICT = 8,
+ USIM_ALLOC_SERVICE_SMS = 9,
+ USIM_ALLOC_SERVICE_SMSR = 10,
+ USIM_ALLOC_SERVICE_SMSP = 11,
+ USIM_ALLOC_SERVICE_AOC = 12,
+ USIM_ALLOC_SERVICE_CCP2 = 13,
+ USIM_ALLOC_SERVICE_CBS_ID = 14,
+ USIM_ALLOC_SERVICE_CBS_ID_RANGE = 15,
+ USIM_ALLOC_SERVICE_GROUP_ID_LEVEL_1 = 16,
+ USIM_ALLOC_SERVICE_GROUP_ID_LEVEL_2 = 17,
+ USIM_ALLOC_SERVICE_PROVIDER_NAME = 18,
+ USIM_ALLOC_SERVICE_USER_PLMN = 19,
+ USIM_ALLOC_SERVICE_MSISDN = 20,
+ USIM_ALLOC_SERVICE_IMG = 21,
+ USIM_ALLOC_SERVICE_SOLSA = 22,
+ USIM_ALLOC_SERVICE_PRECEDENCE_PREEMPTION = 23,
+ USIM_ALLOC_SERVICE_EMLPP = 24,
+ USIM_ALLOC_SERVICE_GSM_ACCESS = 26,
+ USIM_ALLOC_SERVICE_DATA_DOWNLOAD_SMS_PP = 27,
+ USIM_ALLOC_SERVICE_DATA_DOWNLOAD_SMS_CB = 28,
+ USIM_ALLOC_SERVICE_CALL_CONTROL_USIM = 29,
+ USIM_ALLOC_SERVICE_MO_SMS_USIM = 30,
+ USIM_ALLOC_SERVICE_RUN_AT_COMMAND = 31,
+ USIM_ALLOC_SERVICE_ENABLED_SERVICE_TABLE = 33,
+ USIM_ALLOC_SERVICE_ACL = 34,
+ USIM_ALLOC_SERVICE_DEPERSONALISATION_CTRL_KEY = 35,
+ USIM_ALLOC_SERVICE_NETWORK_LIST = 36,
+ USIM_ALLOC_SERVICE_GSM_SECURITY_CONTEXT = 37,
+ USIM_ALLOC_SERVICE_CPBCCH = 38,
+ USIM_ALLOC_SERVICE_INVESTIGATION_SCAN = 39,
+ USIM_ALLOC_SERVICE_MEXE = 40,
+ USIM_ALLOC_SERVICE_OPERATOR_PLMN = 41,
+ USIM_ALLOC_SERVICE_HPLMN = 42,
+ USIM_ALLOC_SERVICE_EXT_5 = 43,
+ USIM_ALLOC_SERVICE_PLMN_NETWORK_NAME = 44,
+ USIM_ALLOC_SERVICE_OPERATOR_PLMN_LIST = 45,
+ USIM_ALLOC_SERVICE_MAILBOX_DIALLING_NUMBERS = 46,
+ USIM_ALLOC_SERVICE_MWIS = 47,
+ USIM_ALLOC_SERVICE_CFIS = 48,
+ USIM_ALLOC_SERVICE_PROVIDER_DISPLAY_INFO = 50,
+ USIM_ALLOC_SERVICE_MMS = 51,
+ USIM_ALLOC_SERVICE_EXT_8 = 52,
+ USIM_ALLOC_SERVICE_CALL_CONTROL_GPRS_USIM = 53,
+ USIM_ALLOC_SERVICE_MMS_USER_CONN_PARAM = 54,
+ USIM_ALLOC_SERVICE_NIA = 55,
+ USIM_ALLOC_SERVICE_EFVGCS_EFVGCSS = 56,
+ USIM_ALLOC_SERVICE_EFVBS_EFVBSS = 57,
+ USIM_ALLOC_SERVICE_PSEUDONYM = 58,
+ USIM_ALLOC_SERVICE_USER_PLMN_I_WLAN = 59,
+ USIM_ALLOC_SERVICE_OPERATOR_PLMN_I_WLAN = 60,
+ USIM_ALLOC_SERVICE_USER_WSID = 61,
+ USIM_ALLOC_SERVICE_OPERATOR_WSID = 62,
+ USIM_ALLOC_SERVICE_VGCS_SECURITY = 63,
+ USIM_ALLOC_SERVICE_VBS_SECURITY = 64,
+ USIM_ALLOC_SERVICE_WLAN_REAUTH_ID = 65,
+ USIM_ALLOC_SERVICE_MMS_STORAGE = 66,
+ USIM_ALLOC_SERVICE_GBA = 67,
+ USIM_ALLOC_SERVICE_MBMS_SECURITY = 68,
+ USIM_ALLOC_SERVICE_USSD_APPLICATION_MODE = 69,
+ USIM_ALLOC_SERVICE_EQUIVALENT_HPLMN = 70,
+ USIM_ALLOC_SERVICE_ADDITIONAL_TERMINAL_PROFILE = 71,
+ USIM_ALLOC_SERVICE_EQUIVALENT_HPLMN_IND = 72,
+ USIM_ALLOC_SERVICE_LAST_RPLMN_IND = 73,
+ USIM_ALLOC_SERVICE_OMA_BCAST_SC_PROFILE = 74,
+ USIM_ALLOC_SERVICE_BGA_LOCAL_KEY = 75,
+ USIM_ALLOC_SERVICE_TERMINAL_APPLICATIONS = 76,
+ USIM_ALLOC_SERVICE_PROVIDER_NAME_ICON = 77,
+ USIM_ALLOC_SERVICE_PLMN_NETWORK_NAME_ICON = 78,
+ USIM_ALLOC_SERVICE_CONN_PARAM_USIM_IP = 79,
+ USIM_ALLOC_SERVICE_HOME_I_WLAN_ID_LIST = 80,
+ USIM_ALLOC_SERVICE_I_WLAN_EQUIVALENT_HPLMN_IND = 81,
+ USIM_ALLOC_SERVICE_I_WLAN_HPLMN_PRIORITY_IND = 82,
+ USIM_ALLOC_SERVICE_I_WLAN_LAST_PLMN = 83,
+ USIM_ALLOC_SERVICE_EPS_INFO = 84,
+ USIM_ALLOC_SERVICE_CSG_IND = 85,
+ USIM_ALLOC_SERVICE_CALL_CONTROL_EPS_PDN_USIM = 86,
+ USIM_ALLOC_SERVICE_HPLMN_DIRECT_ACCESS = 87
+};
+
+/* 131.102 Section 4.2.47 */
+enum usim_actv_service {
+ USIM_ACTV_SERVICE_FDN = 0,
+ USIM_ACTV_SERVICE_BDN = 1,
+ USIM_ACTV_SERVICE_ACL = 2
+};
+
#define SIM_EFSPN_DC_HOME_PLMN_BIT 0x1
#define SIM_EFSPN_DC_ROAMING_SPN_BIT 0x2
--
1.7.0.4
10 years, 6 months
About the TDS-CDMA support of oFono
by Zheng Zhang
Hi,
I have a plan to use oFono in the TDS-CDMA environment in China.(Maybe I can
use Huawei E180 USB Wireless modem).
And it seems like that oFone only supported for WCDMA/GSM, so do I need some
adaptation of oFone for the TDS-CDMA support?Thank you !
Br
Zheng
10 years, 6 months
ISI drivers test simulator
by Alan KREUTZ
Hello all,
I started to study and work on oFono and I'm searching for a way to test
ISI modem driver.
I have noticed that oFono AT modem driver can be tested with phonesim
simulator and that it can be possible to use oFono ISI drivers with a
Nokia mobile phone (for example N900 mobile phone).
My questions are:
1- Is, the fact to test oFono ISI driver with a Nokia phone, the only
way to test ISI drivers or is there a simulator like phonesim for ISI
driver?
2- How to test oFono with a Nokia mobile? I believe that the plugin
usbpnmodem.c must be used to communicate with modem via USB and it seems
that Maemo (or MeeGo) is mandatory too. Is this correct?
3- And last question, if a Nokia modem is connected via USB to a PC,
is the Nokia's modem disconnected from UI part in order to receive and
treat only messages from host (PC/oFono)?
Thanks for your answer,
Best Regards,
Alan
10 years, 6 months
[PATCH] doc: stk-api proposal
by Denis Kenzior
Up for comment is the Sim Application Toolkit API proposal for oFono. It is
largely based on Andrew's API proposal with several changes in areas I felt
needed further attention. I'd like all interested to comment, what looks
good, what looks crummy? Is anything missing?
Please note that the proposal only covers Setup Menu, Setup Idle Mode Text,
Select Item, Display Text, Get Inkey and Get Input proactive commands.
Also, several aspects of these commands are explicitly ignored, e.g. the user
help system.
---
doc/stk-api.txt | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 162 insertions(+), 0 deletions(-)
create mode 100644 doc/stk-api.txt
diff --git a/doc/stk-api.txt b/doc/stk-api.txt
new file mode 100644
index 0000000..96bf710
--- /dev/null
+++ b/doc/stk-api.txt
@@ -0,0 +1,162 @@
+SimToolkit Hierarchy
+===============
+
+Service org.ofono
+Interface org.ofono.SimToolkit
+Object path [variable prefix]/{modem0,modem1,...}
+
+Methods dict GetProperties()
+
+ Returns properties for the SimToolkit object. See the
+ properties section for available properties.
+
+ Possible Errors: [service].Error.InvalidArguments
+
+ void RegisterAgent(object path)
+
+ Registers a default agent to be used for SIM initiated
+ actions such as Display Text, Get Inkey or Get Input.
+ These can typically occur when a special SMS is
+ received and might not involve interaction from the
+ user.
+
+ Possible Errors: [service].Error.InvalidArguments
+ [service].Error.InvalidFormat
+ [service].Error.InUse
+
+ void UnregisterAgent(object path)
+
+ Unregisters the default agent. If no agent is
+ registered then unsolicited commands from the SIM
+ are rejected.
+
+ Possible Errors: [service].Error.InvalidArguments
+ [service].Error.InvalidFormat
+ [service].Error.NotFound
+ [service].Error.NotAuthorized
+
+Properties string IdleText
+
+ Contains the text to be used when the home screen is
+ idle. This text is set by the SIM and can be changed
+ at any time.
+
+ array{string} MainMenuItems
+
+ Contains the items that make up the main menu. This
+ is populated by the SIM when it sends the Setup Menu
+ Proactive Command. The main menu is always available,
+ but its contents can be changed at any time.
+
+ array{array{bytes}} MainMenuIcons
+
+ Contains the icons associated with the main menu items.
+
+ string MainMenuTitle
+
+ Contains the title of the main menu.
+
+SimToolkitAgent Hierarchy
+===============
+
+Service unique name
+Interface org.ofono.SimToolkitAgent
+Object path freely definable
+
+Methods byte SelectItem(string title, array{string} items,
+ array{array{byte}} icons, byte default)
+
+ Tells the agent to ask the user to select an item
+ from the menu. This function should return the index
+ of the item or an error given below:
+
+ Possible Errors: [service].Error.SimToolkit.GoBack
+
+ Implementation notes:
+
+ - Data / Navigation type not indicated
+ - Soft key preferred not indicated
+ - Help available ignored
+
+ void DisplayText(string text, boolean urgent)
+
+ Tells the agent to display text from the SIM. The
+ boolean urgent parameter tells the agent whether this
+ is an urgent message and all other messages should be
+ cleared prior to the display of this text.
+
+ Possible Errors: [service].Error.SimToolkit.GoBack
+
+ Implementation notes:
+
+ - High / normal priority indicated by urgent
+ - clear / wait for user handled by setting a higher
+ timeout in the case of wait for user flag and using
+ the Cancel() method appropriately. If the agent
+ returns earlier from this method call, a terminal
+ response is sent.
+ - Immediate Response indication is handled internally,
+ terminal response is sent immediately and no other
+ indication is given to the user / agent. Response
+ from this method call is ignored and an infinite
+ timeout is used for the method call. Once another
+ proactive command arrives, and the DisplayText is
+ still pending, Cancel() is called.
+
+ string GetInput(string alpha, array{byte} icon,
+ string default, byte min, byte max,
+ boolean hide_typing)
+
+ Tells the agent to request an input string from the
+ user. The alpha parameter and icon gives context to
+ the user. The default string contains the suggested
+ default by the SIM. The min and max parameters contain
+ how many characters the user should enter. The
+ parameter hide_typing indicates whether user's typing
+ should be opaque.
+
+ Possible Errors: [service].Error.SimToolkit.GoBack
+
+ string GetDigits(string alpha, array{byte} icon,
+ string default, byte min, byte max,
+ boolean hide_typing)
+
+ Same as GetInput but only digit characters (0-9, *#+)
+ are expected.
+
+ Possible Errors: [service].Error.SimToolkit.GoBack
+
+ string GetKey(string alpha, array{byte} icon)
+
+ Tells the agent to request a single input key from
+ the user. The alpha parameter contains the context
+ for the request.
+
+ Possible Errors: [service].Error.SimToolkit.GoBack
+
+ string GetDigit(string alpha, array{byte} icon)
+
+ Same as above, but only digits (0-9, *#+) are
+ expected.
+
+ Possible Errors: [service].Error.SimToolkit.GoBack
+
+ boolean GetConfirmation(string alpha, array{byte} icon)
+
+ Asks the agent to get confirmation from the user.
+
+ Possible Errors: [service].Error.SimToolkit.GoBack
+
+ void Cancel()
+
+ Asks the agent to cancel any ongoing operation in
+ progress. This is usually either because the agent
+ is taking too long to respond or the Sim Application
+ has terminated the session.
+
+ void Release()
+
+ Agent is being released, possibly because of oFono
+ terminating, SimToolkit interface torn down or modem
+ off. If the agent is registered as a global agent,
+ no UnregisterAgent call is expected.
--
1.7.0.4
10 years, 6 months