base-modem-at: switch to use the MMIfacePortAt by default

The whole codebase is updated to assume the MMBaseModem AT operations
require an object implementing the MMIfacePortAt interface, instead of
a MMPortSerialAt object.

In the places where we know the port is a MMPortSerialAt, e.g. when we
query explicitly for the primary or secondary serial AT port, we will
use an explicit MM_IFACE_PORT_AT() cast when calling the AT command
method.

In the places where we get_best_at_port() we're going to assume that
we don't know the port type. This method will be updated in a follow
up commit to support the MMIfacePortAt interface as well.
This commit is contained in:
Aleksander Morgado
2024-04-23 07:25:12 +00:00
committed by Aleksander Morgado
parent 67a0af3575
commit 480e12c34e
28 changed files with 144 additions and 145 deletions
+5 -5
View File
@@ -201,7 +201,7 @@ get_ip_config_3gpp (MMBroadbandBearer *self,
command = g_strdup_printf ("AT_OWANDATA=%d", cid);
mm_base_modem_at_command_full (
MM_BASE_MODEM (modem),
primary,
MM_IFACE_PORT_AT (primary),
command,
3,
FALSE,
@@ -283,7 +283,7 @@ connect_reset (GTask *task)
/* Need to reset the connection attempt */
command = g_strdup_printf ("AT_OWANCALL=%d,0,1", ctx->cid);
mm_base_modem_at_command_full (ctx->modem,
ctx->primary,
MM_IFACE_PORT_AT (ctx->primary),
command,
3,
FALSE,
@@ -477,7 +477,7 @@ authenticate_ready (MMBaseModem *modem,
/* Success, activate the PDP context and start the data session */
command = g_strdup_printf ("AT_OWANCALL=%d,1,1", ctx->cid);
mm_base_modem_at_command_full (ctx->modem,
ctx->primary,
MM_IFACE_PORT_AT (ctx->primary),
command,
3,
FALSE,
@@ -570,7 +570,7 @@ authenticate (GTask *task)
}
mm_base_modem_at_command_full (ctx->modem,
ctx->primary,
MM_IFACE_PORT_AT (ctx->primary),
command,
3,
FALSE,
@@ -693,7 +693,7 @@ disconnect_3gpp (MMBroadbandBearer *self,
/* Use specific CID */
command = g_strdup_printf ("AT_OWANCALL=%d,0,0", cid);
mm_base_modem_at_command_full (MM_BASE_MODEM (modem),
primary,
MM_IFACE_PORT_AT (primary),
command,
MM_BASE_BEARER_DEFAULT_DISCONNECTION_TIMEOUT,
FALSE,
+3 -3
View File
@@ -525,7 +525,7 @@ disable_location_gathering (MMIfaceModemLocation *self,
}
mm_base_modem_at_command_full (MM_BASE_MODEM (self),
gps_control,
MM_IFACE_PORT_AT (gps_control),
"_OGPS=0",
3,
FALSE,
@@ -639,7 +639,7 @@ parent_enable_location_gathering_ready (MMIfaceModemLocation *_self,
}
mm_base_modem_at_command_full (MM_BASE_MODEM (self),
gps_control,
MM_IFACE_PORT_AT (gps_control),
"_OGPS=2",
3,
FALSE,
@@ -723,7 +723,7 @@ setup_ports (MMBroadbandModem *self)
* maybe ModemManager got rebooted and it was left enabled before. We'll make
* sure that it is disabled when we initialize the modem */
mm_base_modem_at_command_full (MM_BASE_MODEM (self),
gps_control_port,
MM_IFACE_PORT_AT (gps_control_port),
"_OGPS=0",
3, FALSE, FALSE, NULL, NULL, NULL);
@@ -1000,7 +1000,7 @@ parent_enable_unsolicited_events_ready (MMIfaceModem3gpp *self,
/* Our own enable now */
mm_base_modem_at_sequence_full (
MM_BASE_MODEM (self),
primary,
MM_IFACE_PORT_AT (primary),
unsolicited_enable_sequence,
NULL, /* response_processor_context */
NULL, /* response_processor_context_free */
@@ -1097,7 +1097,7 @@ modem_3gpp_disable_unsolicited_events (MMIfaceModem3gpp *self,
/* Our own disable first */
mm_base_modem_at_sequence_full (
MM_BASE_MODEM (self),
primary,
MM_IFACE_PORT_AT (primary),
unsolicited_disable_sequence,
NULL, /* response_processor_context */
NULL, /* response_processor_context_free */