sms-part-3gpp: add flag for indicating PDU is transfer-route message

When the message is a transfer-route MT, there is no SMSC address to
parse out. This flag allows indicating when the PDU is one such message.
This commit is contained in:
Clayton Craft
2021-04-16 20:42:15 -07:00
parent 205e9edf3e
commit 43c39d5226
4 changed files with 30 additions and 19 deletions

View File

@@ -5470,6 +5470,7 @@ add_sms_part (MMBroadbandModemMbim *self,
pdu->pdu_data, pdu->pdu_data,
pdu->pdu_data_size, pdu->pdu_data_size,
self, self,
FALSE,
&error); &error);
if (part) { if (part) {
mm_obj_dbg (self, "correctly parsed PDU (%d)", pdu->message_index); mm_obj_dbg (self, "correctly parsed PDU (%d)", pdu->message_index);

View File

@@ -5796,6 +5796,7 @@ add_new_read_sms_part (MMIfaceModemMessaging *self,
guint32 index, guint32 index,
QmiWmsMessageTagType tag, QmiWmsMessageTagType tag,
QmiWmsMessageFormat format, QmiWmsMessageFormat format,
gboolean transfer_route,
GArray *data) GArray *data)
{ {
MMSmsPart *part = NULL; MMSmsPart *part = NULL;
@@ -5816,6 +5817,7 @@ add_new_read_sms_part (MMIfaceModemMessaging *self,
(guint8 *)data->data, (guint8 *)data->data,
data->len, data->len,
self, self,
transfer_route,
&error); &error);
break; break;
case QMI_WMS_MESSAGE_FORMAT_MWI: case QMI_WMS_MESSAGE_FORMAT_MWI:
@@ -5882,6 +5884,7 @@ wms_raw_read_ready (QmiClientWms *client,
message->memory_index, message->memory_index,
tag, tag,
format, format,
FALSE,
data); data);
} }
@@ -6232,6 +6235,7 @@ wms_indication_raw_read_ready (QmiClientWms *client,
ctx->memory_index, ctx->memory_index,
tag, tag,
format, format,
FALSE,
data); data);
} }
@@ -6319,6 +6323,7 @@ messaging_event_report_indication_cb (QmiClientNas *client,
memory_index, memory_index,
tag, tag,
msg_format, msg_format,
TRUE,
raw_data); raw_data);
return; return;
} }

View File

@@ -355,7 +355,7 @@ mm_sms_part_3gpp_new_from_pdu (guint index,
return NULL; return NULL;
} }
return mm_sms_part_3gpp_new_from_binary_pdu (index, pdu, pdu_len, log_object, error); return mm_sms_part_3gpp_new_from_binary_pdu (index, pdu, pdu_len, log_object, FALSE, error);
} }
MMSmsPart * MMSmsPart *
@@ -363,6 +363,7 @@ mm_sms_part_3gpp_new_from_binary_pdu (guint index,
const guint8 *pdu, const guint8 *pdu,
gsize pdu_len, gsize pdu_len,
gpointer log_object, gpointer log_object,
gboolean transfer_route,
GError **error) GError **error)
{ {
MMSmsPart *sms_part; MMSmsPart *sms_part;
@@ -404,6 +405,7 @@ mm_sms_part_3gpp_new_from_binary_pdu (guint index,
offset = 0; offset = 0;
if (!transfer_route) {
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
/* SMSC, in address format, precedes the TPDU /* SMSC, in address format, precedes the TPDU
* First byte represents the number of BYTES for the address value */ * First byte represents the number of BYTES for the address value */
@@ -423,6 +425,8 @@ mm_sms_part_3gpp_new_from_binary_pdu (guint index,
offset += smsc_addr_size_bytes; offset += smsc_addr_size_bytes;
} else } else
mm_obj_dbg (log_object, " no SMSC address given"); mm_obj_dbg (log_object, " no SMSC address given");
} else
mm_obj_dbg (log_object, " This is a transfer-route message");
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */

View File

@@ -30,6 +30,7 @@ MMSmsPart *mm_sms_part_3gpp_new_from_binary_pdu (guint index,
const guint8 *pdu, const guint8 *pdu,
gsize pdu_len, gsize pdu_len,
gpointer log_object, gpointer log_object,
gboolean transfer_route,
GError **error); GError **error);
guint8 *mm_sms_part_3gpp_get_submit_pdu (MMSmsPart *part, guint8 *mm_sms_part_3gpp_get_submit_pdu (MMSmsPart *part,
guint *out_pdulen, guint *out_pdulen,