aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mm-plugin.c19
-rw-r--r--src/mm-plugin.h1
-rw-r--r--src/mm-port-probe.c11
-rw-r--r--src/mm-port-probe.h1
4 files changed, 29 insertions, 3 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));
}
diff --git a/src/mm-plugin.h b/src/mm-plugin.h
index 14c16d35..6d5d14e1 100644
--- a/src/mm-plugin.h
+++ b/src/mm-plugin.h
@@ -58,6 +58,7 @@
#define MM_PLUGIN_CUSTOM_INIT "custom-init"
#define MM_PLUGIN_CUSTOM_AT_PROBE "custom-at-probe"
#define MM_PLUGIN_SEND_DELAY "send-delay"
+#define MM_PLUGIN_REMOVE_ECHO "remove-echo"
typedef enum {
MM_PLUGIN_SUPPORTS_PORT_UNSUPPORTED = 0x0,
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index 3d9cd37c..f30e8fdc 100644
--- a/src/mm-port-probe.c
+++ b/src/mm-port-probe.c
@@ -78,6 +78,8 @@ typedef struct {
GCancellable *at_probing_cancellable;
/* Send delay for AT commands */
guint64 at_send_delay;
+ /* Flag to leave/remove echo in AT responses */
+ gboolean at_remove_echo;
/* Number of times we tried to open the AT port */
guint at_open_tries;
/* Custom initialization setup */
@@ -904,9 +906,10 @@ serial_open_at (MMPortProbe *self)
}
g_object_set (task->serial,
- MM_SERIAL_PORT_SEND_DELAY, task->at_send_delay,
- MM_PORT_CARRIER_DETECT, FALSE,
- MM_SERIAL_PORT_SPEW_CONTROL, TRUE,
+ MM_SERIAL_PORT_SEND_DELAY, task->at_send_delay,
+ MM_AT_SERIAL_PORT_REMOVE_ECHO, task->at_remove_echo,
+ MM_PORT_CARRIER_DETECT, FALSE,
+ MM_SERIAL_PORT_SPEW_CONTROL, TRUE,
NULL);
mm_at_serial_port_set_response_parser (MM_AT_SERIAL_PORT (task->serial),
@@ -1025,6 +1028,7 @@ void
mm_port_probe_run (MMPortProbe *self,
MMPortProbeFlag flags,
guint64 at_send_delay,
+ gboolean at_remove_echo,
const MMPortProbeAtCommand *at_custom_probe,
const MMAsyncMethod *at_custom_init,
GAsyncReadyCallback callback,
@@ -1043,6 +1047,7 @@ mm_port_probe_run (MMPortProbe *self,
task = g_new0 (PortProbeRunTask, 1);
task->at_send_delay = at_send_delay;
+ task->at_remove_echo = at_remove_echo;
task->flags = MM_PORT_PROBE_NONE;
task->at_custom_probe = at_custom_probe;
task->at_custom_init = at_custom_init ? (MMPortProbeAtCustomInit)at_custom_init->async : NULL;
diff --git a/src/mm-port-probe.h b/src/mm-port-probe.h
index bbafab64..d626ff29 100644
--- a/src/mm-port-probe.h
+++ b/src/mm-port-probe.h
@@ -103,6 +103,7 @@ void mm_port_probe_set_result_qmi (MMPortProbe *self,
void mm_port_probe_run (MMPortProbe *self,
MMPortProbeFlag flags,
guint64 at_send_delay,
+ gboolean at_remove_echo,
const MMPortProbeAtCommand *at_custom_probe,
const MMAsyncMethod *at_custom_init,
GAsyncReadyCallback callback,