Commit Graph

3500 Commits

Author SHA1 Message Date
Aleksander Morgado
acf2e6d1e0 libmm-glib,manager: allow specifying the generated proxy types ourselves 2012-10-01 23:44:47 +02:00
Aleksander Morgado
ca14de0605 doc: setup gtk-doc generation for libmm-glib 2012-10-01 23:44:47 +02:00
Aleksander Morgado
54f476fe10 sierra: run power-down during init 2012-10-01 16:40:52 +02:00
Aleksander Morgado
e669e4c868 cinterion: run power-down during init 2012-10-01 16:40:52 +02:00
Aleksander Morgado
2ca70365cf wavecom: run power-down during init 2012-10-01 16:40:52 +02:00
Aleksander Morgado
814bb21e9b nokia: ensure we skip power down during init 2012-10-01 16:40:52 +02:00
Aleksander Morgado
305f02267e motorola: ensure we skip power down during init 2012-10-01 16:40:52 +02:00
Aleksander Morgado
28800018fb gobi: ensure we skip power down during init 2012-10-01 16:40:52 +02:00
Aleksander Morgado
668976f4d7 iridium: ensure we skip power down during init 2012-10-01 16:40:52 +02:00
Aleksander Morgado
a5870ac3c6 zte: run power-down during init 2012-10-01 16:40:52 +02:00
Aleksander Morgado
a0e19630e4 icera: we won't be implementing power-down during init
Some Icera-based modems (e.g. Samsung/Icera Y3300/Y3400) may take a loong time
to run the power down command (see commit 5f1a1cf8). So, for these modems we
will fully skip the power down command run during initialization.
2012-10-01 16:40:52 +02:00
Aleksander Morgado
77208f66ab iface-modem: ensure we're in low power mode when initializing
The power-down command defined by the plugin will be run *only* after having
checked for current and modem capabilities, as plugins (e.g. Sierra) may have
different commands for that depending on whether they are 3GPP or 3GPP2.

We do not reuse the 'modem_power_down' callback from the disabling sequence, as
some plugins really behave pretty badly with this (e.g. Samsung CFUN=4 may take
up to 30s to complete). So, we let plugins use the power-down command when
disabling but avoid launching it during init.
2012-10-01 16:40:51 +02:00
Aleksander Morgado
b622424d2f broadband-modem: handle unknown errors in AT sequences
When none of the commands in the AT sequence succeeds no error is set.
2012-09-28 20:35:41 +02:00
Aleksander Morgado
00a8ed3af4 iface-modem: ensure the state change is flushed before the detailed notify
In order to ease the life for clients listening to the 'state-changed' signal,
the change in the 'state' property in the DBus interface skeleton is flushed
right away, before emitting 'state-changed'. By doing this we make sure that
the 'state-changed' callbacks in the clients are able to see exactly the same
current state in the modem proxy.
2012-09-28 14:57:25 +02:00
Aleksander Morgado
65c3976cad core: acquire DBus name only after having created the `MMManager'
The `MMManager' is itself also a `GDBusObjectManagerServer'. If we create this
object after having fully acquired the bus name, the client application in the
other side of the bus could be trying to use the ObjectManager interface before
we actually exported it, which is wrong. Therefore, we need to make sure that
the Manager interfaces are all exported before the name is acquired.
2012-09-28 08:42:13 +02:00
Dan Williams
0b059ea9c9 uml290mode: fix log message 2012-09-27 11:13:26 -05:00
Dan Williams
f5c5a455c1 uml290mode: offline and reset modem after making changes 2012-09-27 10:55:48 -05:00
Dan Williams
fb65cba607 qcdm: add qcdm_cmd_control_new() to set operating mode 2012-09-27 10:55:20 -05:00
Aleksander Morgado
1b5804895f build: use $PKG_CONFIG
The build system sets up this variable for us, so use it rather than
hardcoding "pkg-config" which might be the wrong one.

Equivalent to the one done by
    Mike Frysinger <vapier@gentoo.org>
