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

View File

@@ -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);
}

View File

@@ -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;