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)
This commit is contained in:
committed by
Dan Williams
parent
7348b4c0c8
commit
2a9a6ad79b
@@ -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;
|
||||
}
|
||||
@@ -135,6 +140,10 @@ mm_modem_nokia_class_init (MMModemNokiaClass *klass)
|
||||
object_class->get_property = get_property;
|
||||
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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user