in libqmi.
2012-09-24 04:36:38 +02:00
Ben Chan
717b16b5b6 broadband-modem: increase timeout for ATZ
Some modem like Novatel LTE can take up to 5 seconds to complete the ATZ
command. Increase the timeout for ATZ from 3 seconds to 6 seconds.
2012-09-22 14:55:50 +02:00
Ben Chan
e60207d6ab broadband-modem: disconnect bearers only if the bearer list still exists
This patch fixes a crash when MMBroadbandModem tries to access an
already cleared bearer list during the disabling steps.

Thread 0 *CRASHED* ( SIGSEGV @ 0x00000000 )

0x7f6eed4c40a3   [ModemManager]             - mm-bearer-list.c:259       mm_bearer_list_disconnect_all_bearers
0x7f6eed4cd6f8   [ModemManager]             - mm-iface-modem.c:1216      handle_enable_auth_ready
0x7f6eed332676   [libgio-2.0.so.0.3000.2]   - gsimpleasyncresult.c:749   g_simple_async_result_complete
0x7f6eed4c5750   [ModemManager]             - mm-base-modem.c:1015       authorize_ready
0x7f6eed332676   [libgio-2.0.so.0.3000.2]   - gsimpleasyncresult.c:749   g_simple_async_result_complete
0x7f6eed332788   [libgio-2.0.so.0.3000.2]   - gsimpleasyncresult.c:761   complete_in_idle_cb
0x7f6eecf36f44   [libglib-2.0.so.0.3000.2]  - gmain.c:2441               g_main_context_dispatch
0x7f6eecf37597   [libglib-2.0.so.0.3000.2]  - gmain.c:3089               g_main_context_iterate
0x7f6eecf37b51   [libglib-2.0.so.0.3000.2]  - gmain.c:3297               g_main_loop_run
0x7f6eed4b5ad1   [ModemManager]             - main.c:150                 main
0x7f6eec95141c   [libc-2.15.so]             - libc-start.c:234           __libc_start_main
0x7f6eed4b55e8   [ModemManager]             + 0x0001a5e8
2012-09-22 14:55:42 +02:00
Ben Chan
6124022ab3 modem-helpers: handle the case when operator name is "Unknown"
Some modems report "Unknown" as the operator name when failed to obtain
the actual value:

    --> 'AT+COPS=3,0;+COPS?<CR>'
    <-- '<CR><LF>+COPS: 0,0,"Unknown",0<CR><LF><CR><LF>OK<CR><LF>'

This patch prevents "Unknown" from being treated as a valid operator name.
2012-09-20 12:02:06 -05:00
Aleksander Morgado
6995300ecd huawei: if port replies to AT^GETPORTMODE, port is AT
Just skips the additional check for AT support in the port.
2012-09-19 10:37:31 +02:00
Aleksander Morgado
c4b5293669 device: if failed to get VID/PID in first port, try the next one
Don't rely only in the first grabbed port to get VID/PID. Some modems, e.g.
Huawei E367, won't report a proper VID in the cdc-wdm port, which is the first
one probed.
2012-09-19 10:18:44 +02:00
Aleksander Morgado
ee099fcd08 plugin-manager: never suggest the Generic plugin to others
Some modems, e.g. Huawei E367, will probe first the QMI port and for some reason
it doesn't report a proper VID/PID so the Generic plugin is the one finally
accepting that port. When we probe the AT ports afterwards we already got the
Generic plugin as suggestion, and we end up not grabbing the proper primary and
secondary ports as we skipped the AT^GETPORTMODE reply.

So, from now on the Generic plugin is never suggested to other probes; except
for the case where we need the suggestion to finish a probing task which was
'deferred until suggested'.

Also, the device-level plugin can now be overwritten, if and only if, the
previously set plugin was the Generic one.
2012-09-19 10:18:38 +02:00
Aleksander Morgado
a6faae3260 broadband-modem: skip +CGMM: prefix when loading device model
Some devices, e.g. ZTE MF820D, seem to prefix the `AT+CGMM?' response with the
`+CGMM:' string, resulting in the following model string being loaded:

   model: '+CGMM: "MF820D"'

Avoid this by:
 1) Removing the expected prefixes.
 2) Unquoting the resulting string.

