diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2018-05-27 11:23:54 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2018-05-27 11:23:56 +0200 |
commit | 6c37488d4ebbbb2afdefce193e6fb4070cde8ab3 (patch) | |
tree | 4a46ac21e17da167d21769a7d3570975fdb6d2a6 | |
parent | fd3a4d8d8beecc8b58cd6602cc8ee7207c1bf268 (diff) |
broadband-modem-mbim: minor function renames for SMS read logic
There are two ways to report new received SMS messages:
* For class 0 (flash) messages, MBIM_CID_SMS_READ are sent. The SMS
comes in the MBIM indication itself.
* For non-class 0 (standard) messages, a
MBIM_CID_SMS_MESSAGE_STORE_STATUS notifications are sent, the SMS is
stored and must be read with an additional MBIM request specifying
storage index.
The names of the functions we had implied the opposite, we were
assuming flash/alert messages were reported via
MBIM_CID_SMS_MESSAGE_STORE_STATUS, not via MBIM_CID_SMS_READ.
-rw-r--r-- | src/mm-broadband-modem-mbim.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mm-broadband-modem-mbim.c b/src/mm-broadband-modem-mbim.c index 09e1ffb7..d35274c9 100644 --- a/src/mm-broadband-modem-mbim.c +++ b/src/mm-broadband-modem-mbim.c @@ -2239,8 +2239,8 @@ static void add_sms_part (MMBroadbandModemMbim *self, const MbimSmsPduReadRecord *pdu); static void -sms_notification_read_sms (MMBroadbandModemMbim *self, - MbimMessage *notification) +sms_notification_read_flash_sms (MMBroadbandModemMbim *self, + MbimMessage *notification) { MbimSmsFormat format; guint32 messages_count; @@ -2335,8 +2335,8 @@ alert_sms_read_query_ready (MbimDevice *device, } static void -sms_notification_read_alert_sms (MMBroadbandModemMbim *self, - guint32 index) +sms_notification_read_stored_sms (MMBroadbandModemMbim *self, + guint32 index) { MMPortMbim *port; MbimDevice *device; @@ -2349,7 +2349,7 @@ sms_notification_read_alert_sms (MMBroadbandModemMbim *self, if (!device) return; - mm_dbg ("Reading flash SMS at index '%u'", index); + mm_dbg ("Reading new SMS at index '%u'", index); message = mbim_message_sms_read_query_new (MBIM_SMS_FORMAT_PDU, MBIM_SMS_FLAG_INDEX, index, @@ -2369,24 +2369,24 @@ sms_notification (MMBroadbandModemMbim *self, { switch (mbim_message_indicate_status_get_cid (notification)) { case MBIM_CID_SMS_READ: + /* New flash/alert message? */ if (self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_SMS_READ) - sms_notification_read_sms (self, notification); + sms_notification_read_flash_sms (self, notification); break; case MBIM_CID_SMS_MESSAGE_STORE_STATUS: { MbimSmsStatusFlag flag; guint32 index; - /* New flash/alert message? */ if (self->priv->setup_flags & PROCESS_NOTIFICATION_FLAG_SMS_READ && mbim_message_sms_message_store_status_notification_parse ( notification, &flag, &index, NULL)) { - mm_dbg ("Received flash message: '%s'", mbim_sms_status_flag_get_string (flag)); + mm_dbg ("Received SMS store status update: '%s'", mbim_sms_status_flag_get_string (flag)); if (flag == MBIM_SMS_STATUS_FLAG_NEW_MESSAGE) - sms_notification_read_alert_sms (self, index); + sms_notification_read_stored_sms (self, index); } break; } |