aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-08-31 09:20:43 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-08-31 09:20:43 +0200
commit1e5b00e33b98dbfd3fc6208ff51c30f4b0b40d88 (patch)
tree896c2c1e4855bc8b1ffe746df2b2ec8f3b8d0d31 /src/mm-plugin.c
parent9faba582263f541048816d8e161166a525952a52 (diff)
plugin: let plugins decide if they want echo removal during AT probing
This is the port to git master of the following patch: commit 21e66dfa1774ac2ee037ac8b6e8bb4d71a6f7931 Author: Dan Williams <dcbw@redhat.com> Date: Thu Aug 23 21:13:35 2012 -0500 core: add function to open probe ports without removing echo Some devices (Sierra GSM ones) return stuff we need but don't bother to prefix it with <CR><LF>, so we need to optionally turn off the echo removal at probe time.
Diffstat (limited to 'src/mm-plugin.c')
-rw-r--r--src/mm-plugin.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mm-plugin.c b/src/mm-plugin.c
index a1a1c33f..a8009976 100644
--- a/src/mm-plugin.c
+++ b/src/mm-plugin.c
@@ -69,6 +69,7 @@ struct _MMPluginPrivate {
MMPortProbeAtCommand *custom_at_probe;
MMAsyncMethod *custom_init;
guint64 send_delay;
+ gboolean remove_echo;
};
enum {
@@ -93,6 +94,7 @@ enum {
PROP_CUSTOM_AT_PROBE,
PROP_CUSTOM_INIT,
PROP_SEND_DELAY,
+ PROP_REMOVE_ECHO,
LAST_PROP
};
@@ -658,6 +660,7 @@ mm_plugin_supports_port (MMPlugin *self,
mm_port_probe_run (probe,
ctx->flags,
self->priv->send_delay,
+ self->priv->remove_echo,
self->priv->custom_at_probe,
self->priv->custom_init,
(GAsyncReadyCallback)port_probe_run_ready,
@@ -737,6 +740,7 @@ mm_plugin_init (MMPlugin *self)
/* Defaults */
self->priv->send_delay = 100000;
+ self->priv->remove_echo = TRUE;
}
static void
@@ -828,6 +832,10 @@ set_property (GObject *object,
/* Construct only */
self->priv->send_delay = (guint64)g_value_get_uint64 (value);
break;
+ case PROP_REMOVE_ECHO:
+ /* Construct only */
+ self->priv->remove_echo = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -903,6 +911,9 @@ get_property (GObject *object,
case PROP_SEND_DELAY:
g_value_set_uint64 (value, self->priv->send_delay);
break;
+ case PROP_REMOVE_ECHO:
+ g_value_set_boolean (value, self->priv->remove_echo);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1104,4 +1115,12 @@ mm_plugin_class_init (MMPluginClass *klass)
"in microseconds",
0, G_MAXUINT64, 100000,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+ g_object_class_install_property
+ (object_class, PROP_REMOVE_ECHO,
+ g_param_spec_boolean (MM_PLUGIN_REMOVE_ECHO,
+ "Remove echo",
+ "Remove echo out of the AT responses",
+ TRUE,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}