Reported by: Marius Kotsbak <marius.kotsbak@gmail.com>
2012-09-19 07:42:47 +02:00
Marius B. Kotsbak
d2353e01ff sierra: use +CFUN=4 for powering down GSM modems 2012-09-18 16:27:09 -05:00
Aleksander Morgado
b65bc50777 qmi-port: plug memleak
Ensure we clear all allocated client objects when disposing the port.
2012-09-18 19:10:05 +02:00
Aleksander Morgado
127900b67b broadband-modem-qmi: plug memleak, always need to unref() input containers 2012-09-18 19:09:57 +02:00
Aleksander Morgado
48bb20d018 libmm-common,gps-nmea: skip duplicate traces in sequence 2012-09-18 13:57:25 +02:00
Aleksander Morgado
598799a61c broadband-modem-qmi: request NMEA trace indications 2012-09-18 13:15:35 +02:00
Aleksander Morgado
48d8bf4164 broadband-modem-qmi: listen to "PDS Event Report" indications 2012-09-18 13:15:35 +02:00
Aleksander Morgado
b43c5933d8 broadband-modem-qmi: enable/disable GPS location gathering 2012-09-18 13:15:35 +02:00
Aleksander Morgado
4babcbe30e broadband-modem-qmi: new common method to peek a QMI client 2012-09-18 13:15:34 +02:00
Aleksander Morgado
0e40bb7b11 broadband-modem-qmi: check support for GPS location capabilities 2012-09-18 10:59:49 +02:00
Aleksander Morgado
6284737249 sms: don't allow more than 255 parts 2012-09-14 13:12:02 +02:00
Aleksander Morgado
d5e57dd8eb sms: fix error message string when failing to parse input text 2012-09-14 13:11:33 +02:00
Aleksander Morgado
d30ec8f5a6 cli: minor text output fixes 2012-09-14 11:57:36 +02:00
Aleksander Morgado
2c1ce492ce sms: don't try the generic SMS method if we got a timeout error 2012-09-14 07:05:26 +02:00
Aleksander Morgado
e212f6b6ed sms: create SMS parts only when storing or sending
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.
2012-09-14 07:05:26 +02:00
Aleksander Morgado
2da9474d0c test: new tester for the messaging capabilities of a modem, using `mmcli'
Usage:
  mmcli-test-sms [MODEM INDEX] [all|ucs2|gsm7|data] [NUMBER]"

If [NUMBER] is not given, a dummy number will be used and NO SMS will be sent.

If you give a proper [NUMBER], we will try to send the SMS.
2012-09-14 07:05:26 +02:00
Aleksander Morgado
4196ef1a86 sms: don't try to delete parts if SMS not stored 2012-09-14 07:05:26 +02:00
Aleksander Morgado
8612667776 sms,sms-qmi: update timeout when sending an SMS to 30s 2012-09-14 07:05:26 +02:00
Aleksander Morgado
f6832d72cf cli: new `--create-file-with-data' action for SMS objects
This new action allows creating a new file with the binary data stored in the
SMS, if any.

E.g.:

$> sudo mmcli -s 7 \
              --create-file-with-data=output.txt

This action can only be run on SMS object with binary data.
2012-09-14 07:05:26 +02:00
Aleksander Morgado
0156279749 cli: new `--messaging-create-sms-with-data' switch
This switch can be run along with the `--messaging-create-sms' action, in order
to include in the SMS the data as given in the file specified by the new switch.

E.g.:

$> sudo mmcli -m 0 \
              --messaging-create-sms="number='1234567890'" \
              --messaging-create-sms-with-data=file.txt

In this case, the SMS properties string cannot contain a 'text' field.
2012-09-14 07:05:26 +02:00
Aleksander Morgado
1304a628f8 sms-part: include user data, if passed, when building the PDU 2012-09-14 07:05:26 +02:00
Aleksander Morgado
8e6a603578 libmm-glib: provide accessors for the 'Data' property in the SMS interface 2012-09-14 07:05:26 +02:00
Aleksander Morgado
a66f971a7c libmm-common: added common utils from core
Moved the utils to play with binary to hex strings into libmm-common.
2012-09-14 07:05:26 +02:00
Aleksander Morgado
fbe01c8d6a sms: 'Text' and 'Data' will never be given at the same time
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.
2012-09-14 07:05:26 +02:00
Aleksander Morgado
15be01d4fa sms: fix error return when a mandatory parameter missing in dictionary 2012-09-14 07:05:26 +02:00