Commit Graph

5733 Commits

Author SHA1 Message Date
Aleksander Morgado
ef5842f4da sms-part: implement parsing SUBMIT and STATUS REPORT PDUs 2012-09-14 07:05:24 +02:00
Aleksander Morgado
7faa48ea94 api: new `PduType' property in the SMS interface
It will help deciding the type of message.
2012-09-14 07:05:24 +02:00
Aleksander Morgado
5b6e080472 test: set text encoding when testing PDU creator 2012-09-14 07:05:24 +02:00
Aleksander Morgado
6c5bead94b test: print all logs in SMS part tests
They are extremely helpful for debugging issues.
2012-09-14 07:05:24 +02:00
Aleksander Morgado
f7caa7c9bc test: new tests to parse SUBMIT PDUs 2012-09-14 07:05:24 +02:00
Aleksander Morgado
f139bbe485 test: new tests to parse non-stored PDUs 2012-09-14 07:05:24 +02:00
Aleksander Morgado
af4f23a1d2 test: new tester for +CDS unsolicited messages 2012-09-14 07:05:24 +02:00
Aleksander Morgado
8acaf7baa7 broadband-modem: process not-stored SMS part indications 2012-09-14 07:05:24 +02:00
Aleksander Morgado
7be32700fb broadband-modem: minor improvement when reading from match info 2012-09-14 07:05:24 +02:00
Aleksander Morgado
7c9beae013 cli: print delivery report request information in SMS status 2012-09-14 07:05:24 +02:00
Aleksander Morgado
bda572faa7 libmm-glib,sms: new `mm_sms_get_delivery_report_request()' 2012-09-14 07:05:24 +02:00
Aleksander Morgado
2508d01bdf libmm-glib,sms: fix values returned on error 2012-09-14 07:05:24 +02:00
Aleksander Morgado
1c119be834 api: new `Sms.DeliveryReportRequest' property
Also allowing the 'delivery-report-request' key in the `Messaging.CreateSms()'
method.
2012-09-14 07:05:24 +02:00
Aleksander Morgado
b42b5795e3 iface-modem-messaging: automatically detect the best default storage
Instead of letting the plugins specify a default storage to use, just look at
the supported ones and use the best one.

"MT is preferred over "ME" or "SM", as "MT=ME+SM"
2012-09-14 07:05:23 +02:00
Aleksander Morgado
54178a7959 cli: include default SMS storage info in `--messaging-status'
$> sudo mmcli -m 1 --messaging-status

/org/freedesktop/ModemManager1/Modem/1
  ----------------------------
  Messaging | supported storages: 'sm, mt, me, sr'
            |    default storage: 'me'
2012-09-14 07:05:23 +02:00
Aleksander Morgado
fdb9db8d28 libmm-glib: new `mm_modem_messaging_get_default_storage()' method 2012-09-14 07:05:23 +02:00
Aleksander Morgado
4f7534452d option,hso: properly parse returned IMEI 2012-09-14 07:05:23 +02:00
Aleksander Morgado
43650043ea sms: select proper storage when sending SMS from storage
We need to select the correct 'mem2' storage before trying to send from storage.
2012-09-14 07:05:23 +02:00
Aleksander Morgado
bddcc2fb07 iface-modem-messaging: instead of mem1,mem2,mem3 use just a new default storage
There is no point in specifying a default 'mem1' memory storage, which is used
for reading/listing/deleting, as those are operations that need a specific
'mem1' set each time.

Also, there is no point in specifying separate default 'mem2' and 'mem3' memory
storages, specially because now we allow Sms.Store() to specify a storage.

So, we will now only have a 'default' memory storage, which is applicable for
both 'mem2' and 'mem3' (storing, sending from storage and deleting).
2012-09-14 07:05:23 +02:00
Aleksander Morgado
584fc77bb3 cli: include the `--messaging' prefix in all Messaging-related actions
Just for consistency with other interfaces, which also provide interface
specific prefixes in their mmcli actions.
2012-09-14 07:05:23 +02:00
Aleksander Morgado
47b459603a cli: new `--messaging-status' action
Currently shows the list of supported SMS storages.
2012-09-14 07:05:23 +02:00
Aleksander Morgado
c7e81d7470 libmm-glib: new `mm_modem_messaging_get_supported_storages()' method 2012-09-14 07:05:23 +02:00
Aleksander Morgado
67081f02c8 api: new `SupportedStorages' property in the Messaging interface
We will list which are the storages allowed to use when receiving/storing SMS
messages.
2012-09-14 07:05:23 +02:00
Aleksander Morgado
b7e1c6d36d libmm-common: new helpers to work with arrays of `MMSmsStorage' values 2012-09-14 07:05:23 +02:00
Aleksander Morgado
d75bfa2db9 broadband-modem: allow locking/unlocking either 'mem1' or 'mem2' or both
So that e.g. listing all SMS in a given storage ('mem1' lock) doesn't collide
with storing a new SMS ('mem2' lock).
2012-09-14 07:05:23 +02:00
Aleksander Morgado
e6f827ed33 sms: select proper storage when deleting SMS 2012-09-14 07:05:23 +02:00
Aleksander Morgado
f0e873b26e cli: new `--store-in-storage' action to be able to select where to store the SMS
Expects the storage as the enum nickname string, e.g:
   "me" for MM_SMS_STORAGE_ME
