aboutsummaryrefslogtreecommitdiff
path: root/src/mm-base-sms.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksandermj@chromium.org>2024-04-04 11:22:31 +0000
committerAleksander Morgado <aleksander@aleksander.es>2024-04-23 07:25:12 +0000
commit480e12c34e574e6c282f76344eda05dbfaa66515 (patch)
tree399d026f414a6676fd50b2442bf346b3fac4c5a2 /src/mm-base-sms.c
parent67a0af35757a60607b925d52232348be2b11f2f1 (diff)
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.
Diffstat (limited to 'src/mm-base-sms.c')
-rw-r--r--src/mm-base-sms.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mm-base-sms.c b/src/mm-base-sms.c
index 9dea5a89..fb83ea98 100644
--- a/src/mm-base-sms.c
+++ b/src/mm-base-sms.c
@@ -840,7 +840,7 @@ sms_get_store_or_send_command (MMBaseSms *self,
typedef struct {
MMBaseModem *modem;
- MMPortSerialAt *port;
+ MMIfacePortAt *port;
MMSmsStorage storage;
gboolean need_unlock;
gboolean use_pdu_mode;
@@ -1024,13 +1024,13 @@ sms_store (MMBaseSms *self,
{
SmsStoreContext *ctx;
GTask *task;
- MMPortSerialAt *port;
+ MMIfacePortAt *port;
GError *error = NULL;
task = g_task_new (self, NULL, callback, user_data);
/* Select port for the operation */
- port = mm_base_modem_peek_best_at_port (self->priv->modem, &error);
+ port = MM_IFACE_PORT_AT (mm_base_modem_peek_best_at_port (self->priv->modem, &error));
if (!port) {
g_task_return_error (task, error);
g_object_unref (task);
@@ -1063,13 +1063,13 @@ sms_store (MMBaseSms *self,
/* Send the SMS */
typedef struct {
- MMBaseModem *modem;
- MMPortSerialAt *port;
- gboolean need_unlock;
- gboolean from_storage;
- gboolean use_pdu_mode;
- GList *current;
- gchar *msg_data;
+ MMBaseModem *modem;
+ MMIfacePortAt *port;
+ gboolean need_unlock;
+ gboolean from_storage;
+ gboolean use_pdu_mode;
+ GList *current;
+ gchar *msg_data;
} SmsSendContext;
static void
@@ -1327,13 +1327,13 @@ sms_send (MMBaseSms *self,
{
SmsSendContext *ctx;
GTask *task;
- MMPortSerialAt *port;
+ MMIfacePortAt *port;
GError *error = NULL;
task = g_task_new (self, NULL, callback, user_data);
/* Select port for the operation */
- port = mm_base_modem_peek_best_at_port (self->priv->modem, &error);
+ port = MM_IFACE_PORT_AT (mm_base_modem_peek_best_at_port (self->priv->modem, &error));
if (!port) {
g_task_return_error (task, error);
g_object_unref (task);