aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2011-08-20 17:22:28 +0200
committerDan Williams <dcbw@redhat.com>2011-08-25 22:00:56 -0500
commit2a9a6ad79b4bfe5d83e938c929c229a930c513a8 (patch)
tree7b3b82b89d6330f62b636a27ea069240cbaa46f0
parent7348b4c0c872a09103d32fe44cb4c2a086eaa66b (diff)
nokia: use E1 E0 when initializing the modem
Passing E1 and E0 afterwards seems to properly disable the echo in Nokia modems (N900 and C7 at least)
-rw-r--r--plugins/mm-modem-nokia.c9
-rw-r--r--plugins/mm-plugin-nokia.c22
2 files changed, 31 insertions, 0 deletions
diff --git a/plugins/mm-modem-nokia.c b/plugins/mm-modem-nokia.c
index 56f4c1b7..9476f615 100644
--- a/plugins/mm-modem-nokia.c
+++ b/plugins/mm-modem-nokia.c
@@ -120,6 +120,11 @@ get_property (GObject *object, guint prop_id,
case MM_GENERIC_GSM_PROP_POWER_DOWN_CMD:
g_value_set_string (value, "");
break;
+ case MM_GENERIC_GSM_PROP_INIT_CMD:
+ /* When initializing a Nokia phone, first enable the echo,
+ * and then disable it, so that we get it properly disabled */
+ g_value_set_string (value, "Z E1 E0 V1");
+ break;
default:
break;
}
@@ -136,6 +141,10 @@ mm_modem_nokia_class_init (MMModemNokiaClass *klass)
object_class->set_property = set_property;
g_object_class_override_property (object_class,
+ MM_GENERIC_GSM_PROP_INIT_CMD,
+ MM_GENERIC_GSM_INIT_CMD);
+
+ g_object_class_override_property (object_class,
MM_GENERIC_GSM_PROP_POWER_UP_CMD,
MM_GENERIC_GSM_POWER_UP_CMD);
diff --git a/plugins/mm-plugin-nokia.c b/plugins/mm-plugin-nokia.c
index f605a233..12a00d36 100644
--- a/plugins/mm-plugin-nokia.c
+++ b/plugins/mm-plugin-nokia.c
@@ -59,6 +59,22 @@ probe_result (MMPluginBase *base,
mm_plugin_base_supports_task_complete (task, get_level_for_capabilities (capabilities));
}
+static gboolean
+custom_init_response_cb (MMPluginBaseSupportsTask *task,
+ GString *response,
+ GError *error,
+ guint32 tries,
+ gboolean *out_stop,
+ guint32 *out_level,
+ gpointer user_data)
+{
+ if (error)
+ return tries <= 4 ? TRUE : FALSE;
+
+ /* No error, assume success */
+ return FALSE;
+}
+
static MMPluginSupportsResult
supports_port (MMPluginBase *base,
MMModem *existing,
@@ -95,6 +111,12 @@ supports_port (MMPluginBase *base,
return MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED;
}
+ mm_plugin_base_supports_task_add_custom_init_command (task,
+ "ATE1 E0",
+ 3,
+ custom_init_response_cb,
+ NULL);
+
/* Otherwise kick off a probe */
if (mm_plugin_base_probe_port (base, task, 100000, NULL))
return MM_PLUGIN_SUPPORTS_PORT_IN_PROGRESS;