or
   "sm" for MM_SMS_STORAGE_SM
2012-09-14 07:05:23 +02:00
Aleksander Morgado
667026f0c8 api: Sms.Store() now requires the specific memory storage where to store the SMS
... or MM_SMS_STORAGE_UNKNOWN to store it in the default storage.
2012-09-14 07:05:23 +02:00
Aleksander Morgado
96928909b9 iface-modem-messaging: setting preferred storages is a one-time operation
Selection specific storages to run actions on them can now be done with the
broadband-modem-specific lock|unlock_sms_storages() methods.
2012-09-14 07:05:22 +02:00
Aleksander Morgado
2481d97d52 iface-modem-messaging: load initial SMS parts after having set default storages
We really want the 'mem3' storage set as soon as possible.
2012-09-14 07:05:22 +02:00
Aleksander Morgado
a5650ca091 broadband-modem: lock/unlock the 'mem1' storage when reading initial SMS lists 2012-09-14 07:05:22 +02:00
Aleksander Morgado
4f9817741f broadband-modem: new methods to lock/unlock current SMS storages
The default AT commands to play with SMS rely on AT+CPMS to select the default
memory storages for different operations. AT+CPMS defines 3 different storages,
called 'mem1' (for reading/listing/deleting), 'mem2' (for storing or sending
from storage) and 'mem3' (for receiving).

