aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-16 19:28:53 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:15:07 +0100
commit7e31470066e1b8e113e73a4732daf4692667d87e (patch)
tree57b9fa5552b32f19d9b075d082152947cd14e0a3
parent4492adae2e3013ec534fcb5389f216166ececad9 (diff)
iridium: set bearer service type to 9600bps V.110
-rw-r--r--plugins/mm-bearer-iridium.c49
1 files changed, 43 insertions, 6 deletions
diff --git a/plugins/mm-bearer-iridium.c b/plugins/mm-bearer-iridium.c
index 9d727696..9af1b701 100644
--- a/plugins/mm-bearer-iridium.c
+++ b/plugins/mm-bearer-iridium.c
@@ -178,6 +178,44 @@ dial_ready (MMBaseModem *modem,
}
static void
+service_type_ready (MMBaseModem *modem,
+ GAsyncResult *res,
+ ConnectContext *ctx)
+{
+ GError *error = NULL;
+
+ /* If cancelled, complete */
+ if (g_cancellable_is_cancelled (ctx->cancellable)) {
+ g_simple_async_result_set_error (ctx->result,
+ MM_CORE_ERROR,
+ MM_CORE_ERROR_CANCELLED,
+ "Connection setup operation has been cancelled");
+ connect_context_complete_and_free (ctx);
+ return;
+ }
+
+ /* Errors setting the service type will be critical */
+ mm_base_modem_at_command_finish (modem, res, &error);
+ if (error) {
+ g_simple_async_result_take_error (ctx->result, error);
+ connect_context_complete_and_free (ctx);
+ return;
+ }
+
+ /* We just use the default number to dial in the Iridium network. Also note
+ * that we won't specify a specific port to use; Iridium modems only expose
+ * one. */
+ mm_base_modem_at_command (
+ modem,
+ "ATDT008816000025",
+ 60,
+ FALSE,
+ NULL, /* cancellable */
+ (GAsyncReadyCallback)dial_ready,
+ ctx);
+}
+
+static void
connect (MMBearer *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
@@ -203,16 +241,15 @@ connect (MMBearer *self,
user_data,
connect);
- /* We just use the default number to dial in the Iridium network. Also note
- * that we won't specify a specific port to use; Iridium modems only expose
- * one. */
+ /* Bearer service type set to 9600bps (V.110), which behaves better than the
+ * default 9600bps (V.32). */
mm_base_modem_at_command (
modem,
- "ATDT008816000025",
- 60,
+ "+CBST=71,0,1",
+ 3,
FALSE,
NULL, /* cancellable */
- (GAsyncReadyCallback)dial_ready,
+ (GAsyncReadyCallback)service_type_ready,
ctx);
g_object_unref (modem);