aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mm-port-serial-at.c1
-rw-r--r--src/mm-port-serial-qcdm.c1
-rw-r--r--src/mm-port-serial.c8
-rw-r--r--src/mm-port-serial.h1
4 files changed, 10 insertions, 1 deletions
diff --git a/src/mm-port-serial-at.c b/src/mm-port-serial-at.c
index fef910e5..e51f73a5 100644
--- a/src/mm-port-serial-at.c
+++ b/src/mm-port-serial-at.c
@@ -427,6 +427,7 @@ mm_port_serial_at_command (MMPortSerialAt *self,
buf,
timeout_seconds,
allow_cached,
+ FALSE, /* always queued last */
cancellable,
(GAsyncReadyCallback)serial_command_ready,
simple);
diff --git a/src/mm-port-serial-qcdm.c b/src/mm-port-serial-qcdm.c
index 4d26e398..ec1833f5 100644
--- a/src/mm-port-serial-qcdm.c
+++ b/src/mm-port-serial-qcdm.c
@@ -193,6 +193,7 @@ mm_port_serial_qcdm_command (MMPortSerialQcdm *self,
command,
timeout_seconds,
FALSE, /* never cached */
+ FALSE, /* always queued last */
cancellable,
(GAsyncReadyCallback)serial_command_ready,
task);
diff --git a/src/mm-port-serial.c b/src/mm-port-serial.c
index d739313b..4067979c 100644
--- a/src/mm-port-serial.c
+++ b/src/mm-port-serial.c
@@ -163,6 +163,7 @@ mm_port_serial_command (MMPortSerial *self,
GByteArray *command,
guint32 timeout_seconds,
gboolean allow_cached,
+ gboolean run_next,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
@@ -203,7 +204,12 @@ mm_port_serial_command (MMPortSerial *self,
if (!allow_cached)
port_serial_set_cached_reply (self, ctx->command, NULL);
- g_queue_push_tail (self->priv->queue, ctx);
+ /* If requested to run next, push to the head of the queue so that it really is
+ * the next one sent */
+ if (run_next)
+ g_queue_push_head (self->priv->queue, ctx);
+ else
+ g_queue_push_tail (self->priv->queue, ctx);
if (g_queue_get_length (self->priv->queue) == 1)
port_serial_schedule_queue_process (self, 0);
diff --git a/src/mm-port-serial.h b/src/mm-port-serial.h
index bac79b44..b30bad77 100644
--- a/src/mm-port-serial.h
+++ b/src/mm-port-serial.h
@@ -144,6 +144,7 @@ void mm_port_serial_command (MMPortSerial *self,
GByteArray *command,
guint32 timeout_seconds,
gboolean allow_cached,
+ gboolean run_next,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);