summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-07 13:08:43 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-07 14:24:27 +0100
commitc9b0f5a4008e0f636a0aef852488aa3a345eabb0 (patch)
tree18a27a9c259791212b498b3c30d9a9447c0767bf
parent0f497d20854707fce383509a13a89cdcddbc7781 (diff)
downloadModemManager-c9b0f5a4008e0f636a0aef852488aa3a345eabb0.tar.gz
at-serial-port: allow cancelling the response timeout
-rw-r--r--src/mm-at-serial-port.c6
-rw-r--r--src/mm-at-serial-port.h2
-rw-r--r--src/mm-base-modem-at.c5
-rw-r--r--src/mm-port-probe.c1
4 files changed, 12 insertions, 2 deletions
diff --git a/src/mm-at-serial-port.c b/src/mm-at-serial-port.c
index 2ceb59c1d..893ebc0e7 100644
--- a/src/mm-at-serial-port.c
+++ b/src/mm-at-serial-port.c
@@ -270,6 +270,7 @@ void
mm_at_serial_port_queue_command (MMAtSerialPort *self,
const char *command,
guint32 timeout_seconds,
+ GCancellable *cancellable,
MMAtSerialResponseFn callback,
gpointer user_data)
{
@@ -286,7 +287,7 @@ mm_at_serial_port_queue_command (MMAtSerialPort *self,
buf,
TRUE,
timeout_seconds,
- NULL,
+ cancellable,
(MMSerialResponseFn) callback,
user_data);
}
@@ -295,6 +296,7 @@ void
mm_at_serial_port_queue_command_cached (MMAtSerialPort *self,
const char *command,
guint32 timeout_seconds,
+ GCancellable *cancellable,
MMAtSerialResponseFn callback,
gpointer user_data)
{
@@ -311,7 +313,7 @@ mm_at_serial_port_queue_command_cached (MMAtSerialPort *self,
buf,
TRUE,
timeout_seconds,
- NULL,
+ cancellable,
(MMSerialResponseFn) callback,
user_data);
}
diff --git a/src/mm-at-serial-port.h b/src/mm-at-serial-port.h
index a4cb12eae..204a132de 100644
--- a/src/mm-at-serial-port.h
+++ b/src/mm-at-serial-port.h
@@ -89,12 +89,14 @@ void mm_at_serial_port_set_response_parser (MMAtSerialPort *self,
void mm_at_serial_port_queue_command (MMAtSerialPort *self,
const char *command,
guint32 timeout_seconds,
+ GCancellable *cancellable,
MMAtSerialResponseFn callback,
gpointer user_data);
void mm_at_serial_port_queue_command_cached (MMAtSerialPort *self,
const char *command,
guint32 timeout_seconds,
+ GCancellable *cancellable,
MMAtSerialResponseFn callback,
gpointer user_data);
diff --git a/src/mm-base-modem-at.c b/src/mm-base-modem-at.c
index cd0565c33..820063b8c 100644
--- a/src/mm-base-modem-at.c
+++ b/src/mm-base-modem-at.c
@@ -172,6 +172,7 @@ at_sequence_parse_response (MMAtSerialPort *port,
ctx->port,
ctx->current->command,
ctx->current->timeout,
+ ctx->cancellable,
(MMAtSerialResponseFn)at_sequence_parse_response,
ctx);
else
@@ -179,6 +180,7 @@ at_sequence_parse_response (MMAtSerialPort *port,
ctx->port,
ctx->current->command,
ctx->current->timeout,
+ ctx->cancellable,
(MMAtSerialResponseFn)at_sequence_parse_response,
ctx);
return;
@@ -244,6 +246,7 @@ mm_base_modem_at_sequence_in_port (MMBaseModem *self,
ctx->port,
ctx->current->command,
ctx->current->timeout,
+ ctx->cancellable,
(MMAtSerialResponseFn)at_sequence_parse_response,
ctx);
}
@@ -450,6 +453,7 @@ mm_base_modem_at_command_in_port (MMBaseModem *self,
port,
command,
timeout,
+ ctx->cancellable,
(MMAtSerialResponseFn)at_command_parse_response,
ctx);
else
@@ -457,6 +461,7 @@ mm_base_modem_at_command_in_port (MMBaseModem *self,
port,
command,
timeout,
+ ctx->cancellable,
(MMAtSerialResponseFn)at_command_parse_response,
ctx);
}
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index 0e8f856b4..5474170c2 100644
--- a/src/mm-port-probe.c
+++ b/src/mm-port-probe.c
@@ -446,6 +446,7 @@ serial_probe_at (MMPortProbe *self)
MM_AT_SERIAL_PORT (task->serial),
task->at_commands->command,
3,
+ task->cancellable,
(MMAtSerialResponseFn)serial_probe_at_parse_response,
self);
return FALSE;