For example, when an SMS is to be deleted, we first need to select with AT+CPMS
the proper 'mem1' storage before issuing the command to delete the SMS part.
But, in order to do this properly we need to synchronize the access to the
currently set storages, so that no more than one action is run in the storages
at the same time (e.g. don't store an SMS while another SMS is being deleted).
In order to synchronize this access, we now provide commands to lock()/unlock()
the storages, which should be used when we want to do some operation on them.

Note that this logic is only required because we cannot specify the storage
explicitly in the specific AT command operations. With QMI we don't need this
locking/unlocking.
2012-09-14 07:05:22 +02:00
Aleksander Morgado
83dc9e3e1d iface-modem-messaging: new methods to check support for storage actions
We can now check whether a specific storage is valid for receiving or storing.
2012-09-14 07:05:22 +02:00
Aleksander Morgado
bfa742ae13 broadband-modem-qmi: we don't support 3GPP2 messaging yet 2012-09-14 07:05:22 +02:00
Aleksander Morgado
e6a4c72ebc sms-qmi: handle sending/storing multipart SMS messages 2012-09-14 07:05:22 +02:00
Aleksander Morgado
3c814d74ca sms-part: create proper SUBMIT PDUs for multipart SMS messages
If the SMS part is from a multipart message we'll need to create a PDU with a
proper User Data Header.

This patch is based on a previous implementation by:
  Roberto Majadas <roberto.majadas@openshine.com>
2012-09-14 07:05:22 +02:00
Aleksander Morgado
3332ec0c68 sms: try to store/send all parts of a SMS message 2012-09-14 07:05:22 +02:00
Aleksander Morgado
b2b7fccdf5 sms: allow users to create multipart SMS messages 2012-09-14 07:05:22 +02:00
Aleksander Morgado
0edb58b738 sms: always export incomplete multipart SMS messages 2012-09-14 07:05:22 +02:00
Aleksander Morgado
e7b094ea3c sms-part: new util to split input text string into chunks to fit in PDUs 2012-09-14 07:05:22 +02:00
Aleksander Morgado
6b575cece0 sms-part: allow storing and accessing the user encoding info of an SMS part 2012-09-14 07:05:22 +02:00
Aleksander Morgado
cb0ce9c6ca sms: either 'text' or 'data' is mandatory 2012-09-14 07:05:22 +02:00
Aleksander Morgado
c2b246414c iface-modem-3gpp: update state to REGISTERED after loading operator code/name
Call managers all want to be able to set the operator ID and/or name as soon as
we get registered. We will consider now that whenever we get into registered
state we already have operator code and name updated to the proper values.

Applications shouldn't, though, just rely on those values to be valid as long as
we're registered, as the modem may re-register automatically in some other
network (e.g. going from a roaming network to the home network).

This change involves not setting the state to REGISTERED until operator name
and code loading sequences have been run. We will still signal in the log the
change, with a new 'registering' intermediate state indication.
2012-09-14 06:43:49 +02:00
Aleksander Morgado
40816e5c90 broadband-modem-qmi: don't update access technology from operator info
The operator info seems to show what the operator can do; it doesn't show the
current access technology.
2012-09-13 16:06:51 +02:00
Aleksander Morgado
4b906f7996 broadband-modem-qmi: update access technology along with signal quality 2012-09-13 15:20:50 +02:00
Aleksander Morgado
0080a0d023 broadband-modem-qmi: handle SEARCHING registration state 2012-09-13 15:20:42 +02:00
Dan Williams
210af3241c core: fix a leak in "core: better handling of non-UCS2 conversions that should be UCS2 (bgo #683817)" 2012-09-12 23:03:59 -05:00
Dan Williams
c524734d9f core: better handling of non-UCS2 conversions that should be UCS2 (bgo #683817)
Some modems return the +COPS operator name in hex-encoded current
character set (as set with +CSCS).  Others return the operator name
in ASCII when set to UCS2, while yet others return the  ASCII name
with trash at the end (*cough* Huawei *cough*).  Handle that better
by not crashing.
2012-09-12 23:03:58 -05:00
Aleksander Morgado
73ced242da api: remove `Completed' signal from the Messaging interface
This signal is no longer needed, as the individual state changes of the SMS
objects are enough to know their correct status of completion.

See https://bugzilla.gnome.org/show_bug.cgi?id=675178
2012-09-12 08:00:24 +02:00
Aleksander Morgado
ea87a4556e sms: fix full data setting with `g_variant_new_from_data()'
The `g_variant_new_from_data()' method uses the original array during its
operation, so we need to make sure it is valid as long as the method needs
it, or we'll end up with Valgrind complaining a bit:

==4834== Invalid read of size 1
==4834==    at 0x36ADC75DA5: g_variant_get_byte (in /usr/lib64/libglib-2.0.so.0.3200.4)
==4834==    by 0x3161ABED8C: ??? (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x3161ABEEA2: ??? (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x3161ABE844: ??? (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x3161ABE91E: ??? (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x3161ABEEA2: ??? (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x3161AC232E: g_dbus_message_to_blob (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x3161AB750A: ??? (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x3161AB9FEF: g_dbus_connection_send_message (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x3161ABDB22: g_dbus_connection_emit_signal (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x4C5B8BD: _mm_gdbus_sms_emit_changed (mm-gdbus-sms.c:2291)
==4834==    by 0x36ADC47694: g_main_context_dispatch (in /usr/lib64/libglib-2.0.so.0.3200.4)
==4834==  Address 0x939efa0 is 0 bytes inside a block of size 512 free'd
==4834==    at 0x4A079AE: free (vg_replace_malloc.c:427)
==4834==    by 0x36ADC4D37E: g_free (in /usr/lib64/libglib-2.0.so.0.3200.4)
==4834==    by 0x36ADC1CF40: ??? (in /usr/lib64/libglib-2.0.so.0.3200.4)
==4834==    by 0x43C88E: assemble_sms (mm-sms.c:1260)
==4834==    by 0x43CAD6: mm_sms_multipart_take_part (mm-sms.c:1329)
==4834==    by 0x43E2EF: take_multipart (mm-sms-list.c:268)
==4834==    by 0x43E546: mm_sms_list_take_part (mm-sms-list.c:328)
==4834==    by 0x454C8F: mm_iface_modem_messaging_take_part (mm-iface-modem-messaging.c:353)
==4834==    by 0x461DF6: sms_pdu_part_list_ready (mm-broadband-modem.c:5007)
==4834==    by 0x3161A6CFB6: g_simple_async_result_complete (in /usr/lib64/libgio-2.0.so.0.3200.4)
==4834==    by 0x432F82: at_command_parse_response (mm-base-modem-at.c:490)
==4834==    by 0x489F96: handle_response (mm-at-serial-port.c:161)
2012-09-11 16:40:21 +02:00