diff options
-rw-r--r-- | plugins/mm-modem-nokia.c | 9 | ||||
-rw-r--r-- | plugins/mm-plugin-nokia.c | 22 |
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; |