aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-modem-at.h
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-03-08 23:19:19 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-16 14:53:23 +0100
commitcdd339f8024af8088d94f0ffde78beef5a0c998d (patch)
tree74d01d0a5e6365a34880eb83e2b423ebfc1419d3 /src/mm-base-modem-at.h
parent215c27808230352e3def81b45808ef29a9cd5b7a (diff)
base-modem: implement new modem-wide cancellable, and rework AT commands
Instead of the `_in_port()' variants, we'll provide more generic `_full()' methods. These should be used either if we want to send commands to a specific port, or if we want to use a specific user-provided GCancellable. In addition to this user-provided GCancellable, we keep the internal modem-wide one.
Diffstat (limited to 'src/mm-base-modem-at.h')
-rw-r--r--src/mm-base-modem-at.h91
1 files changed, 43 insertions, 48 deletions
diff --git a/src/mm-base-modem-at.h b/src/mm-base-modem-at.h
index b4b2f651..fb98669d 100644
--- a/src/mm-base-modem-at.h
+++ b/src/mm-base-modem-at.h
@@ -63,31 +63,33 @@ typedef struct {
MMBaseModemAtResponseProcessor response_processor;
} MMBaseModemAtCommand;
-/* AT sequence handling */
-void mm_base_modem_at_sequence (MMBaseModem *self,
- const MMBaseModemAtCommand *sequence,
- gpointer response_processor_context,
- GDestroyNotify response_processor_context_free,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-GVariant *mm_base_modem_at_sequence_finish (MMBaseModem *self,
- GAsyncResult *res,
- gpointer *response_processor_context,
- GError **error);
-
-void mm_base_modem_at_sequence_in_port (MMBaseModem *self,
- MMAtSerialPort *port,
+/* Generic AT sequence handling, using the best AT port available and without
+ * explicit cancellations. */
+void mm_base_modem_at_sequence (MMBaseModem *self,
const MMBaseModemAtCommand *sequence,
gpointer response_processor_context,
GDestroyNotify response_processor_context_free,
- GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
-GVariant *mm_base_modem_at_sequence_in_port_finish (MMBaseModem *self,
- GAsyncResult *res,
- gpointer *response_processor_context,
- GError **error);
+GVariant *mm_base_modem_at_sequence_finish (MMBaseModem *self,
+ GAsyncResult *res,
+ gpointer *response_processor_context,
+ GError **error);
+
+/* Fully detailed AT sequence handling, when specific AT port and/or explicit
+ * cancellations need to be used. */
+void mm_base_modem_at_sequence_full (MMBaseModem *self,
+ MMAtSerialPort *port,
+ const MMBaseModemAtCommand *sequence,
+ gpointer response_processor_context,
+ GDestroyNotify response_processor_context_free,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GVariant *mm_base_modem_at_sequence_full_finish (MMBaseModem *self,
+ GAsyncResult *res,
+ gpointer *response_processor_context,
+ GError **error);
/* Common helper response processors */
@@ -119,37 +121,30 @@ gboolean mm_base_modem_response_processor_no_result_continue (MMBaseModem *self,
GVariant **result,
GError **result_error);
-/* Single AT command, returning the whole response string */
-void mm_base_modem_at_command (MMBaseModem *self,
- const gchar *command,
- guint timeout,
- gboolean allow_cached,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
+/* Generic AT command handling, using the best AT port available and without
+ * explicit cancellations. */
+void mm_base_modem_at_command (MMBaseModem *self,
+ const gchar *command,
+ guint timeout,
+ gboolean allow_cached,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
const gchar *mm_base_modem_at_command_finish (MMBaseModem *self,
GAsyncResult *res,
GError **error);
-void mm_base_modem_at_command_in_port (MMBaseModem *self,
- MMAtSerialPort *port,
- const gchar *command,
- guint timeout,
- gboolean allow_cached,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-const gchar *mm_base_modem_at_command_in_port_finish (MMBaseModem *self,
- GAsyncResult *res,
- GError **error);
-
-/* Fire and forget an AT command */
-void mm_base_modem_at_command_ignore_reply (MMBaseModem *self,
- const gchar *command,
- guint timeout);
-void mm_base_modem_at_command_in_port_ignore_reply (MMBaseModem *self,
- MMAtSerialPort *port,
- const gchar *command,
- guint timeout);
+/* Fully detailed AT command handling, when specific AT port and/or explicit
+ * cancellations need to be used. */
+void mm_base_modem_at_command_full (MMBaseModem *self,
+ MMAtSerialPort *port,
+ const gchar *command,
+ guint timeout,
+ gboolean allow_cached,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+const gchar *mm_base_modem_at_command_full_finish (MMBaseModem *self,
+ GAsyncResult *res,
+ GError **error);
#endif /* MM_BASE_MODEM_AT_H */