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.
This commit is contained in:
@@ -114,7 +114,7 @@ connect_report_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
/* If we got a proper extended reply, build the new error to be set */
|
||||
result = mm_base_modem_at_command_in_port_finish (modem, res, NULL);
|
||||
result = mm_base_modem_at_command_full_finish (modem, res, NULL);
|
||||
if (result &&
|
||||
g_str_has_prefix (result, "+CEER: ") &&
|
||||
strlen (result) > 7) {
|
||||
@@ -146,10 +146,10 @@ dial_ready (MMBaseModem *modem,
|
||||
/* DO NOT check for cancellable here. If we got here without errors, the
|
||||
* bearer is really connected and therefore we need to reflect that in
|
||||
* the state machine. */
|
||||
mm_base_modem_at_command_in_port_finish (modem, res, &(ctx->saved_error));
|
||||
mm_base_modem_at_command_full_finish (modem, res, &(ctx->saved_error));
|
||||
if (ctx->saved_error) {
|
||||
/* Try to get more information why it failed */
|
||||
mm_base_modem_at_command_in_port (
|
||||
mm_base_modem_at_command_full (
|
||||
modem,
|
||||
ctx->primary,
|
||||
"+CEER",
|
||||
@@ -199,7 +199,7 @@ service_type_ready (MMBaseModem *modem,
|
||||
}
|
||||
|
||||
/* Errors setting the service type will be critical */
|
||||
mm_base_modem_at_command_in_port_finish (modem, res, &error);
|
||||
mm_base_modem_at_command_full_finish (modem, res, &error);
|
||||
if (error) {
|
||||
g_simple_async_result_take_error (ctx->result, error);
|
||||
connect_context_complete_and_free (ctx);
|
||||
@@ -209,7 +209,7 @@ service_type_ready (MMBaseModem *modem,
|
||||
/* 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_in_port (
|
||||
mm_base_modem_at_command_full (
|
||||
modem,
|
||||
ctx->primary,
|
||||
"ATDT008816000025",
|
||||
@@ -249,7 +249,7 @@ connect (MMBearer *self,
|
||||
|
||||
/* Bearer service type set to 9600bps (V.110), which behaves better than the
|
||||
* default 9600bps (V.32). */
|
||||
mm_base_modem_at_command_in_port (
|
||||
mm_base_modem_at_command_full (
|
||||
modem,
|
||||
ctx->primary,
|
||||
"+CBST=71,0,1",
|
||||
|
||||
@@ -88,7 +88,6 @@ after_atz_sleep_cb (GSimpleAsyncResult *simple)
|
||||
modem_init_sequence,
|
||||
NULL, /* response_processor_context */
|
||||
NULL, /* response_processor_context_free */
|
||||
NULL, /* cancellable */
|
||||
(GAsyncReadyCallback)init_sequence_ready,
|
||||
simple);
|
||||
g_object_unref (self);
|
||||
@@ -132,7 +131,6 @@ modem_init (MMIfaceModem *self,
|
||||
"Z",
|
||||
3,
|
||||
TRUE,
|
||||
NULL, /* cancellable */
|
||||
(GAsyncReadyCallback)atz_ready,
|
||||
result);
|
||||
}
|
||||
@@ -201,7 +199,6 @@ messaging_enable_unsolicited_events (MMIfaceModemMessaging *self,
|
||||
"+CNMI=2,1,0,0,1",
|
||||
3,
|
||||
FALSE,
|
||||
NULL, /* cancellable */
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
@@ -251,7 +248,6 @@ load_signal_quality (MMIfaceModem *self,
|
||||
"+CSQF",
|
||||
3,
|
||||
FALSE,
|
||||
NULL, /* cancellable */
|
||||
callback,
|
||||
user_data);
|
||||
}
|
||||
@@ -308,7 +304,6 @@ setup_flow_control (MMIfaceModem *self,
|
||||
"&K3",
|
||||
3,
|
||||
FALSE,
|
||||
NULL, /* cancellable */
|
||||
(GAsyncReadyCallback)setup_flow_control_ready,
|
||||
result);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user