Modem emulator and DUN server side for oFono and BlueZ
by Zhang, Zhenhua
Hi,
I am now working on modem emulator and one usage is for DUN server role. Since Padovan is working on client role, it's good to share my rough thinking for server side implementation. Here are the simple steps I have:
1. Create an oFono emulator atom in oFono. It's the emulator manager that could create DUN, HFP AG or SPP type emulators. It exposes dbus methods like CreateEmulator, DestroyEmulator, GetProperty, etc.
2. DUN agent server in BlueZ watch oFono and call CreateEmulator and pass the file descriptor to oFono. This server could further implement HFP AG and SPP connection.
3. Once an emulator is created, other atom like voicecall, grps, sms register their interested AT command handlers to it. The goal is that we could handle all mandatory AT commands defined in DUN profile spec.
4. Once a DUN emulator received ATD*99#, DUN client performs ppp connection so we forward ppp command to ppp stack. It is done by ppp server side extension. It should be the simple command forwarding.
5. Once the PPP link over DUN is established, DUN client performs ConnMan integration and setup IP address, DNS server, etc.
6. Once the Bluetooth link is disconnected, we destroy the PPP and DUN emulator. If emulator atom itself is destroyed, we destroy the PPP and the Bluetooth connection. If the PPP link is disconnected but Bluetooth link is alive, we destroy the PPP and stay emulator alive.
Comments are welcome. :)
Regards,
Zhenhua
10 years, 6 months
[PATCH 1/9] stk: Utilities for proactive command/envelope handling
by Andrzej Zaborowski
---
include/stk.h | 2 +
src/stk.c | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++-------
2 files changed, 129 insertions(+), 17 deletions(-)
diff --git a/include/stk.h b/include/stk.h
index ad3f6c5..4e5d01e 100644
--- a/include/stk.h
+++ b/include/stk.h
@@ -65,6 +65,8 @@ void *ofono_stk_get_data(struct ofono_stk *stk);
void ofono_stk_proactive_command_notify(struct ofono_stk *stk,
int length, const unsigned char *pdu);
+void ofono_stk_proactive_command_cancel(struct ofono_stk *stk);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/stk.c b/src/stk.c
index b5c6919..e513b06 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -43,10 +43,61 @@ struct ofono_stk {
const struct ofono_stk_driver *driver;
void *driver_data;
struct ofono_atom *atom;
+ struct stk_command *pending_cmd;
+ void (*cancel_cmd)(struct ofono_stk *stk);
};
+static int stk_respond(struct ofono_stk *stk, struct stk_response *rsp,
+ void (*cb)(const struct ofono_error *error,
+ struct ofono_stk *stk))
+{
+ const guint8 *tlv;
+ unsigned int tlv_len;
+
+ rsp->src = STK_DEVICE_IDENTITY_TYPE_TERMINAL;
+ rsp->dst = STK_DEVICE_IDENTITY_TYPE_UICC;
+ rsp->number = stk->pending_cmd->number;
+ rsp->type = stk->pending_cmd->type;
+ rsp->qualifier = stk->pending_cmd->qualifier;
+
+ if (stk->driver->terminal_response == NULL)
+ return -ENOSYS;
+
+ tlv = stk_pdu_from_response(rsp, &tlv_len);
+ if (!tlv)
+ return -EINVAL;
+
+ stk->driver->terminal_response(stk, tlv_len, tlv,
+ (ofono_stk_generic_cb_t) cb, stk);
+ return 0;
+}
+
+static int stk_send_envelope(struct ofono_stk *stk, struct stk_envelope *e,
+ void (*cb)(const struct ofono_error *error,
+ const unsigned char *data,
+ int length,
+ struct ofono_stk *stk))
+{
+ const guint8 *tlv;
+ unsigned int tlv_len;
+
+ e->dst = STK_DEVICE_IDENTITY_TYPE_UICC;
+
+ if (stk->driver->envelope == NULL)
+ return -ENOSYS;
+
+ tlv = stk_pdu_from_envelope(e, &tlv_len);
+ if (!tlv)
+ return -EINVAL;
+
+ stk->driver->envelope(stk, tlv_len, tlv,
+ (ofono_stk_envelope_cb_t) cb, stk);
+ return 0;
+}
+
static void stk_cbs_download_cb(const struct ofono_error *error,
- const unsigned char *data, int len, void *user)
+ const unsigned char *data, int len,
+ struct ofono_stk *stk)
{
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
ofono_error("CellBroadcast download to UICC failed");
@@ -55,36 +106,62 @@ static void stk_cbs_download_cb(const struct ofono_error *error,
return;
}
+ if (len)
+ ofono_error("CellBroadcast download returned %i bytes of data",
+ len);
+
DBG("CellBroadcast download to UICC reported no error");
}
void __ofono_cbs_sim_download(struct ofono_stk *stk, const struct cbs *msg)
{
- const guint8 *tlv;
- unsigned int tlv_len;
+ struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
struct stk_envelope e;
+ int err;
- if (stk->driver->envelope == NULL)
- return;
+ memset(&e, 0, sizeof(e));
e.type = STK_ENVELOPE_TYPE_CBS_PP_DOWNLOAD;
e.src = STK_DEVICE_IDENTITY_TYPE_NETWORK;
- e.dst = STK_DEVICE_IDENTITY_TYPE_UICC;
memcpy(&e.cbs_pp_download.page, msg, sizeof(msg));
- tlv = stk_pdu_from_envelope(&e, &tlv_len);
- if (!tlv)
+ err = stk_send_envelope(stk, &e, stk_cbs_download_cb);
+ if (err)
+ stk_cbs_download_cb(&error, NULL, -1, stk);
+}
+
+static void stk_command_cb(const struct ofono_error *error,
+ struct ofono_stk *stk)
+{
+ stk_command_free(stk->pending_cmd);
+ stk->pending_cmd = NULL;
+
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+ ofono_error("TERMINAL RESPONSE to a UICC command failed");
+ /* "The ME may retry to deliver the same Cell Broadcast
+ * page." */
return;
+ }
- stk->driver->envelope(stk, tlv_len, tlv, stk_cbs_download_cb, stk);
+ DBG("TERMINAL RESPONSE to a command reported no errors");
+}
+
+void ofono_stk_proactive_command_cancel(struct ofono_stk *stk)
+{
+ if (!stk->pending_cmd)
+ return;
+
+ stk->cancel_cmd(stk);
}
void ofono_stk_proactive_command_notify(struct ofono_stk *stk,
int length, const unsigned char *pdu)
{
- struct stk_command *cmd;
+ struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
+ struct stk_response rsp;
char *buf;
- int i;
+ int i, err;
+ gboolean respond = TRUE;
buf = g_try_malloc(length * 2 + 1);
if (!buf)
@@ -93,18 +170,51 @@ void ofono_stk_proactive_command_notify(struct ofono_stk *stk,
for (i = 0; i < length; i ++)
sprintf(buf + i * 2, "%02hhx", pdu[i]);
- cmd = stk_command_new_from_pdu(pdu, length);
- if (!cmd) {
+ stk->pending_cmd = stk_command_new_from_pdu(pdu, length);
+ if (!stk->pending_cmd) {
ofono_error("Can't parse proactive command: %s", buf);
- /* TODO: return TERMINAL RESPONSE with permanent error */
+ /*
+ * Nothing we can do, we'd need at least Command Details
+ * to be able to respond with an error.
+ */
goto done;
}
- /* TODO: execute */
- ofono_info("Proactive command PDU: %s", buf);
+ ofono_debug("Proactive command PDU: %s", buf);
+
+ memset(&rsp, 0, sizeof(rsp));
+
+ switch (stk->pending_cmd->status) {
+ case STK_PARSE_RESULT_OK:
+ switch (stk->pending_cmd->type) {
+ default:
+ rsp.result.type =
+ STK_RESULT_TYPE_COMMAND_NOT_UNDERSTOOD;
+ break;
+ }
+
+ if (respond)
+ break;
+ return;
+
+ case STK_PARSE_RESULT_TYPE_NOT_UNDERSTOOD:
+ default:
+ rsp.result.type = STK_RESULT_TYPE_COMMAND_NOT_UNDERSTOOD;
+ break;
+
+ case STK_PARSE_RESULT_MISSING_VALUE:
+ rsp.result.type = STK_RESULT_TYPE_MINIMUM_NOT_MET;
+ break;
+
+ case STK_PARSE_RESULT_DATA_NOT_UNDERSTOOD:
+ rsp.result.type = STK_RESULT_TYPE_DATA_NOT_UNDERSTOOD;
+ break;
+ }
- stk_command_free(cmd);
+ err = stk_respond(stk, &rsp, stk_command_cb);
+ if (err)
+ stk_command_cb(&error, stk);
done:
g_free(buf);
--
1.7.1.86.g0e460.dirty
10 years, 6 months
[PATCH 1/6] stk: Handle the Get Inkey proactive command.
by Andrzej Zaborowski
The SimApplication agent method signature is:
string/Back/Terminate/Help GetKey(string message, string charset,
bool help_available, bool single_key)
charset is one of:
"yesno" - response needs to be "yes" or "no"
"digit" - one of 0-9, *, #, +
"gsm" - only characters from the GSM SMS charset
"any"
single_key indicates that only characters from the device's
key faces are allowed (e.g. no "+" allowed if device only
has a basic keypad), and that the key should be returned
without being shown on screen or waiting for any kind of
user confirmation.
These patches apply on top of the previous series.
---
src/stk.c | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 159 insertions(+), 1 deletions(-)
diff --git a/src/stk.c b/src/stk.c
index ff47649..a2649b1 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -31,6 +31,7 @@
#include <glib.h>
#include <gdbus.h>
#include <errno.h>
+#include <sys/time.h>
#include "ofono.h"
@@ -64,6 +65,7 @@ enum stk_agent_state {
STK_AGENT_MAIN_MENU,
STK_AGENT_SELECT_ITEM,
STK_AGENT_DISPLAY_TEXT,
+ STK_AGENT_GET_KEY,
};
struct ofono_stk {
@@ -83,6 +85,7 @@ struct ofono_stk {
struct stk_menu *main_menu;
struct stk_menu *select_item_menu;
+ struct timeval get_inkey_start_ts;
gboolean envelope_q_busy;
GQueue *envelope_q;
@@ -100,6 +103,7 @@ struct envelope_op {
#define OFONO_NAVIGATION_PREFIX OFONO_SERVICE ".Navigation."
#define OFONO_NAVIGATION_GOBACK OFONO_NAVIGATION_PREFIX "Back"
#define OFONO_NAVIGATION_TERMINATED OFONO_NAVIGATION_PREFIX "Terminated"
+#define OFONO_NAVIGATION_GETHELP OFONO_NAVIGATION_PREFIX "Help"
static void envelope_queue_run(struct ofono_stk *stk);
static void display_idle(struct ofono_stk *stk);
@@ -1041,7 +1045,6 @@ out:
display_idle(stk);
}
-
static gboolean handle_command_display_text(const struct stk_command *cmd,
struct stk_response *rsp,
struct ofono_stk *stk)
@@ -1067,6 +1070,157 @@ static gboolean handle_command_display_text(const struct stk_command *cmd,
return cmd->display_text.immediate_response;
}
+static void request_get_key_send(struct ofono_stk *stk, DBusMessage *call)
+{
+ struct stk_command_get_inkey *cmd = &stk->pending_cmd->get_inkey;
+ uint8_t qualifier = stk->pending_cmd->qualifier;
+ dbus_bool_t alphabet = (qualifier & (1 << 0)) != 0;
+ dbus_bool_t ucs2 = (qualifier & (1 << 1)) != 0;
+ dbus_bool_t yesno = (qualifier & (1 << 2)) != 0;
+ dbus_bool_t immediate = (qualifier & (1 << 3)) != 0;
+ dbus_bool_t help = (qualifier & (1 << 7)) != 0;
+ const char *charset =
+ yesno ? "yesno" :
+ (!alphabet ? "digit" :
+ (ucs2 ? "any" : "gsm"));
+
+ dbus_message_set_member(call, "GetKey");
+
+ dbus_message_append_args(call,
+ DBUS_TYPE_STRING, &cmd->text,
+ DBUS_TYPE_STRING, &charset,
+ DBUS_TYPE_BOOLEAN, &help,
+ DBUS_TYPE_BOOLEAN, &immediate,
+ DBUS_TYPE_INVALID);
+}
+
+static void request_get_key_cb(struct ofono_stk *stk, DBusMessage *reply)
+{
+ struct stk_command_get_inkey *cmd = &stk->pending_cmd->get_inkey;
+ uint8_t qualifier = stk->pending_cmd->qualifier;
+ dbus_bool_t yesno = (qualifier & (1 << 2)) != 0;
+ dbus_bool_t help = (qualifier & (1 << 7)) != 0;
+ DBusError err;
+ enum stk_result_type type = STK_RESULT_TYPE_SUCCESS;
+ struct stk_response rsp;
+ struct ofono_error error = { .type = OFONO_ERROR_TYPE_FAILURE };
+ char *key;
+
+ if (!reply) {
+ if (stk->cmd_timeout) {
+ app_agent_request_cancel(stk);
+
+ display_idle(stk);
+ return;
+ }
+
+ type = STK_RESULT_TYPE_NO_RESPONSE;
+
+ goto send;
+ }
+
+ dbus_error_init(&err);
+ if (dbus_set_error_from_message(&err, reply)) {
+ if (g_str_equal(err.name, OFONO_NAVIGATION_TERMINATED))
+ type = STK_RESULT_TYPE_USER_TERMINATED;
+ else if (g_str_equal(err.name, OFONO_NAVIGATION_GOBACK))
+ type = STK_RESULT_TYPE_GO_BACK;
+ else if (g_str_equal(err.name, OFONO_NAVIGATION_GETHELP) &&
+ help)
+ type = STK_RESULT_TYPE_HELP_REQUESTED;
+ else {
+ type = STK_RESULT_TYPE_USER_TERMINATED;
+
+ ofono_error("Unknown reply %s", err.name);
+ }
+
+ dbus_error_free(&err);
+ goto send;
+ }
+
+ if (dbus_message_get_args(reply, NULL,
+ DBUS_TYPE_STRING, &key,
+ DBUS_TYPE_INVALID) == FALSE) {
+ type = STK_RESULT_TYPE_USER_TERMINATED;
+
+ ofono_error("Reply not understood");
+ goto send;
+ }
+
+ if (yesno && strcasecmp(key, "yes") && strcasecmp(key, "no")) {
+ type = STK_RESULT_TYPE_USER_TERMINATED;
+
+ ofono_error("Yes/No reply not understood");
+ goto send;
+ } else if (yesno && strcasecmp(key, "yes"))
+ key = NULL; /* NULL indicates No, non-NULL indicates Yes */
+
+send:
+ memset(&rsp, 0, sizeof(rsp));
+ rsp.result.type = type;
+
+ if (type == STK_RESULT_TYPE_SUCCESS) {
+ rsp.get_inkey.text.text = key;
+ rsp.get_inkey.text.packed = FALSE;
+ rsp.get_inkey.text.yesno = yesno;
+ }
+
+ if (cmd->duration.interval) {
+ struct timeval end_ts;
+ int interval;
+
+ gettimeofday(&end_ts, NULL);
+
+ interval = (end_ts.tv_usec + 1099999 -
+ stk->get_inkey_start_ts.tv_usec) / 100000;
+ interval += (end_ts.tv_sec -
+ stk->get_inkey_start_ts.tv_sec) * 10;
+ interval -= 10;
+
+ switch (cmd->duration.unit) {
+ case STK_DURATION_TYPE_MINUTES:
+ interval = (interval + 59) / 60;
+ case STK_DURATION_TYPE_SECONDS:
+ interval = (interval + 9) / 10;
+ case STK_DURATION_TYPE_SECOND_TENTHS:
+ break;
+ }
+
+ rsp.get_inkey.duration.unit = cmd->duration.unit;
+ rsp.get_inkey.duration.interval = interval;
+ }
+
+ if (stk_respond(stk, &rsp, display_command_cb))
+ display_command_cb(&error, stk);
+}
+
+static gboolean handle_command_get_inkey(const struct stk_command *cmd,
+ struct stk_response *rsp,
+ struct ofono_stk *stk)
+{
+ int timeout = 0;
+
+ if (cmd->get_inkey.duration.interval) {
+ timeout = cmd->get_inkey.duration.interval;
+ switch (cmd->get_inkey.duration.unit) {
+ case STK_DURATION_TYPE_MINUTES:
+ timeout *= 60;
+ case STK_DURATION_TYPE_SECONDS:
+ timeout *= 10;
+ case STK_DURATION_TYPE_SECOND_TENTHS:
+ timeout *= 100;
+ }
+ }
+
+ gettimeofday(&stk->get_inkey_start_ts, NULL);
+
+ stk->custom_timeout = timeout;
+ app_agent_request_start(stk, request_get_key_send, request_get_key_cb,
+ STK_AGENT_GET_KEY);
+
+ return FALSE;
+}
+
void ofono_stk_proactive_command_cancel(struct ofono_stk *stk)
{
if (!stk->pending_cmd)
@@ -1140,6 +1294,10 @@ void ofono_stk_proactive_command_notify(struct ofono_stk *stk,
case STK_COMMAND_TYPE_DISPLAY_TEXT:
respond = handle_command_display_text(stk->pending_cmd,
&rsp, stk);
+ break;
+ case STK_COMMAND_TYPE_GET_INKEY:
+ respond = handle_command_get_inkey(stk->pending_cmd,
+ &rsp, stk);
}
if (respond)
--
1.7.1.86.g0e460.dirty
10 years, 6 months
Help regarding understanding of ofono atoms
by sai koushik
Hi all,
i am trying to understand the ofono source code and structure .
but i am not able find the exact usage of ofono atoms and logical
definition of ofono atoms , can somebody please help by giving some
info about ofono atoms.
Thanks,
ssk.
10 years, 6 months
[PATCH 1/2] huawei: Remove existing Huawei EM770 plugin
by Zhenhua Zhang
---
Makefile.am | 3 -
plugins/em770.c | 229 ---------------------------------------------------
plugins/ofono.rules | 2 -
plugins/udev.c | 26 ------
4 files changed, 0 insertions(+), 260 deletions(-)
delete mode 100644 plugins/em770.c
diff --git a/Makefile.am b/Makefile.am
index 96116a5..24aa886 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -232,9 +232,6 @@ builtin_sources += plugins/hso.c
builtin_modules += huawei
builtin_sources += plugins/huawei.c
-builtin_modules += em770
-builtin_sources += plugins/em770.c
-
builtin_modules += novatel
builtin_sources += plugins/novatel.c
diff --git a/plugins/em770.c b/plugins/em770.c
deleted file mode 100644
index de82f94..0000000
--- a/plugins/em770.c
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- *
- * oFono - Open Source Telephony
- *
- * Copyright (C) 2008-2010 Intel Corporation. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <errno.h>
-#include <stdlib.h>
-
-#include <glib.h>
-#include <gatchat.h>
-#include <gattty.h>
-
-#define OFONO_API_SUBJECT_TO_CHANGE
-#include <ofono/plugin.h>
-#include <ofono/log.h>
-#include <ofono/modem.h>
-#include <ofono/call-barring.h>
-#include <ofono/call-forwarding.h>
-#include <ofono/call-meter.h>
-#include <ofono/call-settings.h>
-#include <ofono/devinfo.h>
-#include <ofono/message-waiting.h>
-#include <ofono/netreg.h>
-#include <ofono/phonebook.h>
-#include <ofono/sim.h>
-#include <ofono/sms.h>
-#include <ofono/ssn.h>
-#include <ofono/ussd.h>
-#include <ofono/gprs.h>
-#include <ofono/voicecall.h>
-
-#include <drivers/atmodem/vendor.h>
-
-struct em770_data {
- GAtChat *chat;
-};
-
-static int em770_probe(struct ofono_modem *modem)
-{
- struct em770_data *data;
-
- DBG("%p", modem);
-
- data = g_try_new0(struct em770_data, 1);
- if (!data)
- return -ENOMEM;
-
- ofono_modem_set_data(modem, data);
-
- return 0;
-}
-
-static void em770_remove(struct ofono_modem *modem)
-{
- struct em770_data *data = ofono_modem_get_data(modem);
-
- DBG("%p", modem);
-
- ofono_modem_set_data(modem, NULL);
-
- g_at_chat_unref(data->chat);
- g_free(data);
-}
-
-static void em770_debug(const char *str, void *user_data)
-{
- ofono_info("%s", str);
-}
-
-static void cfun_enable(gboolean ok, GAtResult *result, gpointer user_data)
-{
- struct ofono_modem *modem = user_data;
-
- DBG("");
-
- if (ok)
- ofono_modem_set_powered(modem, TRUE);
-}
-
-static int em770_enable(struct ofono_modem *modem)
-{
- struct em770_data *data = ofono_modem_get_data(modem);
- GAtSyntax *syntax;
- GIOChannel *channel;
- const char *device;
-
- DBG("%p", modem);
-
- device = ofono_modem_get_string(modem, "Device");
- if (!device)
- return -EINVAL;
-
- channel = g_at_tty_open(device, NULL);
- if (!channel)
- return -EIO;
-
- syntax = g_at_syntax_new_gsmv1();
- data->chat = g_at_chat_new(channel, syntax);
- g_at_syntax_unref(syntax);
- g_io_channel_unref(channel);
-
- if (!data->chat)
- return -EIO;
-
- g_at_chat_add_terminator(data->chat, "COMMAND NOT SUPPORT", -1, FALSE);
- g_at_chat_add_terminator(data->chat, "TOO MANY PARAMETERS", -1, FALSE);
-
- if (getenv("OFONO_AT_DEBUG"))
- g_at_chat_set_debug(data->chat, em770_debug, NULL);
-
- g_at_chat_send(data->chat, "ATE0", NULL, NULL, NULL, NULL);
-
- g_at_chat_send(data->chat, "AT+CFUN=1", NULL,
- cfun_enable, modem, NULL);
-
- return 0;
-}
-
-static void cfun_disable(gboolean ok, GAtResult *result, gpointer user_data)
-{
- struct ofono_modem *modem = user_data;
- struct em770_data *data = ofono_modem_get_data(modem);
-
- DBG("");
-
- g_at_chat_unref(data->chat);
- data->chat = NULL;
-
- if (ok)
- ofono_modem_set_powered(modem, FALSE);
-}
-
-static int em770_disable(struct ofono_modem *modem)
-{
- struct em770_data *data = ofono_modem_get_data(modem);
-
- DBG("%p", modem);
-
- if (!data->chat)
- return 0;
-
- g_at_chat_cancel_all(data->chat);
- g_at_chat_unregister_all(data->chat);
- g_at_chat_send(data->chat, "AT+CFUN=0", NULL,
- cfun_disable, modem, NULL);
-
- return -EINPROGRESS;
-}
-
-static void em770_pre_sim(struct ofono_modem *modem)
-{
- struct em770_data *data = ofono_modem_get_data(modem);
- struct ofono_sim *sim;
-
- DBG("%p", modem);
-
- ofono_devinfo_create(modem, 0, "atmodem", data->chat);
- sim = ofono_sim_create(modem, 0, "atmodem", data->chat);
- ofono_voicecall_create(modem, 0, "atmodem", data->chat);
-
- if (sim)
- ofono_sim_inserted_notify(sim, TRUE);
-}
-
-static void em770_post_sim(struct ofono_modem *modem)
-{
- struct em770_data *data = ofono_modem_get_data(modem);
- struct ofono_message_waiting *mw;
-
- DBG("%p", modem);
-
- ofono_ussd_create(modem, 0, "atmodem", data->chat);
- ofono_call_forwarding_create(modem, 0, "atmodem", data->chat);
- ofono_call_settings_create(modem, 0, "atmodem", data->chat);
- ofono_netreg_create(modem, 0, "atmodem", data->chat);
- ofono_call_meter_create(modem, 0, "atmodem", data->chat);
- ofono_call_barring_create(modem, 0, "atmodem", data->chat);
- ofono_ssn_create(modem, 0, "atmodem", data->chat);
- ofono_sms_create(modem, OFONO_VENDOR_QUALCOMM_MSM, "atmodem", data->chat);
- ofono_phonebook_create(modem, 0, "atmodem", data->chat);
-
- mw = ofono_message_waiting_create(modem);
- if (mw)
- ofono_message_waiting_register(mw);
-}
-
-static struct ofono_modem_driver em770_driver = {
- .name = "em770",
- .probe = em770_probe,
- .remove = em770_remove,
- .enable = em770_enable,
- .disable = em770_disable,
- .pre_sim = em770_pre_sim,
- .post_sim = em770_post_sim,
-};
-
-static int em770_init(void)
-{
- return ofono_modem_driver_register(&em770_driver);
-}
-
-static void em770_exit(void)
-{
- ofono_modem_driver_unregister(&em770_driver);
-}
-
-OFONO_PLUGIN_DEFINE(em770, "HUAWEI EM770 modem driver", VERSION,
- OFONO_PLUGIN_PRIORITY_DEFAULT, em770_init, em770_exit)
diff --git a/plugins/ofono.rules b/plugins/ofono.rules
index 4d68023..06c5c8f 100644
--- a/plugins/ofono.rules
+++ b/plugins/ofono.rules
@@ -331,8 +331,6 @@ ENV{DEVTYPE}!="usb_device", GOTO="ofono_end"
# HUAWEI Technology
ATTRS{idVendor}=="12d1", ENV{OFONO_DRIVER}="huawei"
-# HUAWEI EM770
-ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1404", ENV{OFONO_DRIVER}="em770"
# Novatel Wireless
ATTRS{idVendor}=="1410", ENV{OFONO_DRIVER}="novatel"
diff --git a/plugins/udev.c b/plugins/udev.c
index 178f383..09ee93e 100644
--- a/plugins/udev.c
+++ b/plugins/udev.c
@@ -258,30 +258,6 @@ static void add_huawei(struct ofono_modem *modem,
ofono_modem_register(modem);
}
-static void add_em770(struct ofono_modem *modem,
- struct udev_device *udev_device)
-{
- const char *devnode, *intfnum;
- struct udev_device *parent;
- int registered;
-
- registered = ofono_modem_get_integer(modem, "Registered");
- if (registered != 0)
- return;
-
- parent = udev_device_get_parent(udev_device);
- parent = udev_device_get_parent(parent);
- intfnum = udev_device_get_sysattr_value(parent, "bInterfaceNumber");
-
- if (g_strcmp0(intfnum, "02") == 0) {
- devnode = udev_device_get_devnode(udev_device);
- ofono_modem_set_string(modem, "Device", devnode);
-
- ofono_modem_set_integer(modem, "Registered", 1);
- ofono_modem_register(modem);
- }
-}
-
static void add_novatel(struct ofono_modem *modem,
struct udev_device *udev_device)
{
@@ -361,8 +337,6 @@ static void add_modem(struct udev_device *udev_device)
add_hso(modem, udev_device);
else if (g_strcmp0(driver, "huawei") == 0)
add_huawei(modem, udev_device);
- else if (g_strcmp0(driver, "em770") == 0)
- add_em770(modem, udev_device);
else if (g_strcmp0(driver, "novatel") == 0)
add_novatel(modem, udev_device);
}
--
1.6.3.3
10 years, 6 months
[PATCH 0/3] Merge Huawei EM770 into plugins/huawei.c
by Zhenhua Zhang
This series merges existing plugins/em770.c with plugins/huawei.c. The most part of EM770 is the same as plugins/huawei.c, except EM770 has voicecall capability. The idea is to get modem model from udev. If it is EM770, we enable voicecall and related features for EM770 only.
Best Regards,
Zhenhua
10 years, 6 months
[PATCH 0/3] html text attribute patches
by Kristen Carlson Accardi
Modified stkutil per last review. Added unit tests for Display Text
tests. I will add the rest of the unit tests after this patch series
is reviewed.
Kristen Carlson Accardi (3):
stkutil: display text attributes as html
test-stkutil: add unit test for html text attributes
test-stkutil: add html attribute test for Display Text tests
src/stkutil.c | 190 ++++++++++++++++++++++++++++++++++
src/stkutil.h | 23 ++++
unit/test-stkutil.c | 280 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 493 insertions(+), 0 deletions(-)
10 years, 6 months
[PATCH 00/10] html text attributes patches
by Kristen Carlson Accardi
Incorporated feedback from last review. Added requested
unit tests.
Kristen Carlson Accardi (10):
stkutil: display text attributes as html
test-stkutil: add unit test for html text attributes
test-stkutil: add html attribute test for Display Text tests
test-stkutil: add html attribute tests for get_inkey_test
test-stkutil: add html attribute tests for get_input_test
test-stkutil: add html attribute tests for play_tone_test
test-stkutil: add html attribute test for setup_menu_test
test-stkutil: add html attribute test for select_item_test
test-stkutil: add html attribute tests for setup idle mode tests
test-stkutil: add html_attr_test for special chars
src/stkutil.c | 219 ++++++++++++++++
src/stkutil.h | 2 +
unit/test-stkutil.c | 687 ++++++++++++++++++++++++++++++++++++++++++++-------
3 files changed, 816 insertions(+), 92 deletions(-)
10 years, 6 months
[PATCH] Voicecall gaps.
by Pekka.Pessi@nokia.com
From: Pekka Pessi <Pekka.Pessi(a)nokia.com>
Missing voicecall functionality pieces from tp-ring point-of-view.
---
TODO | 27 +++++++++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
diff --git a/TODO b/TODO
index 470d4a6..e6ef20d 100644
--- a/TODO
+++ b/TODO
@@ -265,6 +265,33 @@ Supplementary Services
Complexity: C8
+Voicecall
+=========
+
+- Supplementary service notifications for remote party putting call on hold
+ or retrieving the call or joining call to a multiparty conference.
+
+ Priority: Medium
+ Complexity: C1
+ Owner: Pekka Pessi <pekka.pessi(a)nokia.com>
+
+- Dial strings. Include CLIR prefixes and 2nd stage dial strings in call history.
+
+ Priority: Medium
+ Complexity: C2
+
+- Start DTMF, Stop DTMF, feedback of sent DTMF tones.
+
+ Priority: Medium
+ Complexity: C2
+
+- Add atom for assisting in local supervisory tone generation when modem
+ does include tones in media streams.
+
+ Priority: Medium
+ Complexity: C2
+
+
Miscellaneous
=============
--
1.7.0.4
10 years, 6 months