diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-31 09:20:43 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-08-31 09:20:43 +0200 |
commit | 1e5b00e33b98dbfd3fc6208ff51c30f4b0b40d88 (patch) | |
tree | 896c2c1e4855bc8b1ffe746df2b2ec8f3b8d0d31 /src/mm-port-probe.c | |
parent | 9faba582263f541048816d8e161166a525952a52 (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-port-probe.c')
-rw-r--r-- | src/mm-port-probe.c | 11 |
1 files changed, 8 insertions, 3 deletions
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; |