at-serial-port: allow cancelling the response timeout

This commit is contained in:
Aleksander Morgado
2012-03-07 13:08:43 +01:00
parent 5a485d74a2
commit ef2b1cf030
4 changed files with 12 additions and 2 deletions

View File

@@ -281,6 +281,7 @@ void
mm_at_serial_port_queue_command (MMAtSerialPort *self, mm_at_serial_port_queue_command (MMAtSerialPort *self,
const char *command, const char *command,
guint32 timeout_seconds, guint32 timeout_seconds,
GCancellable *cancellable,
MMAtSerialResponseFn callback, MMAtSerialResponseFn callback,
gpointer user_data) gpointer user_data)
{ {
@@ -297,7 +298,7 @@ mm_at_serial_port_queue_command (MMAtSerialPort *self,
buf, buf,
TRUE, TRUE,
timeout_seconds, timeout_seconds,
NULL, cancellable,
(MMSerialResponseFn) callback, (MMSerialResponseFn) callback,
user_data); user_data);
} }
@@ -306,6 +307,7 @@ void
mm_at_serial_port_queue_command_cached (MMAtSerialPort *self, mm_at_serial_port_queue_command_cached (MMAtSerialPort *self,
const char *command, const char *command,
guint32 timeout_seconds, guint32 timeout_seconds,
GCancellable *cancellable,
MMAtSerialResponseFn callback, MMAtSerialResponseFn callback,
gpointer user_data) gpointer user_data)
{ {
@@ -322,7 +324,7 @@ mm_at_serial_port_queue_command_cached (MMAtSerialPort *self,
buf, buf,
TRUE, TRUE,
timeout_seconds, timeout_seconds,
NULL, cancellable,
(MMSerialResponseFn) callback, (MMSerialResponseFn) callback,
user_data); user_data);
} }

View File

@@ -91,12 +91,14 @@ void mm_at_serial_port_set_response_parser (MMAtSerialPort *self,
void mm_at_serial_port_queue_command (MMAtSerialPort *self, void mm_at_serial_port_queue_command (MMAtSerialPort *self,
const char *command, const char *command,
guint32 timeout_seconds, guint32 timeout_seconds,
GCancellable *cancellable,
MMAtSerialResponseFn callback, MMAtSerialResponseFn callback,
gpointer user_data); gpointer user_data);
void mm_at_serial_port_queue_command_cached (MMAtSerialPort *self, void mm_at_serial_port_queue_command_cached (MMAtSerialPort *self,
const char *command, const char *command,
guint32 timeout_seconds, guint32 timeout_seconds,
GCancellable *cancellable,
MMAtSerialResponseFn callback, MMAtSerialResponseFn callback,
gpointer user_data); gpointer user_data);

View File

@@ -172,6 +172,7 @@ at_sequence_parse_response (MMAtSerialPort *port,
ctx->port, ctx->port,
ctx->current->command, ctx->current->command,
ctx->current->timeout, ctx->current->timeout,
ctx->cancellable,
(MMAtSerialResponseFn)at_sequence_parse_response, (MMAtSerialResponseFn)at_sequence_parse_response,
ctx); ctx);
else else
@@ -179,6 +180,7 @@ at_sequence_parse_response (MMAtSerialPort *port,
ctx->port, ctx->port,
ctx->current->command, ctx->current->command,
ctx->current->timeout, ctx->current->timeout,
ctx->cancellable,
(MMAtSerialResponseFn)at_sequence_parse_response, (MMAtSerialResponseFn)at_sequence_parse_response,
ctx); ctx);
return; return;
@@ -244,6 +246,7 @@ mm_base_modem_at_sequence_in_port (MMBaseModem *self,
ctx->port, ctx->port,
ctx->current->command, ctx->current->command,
ctx->current->timeout, ctx->current->timeout,
ctx->cancellable,
(MMAtSerialResponseFn)at_sequence_parse_response, (MMAtSerialResponseFn)at_sequence_parse_response,
ctx); ctx);
} }
@@ -450,6 +453,7 @@ mm_base_modem_at_command_in_port (MMBaseModem *self,
port, port,
command, command,
timeout, timeout,
ctx->cancellable,
(MMAtSerialResponseFn)at_command_parse_response, (MMAtSerialResponseFn)at_command_parse_response,
ctx); ctx);
else else
@@ -457,6 +461,7 @@ mm_base_modem_at_command_in_port (MMBaseModem *self,
port, port,
command, command,
timeout, timeout,
ctx->cancellable,
(MMAtSerialResponseFn)at_command_parse_response, (MMAtSerialResponseFn)at_command_parse_response,
ctx); ctx);
} }

View File

@@ -446,6 +446,7 @@ serial_probe_at (MMPortProbe *self)
MM_AT_SERIAL_PORT (task->serial), MM_AT_SERIAL_PORT (task->serial),
task->at_commands->command, task->at_commands->command,
3, 3,
task->cancellable,
(MMAtSerialResponseFn)serial_probe_at_parse_response, (MMAtSerialResponseFn)serial_probe_at_parse_response,
self); self);
return FALSE; return FALSE;