Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
Despite 3GPP TS 23.038 specifies that Unicode SMS messages are
encoded in UCS-2, UTF-16 encoding is commonly used instead on many
modern platforms to allow encoding code points that fall outside the
Basic Multilingual Plane (BMP), such as Emoji.
Update the logic to always use UTF-16 instead of UCS-2 when creating
or parsing PDUs (even if we always report as sending or receiving
UCS-2). For all purposes, UCS-2 is considered a subset of UTF-16
(assuming that code points out of the [U+0000,U+D7FF] and
[U+E000,U+FFFF] ranges are not applicable in UCS-2).
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/250
|
|
|
|
|
|
|
|
|
|
We need to redefine the message class property to int since class
0 is a valid message class. Thus -1 now means "unspecified class".
|
|
We don't want to support only 'relative' validity, so don't assume that the
Validity property will always be a uint32 value.
Instead, we define the Validity propery as '(uv)' tuple, where the first value
(a MMSmsValidityType) specifies the type of validity, and the second value is
a variant formatted accordingly to what the validity type specifies (e.g. a
uint32 value if the type is MM_SMS_VALIDITY_TYPE_RELATIVE).
|
|
When a user creates an SMS object, we will expose all its properties in DBus
properly, but we will not create the internal list of SMS parts.
The list of SMS parts will be created when the SMS is stored or sent, whatever
comes first. When the message is sent and it was previously stored, the list of
parts is not re-created.
If the message requires multiple parts, the multipart reference is computed as
follows:
* If the SMS was not stored and is being sent, we just use a random number.
* If the SMS is being stored, we will use a multipart reference which is not
being used already in another SMS to the same destination.
|
|
When receiving an SMS, if the encoding is either GSM7 or UCS2, we will treat the
contents of the SMS as text; and if the encoding is either 8BIT or unknown, we
will just dump the contents of the SMS as data.
When creating an SMS, the user is not allowed to give both text and data, only
one can be given. We will use by default 8BIT when data is given, and guess the
best encoding if text is given.
Note that it's still possible to have SMS with neither text nor data, as in
delivery status reports.
This commit also handles the split of the input data in order to make it fit
into singlepart or multipart messages.
|
|
We already retrieve the bits we use from it, class and encoding.
|
|
Given only for STATUS REPORT SMS messages.
|
|
Message reference allows to match a sent SMS with its corresponding delivery
report, if requested.
|
|
|
|
It will help deciding the type of message.
|
|
Also allowing the 'delivery-report-request' key in the `Messaging.CreateSms()'
method.
|
|
|
|
|
|
|
|
It currently doesn't do multi-part. When do support that, we may end up needing
to move all this code to mm-sms.c
|
|
so that we can for example, tell the index is INVALID
|
|
SMS parts with invalid indexes are NOT stored yet in the device
|
|
|
|
|
|
|
|
|