Commit Graph

1420 Commits

Author SHA1 Message Date
Aleksander Morgado
4db3ccf2af helpers: +CNUM parser doesn't return any error 2017-07-19 11:21:27 +02:00
Aleksander Morgado
4901a67660 telit: add missing source_tag in g_task_report_new_error() call
Fixes: 1bd9935b5a
2017-07-18 10:33:00 +02:00
Aleksander Morgado
1317a728da telit: fix minor typo 2017-07-18 10:26:45 +02:00
Ben Chan
1bd9935b5a telit: fix modem_set_current_bands to use g_task_report_new_error
Commit acf101335 ("telit: port mm-broadband-modem-telit to use GTask")
ported most of the modem_set_current_bands code to use GTask, but missed
a few g_simple_async_report_error_in_idle calls, which potentially leads
to an incorrect G_TASK cast in modem_set_current_bands_finish.
2017-07-18 10:25:20 +02:00
Aleksander Morgado
5ee0b32298 zte,icera: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:17 +02:00
Aleksander Morgado
7b392398e4 zte: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:17 +02:00
Aleksander Morgado
ef274b5fa2 simtech: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:17 +02:00
Aleksander Morgado
a3c980c78b option,hso: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:17 +02:00
Aleksander Morgado
f3a301db3c option: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:17 +02:00
Aleksander Morgado
e2246da507 mtk: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:17 +02:00
Aleksander Morgado
15a221e88d mbm: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:17 +02:00
Aleksander Morgado
0be6e7d2ea altair-lte: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:17 +02:00
Aleksander Morgado
c44fa6c681 icera: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:17 +02:00
Aleksander Morgado
f1f313c214 huawei: skip unrequired explicit casts to GSimpleAsyncResult 2017-07-17 10:20:16 +02:00
Aleksander Morgado
91bbcb5c5f huawei: fix async completion in 3gpp event handlers setting 2017-07-17 10:20:16 +02:00
Aleksander Morgado
c0c2e8aae8 huawei: fix async completion in voice event handlers setting 2017-07-17 10:20:16 +02:00
Aleksander Morgado
7b0c0bc96b huawei: fix async completion in cdma event handlers setting 2017-07-17 10:20:16 +02:00
Aleksander Morgado
24e8785a83 via: fix async completion in cdma event handlers setting 2017-07-17 10:14:13 +02:00
Ben Chan
fe384625aa telit: fix memory leaks in unit tests 2017-07-12 11:04:09 +02:00
Ben Chan
4fbdee1e6d telit: minor coding style fixes 2017-07-12 11:04:09 +02:00
Ben Chan
39ddd34898 telit: remove unnecessary NULL checks for g_free / g_match_info_free
g_free() and g_match_info_free() already check if the given pointer is
NULL and does nothing on a NULL pointer.
2017-07-12 11:04:09 +02:00
Ben Chan
4a7190f64b telit: fix memory leak in mm_telit_get_4g_mm_bands 2017-07-12 11:04:09 +02:00
Ben Chan
b6f40de1e1 telit: remove unused 'flags' variable in mm_telit_get_4g_mm_bands 2017-07-12 11:04:09 +02:00
Ben Chan
4e99ca7fd5 ublox: fix memory leaks in unit tests 2017-07-12 11:01:27 +02:00
Ben Chan
d308bbf4c6 novatel-lte: check error returned by g_task_propagate_error instead
When returning an enum value via g_task_return_int, some code assumes
the enum value is always non-negative and thus considers that a negative
value implies an error. This assumption could be invalidated if a
negative value is later added to the enum. To make it less error prone
to future changes, this patch modifies the code to check if the GError
argument to g_task_propagate_error is populated instead.
2017-07-07 10:16:09 +02:00
Ben Chan
344d96af44 cinterion: check error returned by g_task_propagate_error instead
When returning an enum value via g_task_return_int, some code assumes
the enum value is always non-negative and thus considers that a negative
value implies an error. This assumption could be invalidated if a
negative value is later added to the enum. To make it less error prone
to future changes, this patch modifies the code to check if the GError
argument to g_task_propagate_error is populated instead.
2017-07-07 10:15:07 +02:00
Aleksander Morgado
bdfd6d92ee telit: minor coding style fixes
Always name 'self' the object being implemented.
2017-06-30 14:29:37 +02:00
Daniele Palmas
acf1013356 telit: port mm-broadband-modem-telit to use GTask 2017-06-30 14:13:50 +02:00
Daniele Palmas
35837208df telit: port mm-common-telit to use GTask 2017-06-29 11:21:47 +02:00
Ben Chan
989ade7b8c enums: replace Roman numeral suffixes in MM_MODEM_BAND_EUTRAN_*
3GPP TS 36.101 Table 5.5-1 refers the E-UTRA operating bands as 1, 2, 3,
..., etc.
2017-06-28 18:21:25 +02:00
Daniele Palmas
4dbea97e1b telit: fix #PSNT values interpretation for HSDPA and LTE modems
Telit LTE modems use #PSNT: 4 for LTE access technology,
and #PSNT: 5 for unknown access technology, while HSDPA
modems use #PSNT: 4 for unknown access technology.

This patch fixes those #PSNT values interpretation according
to the modem capabilities.
2017-06-16 19:46:57 +02:00
Aleksander Morgado
f4c4e36461 cinterion: use ^SIND unsolicited messages for access tech reporting
If the modem supports ^SIND psinfo reporting, we enable the URC and
flag the access technology polling unsupported, so that we only update
access technology via the +CIEV URCs.

E.g.:

    (ttyACM1): --> 'AT^SIND="psinfo",1<CR>'
    (ttyACM1): <-- '<CR><LF>^SIND: psinfo,1,10<CR><LF><CR><LF>OK<CR><LF>'
    Reporting initial access technologies...
    Modem /org/freedesktop/ModemManager1/Modem/0: access technology changed (unknown -> hsdpa, hsupa)
    ...
    (ttyACM1): <-- '<CR><LF>+CIEV: psinfo,4<CR><LF>'
    Modem /org/freedesktop/ModemManager1/Modem/0: access technology changed (hsdpa, hsupa -> edge)
    ...
2017-06-06 15:21:08 +02:00
Aleksander Morgado
2c19b1f778 iface-modem: if bands, capabilities or modes change, refresh signal
We also remove the explicit refresh request from the Cinterion plugin,
as this is a generic action applicable to all modems that require
polling for signal quality and/or access technology.
2017-06-06 15:20:56 +02:00
Aleksander Morgado
8ad868cea2 iface-modem: consolidate signal quality and access tech polling
Plugins have two ways to update signal quality and access technology
values: via unsolicited messages or via polling periodically.

Instead of keeping separate contexts for polling signal quality and
access technology values, we setup a common timeout to trigger
both. This allows us to simplify in which case the explicit update is
required, whenever one is needed to be explicitly updated, the other
one should also be.

The logic now also allows plugins to return an UNSUPPORTED error in
either load_signal_quality() and/or load_access_technologies() to tell
the interface logic that the polling of the specific item shouldn't be
performed (e.g. if the updates are expected via unsolicited messages).

If both signal quality and access technology polling is flagged as
disabled, we totally disable the polling logic internally.

The new SignalCheckContext is bound to the lifetime of the object so
that we can keep the value of the supported flags until the object is
destroyed.
2017-06-06 15:20:51 +02:00
Aleksander Morgado
db5619b3eb build,dell: reorder rules last
Dell plugin is a compilation of other plugins, move last.
2017-06-05 15:05:45 +02:00
Aleksander Morgado
d6d7b837b8 build,telit: fix distcheck 2017-06-05 14:46:48 +02:00
Aleksander Morgado
08782995e2 telit: rework QSS unsolicited handler enabling logic
When the async method starts we store already the primary and the
optional secondary port objects in the method context, keeping a full
reference for each.

When we parse the response for the enabling command, we just reuse the
stored port objects, instead of re-querying the modem to get them, and
this makes sure that the port objects where we want to set the
unsolicited message handlers are still valid. If the ports are gone
in the middle of the enabling operation, the handlers will be set
without errors, even if the ports may likely get completely disposed
when this async method context is disposed.

Additionally, we make sure that we return an error also for the case
where there is no secondary port and the enabling on the primary port
failed.

This patch also fixes the use of the at_command_full_finish() method to
complete the at_command_full() async operation, to keep consistency.
2017-06-05 14:04:42 +02:00
Aleksander Morgado
d6779b91b2 telit: make sure QSS status values read are always known
Given that the MMTelitQssStatus enums are mapped directly to the
values read from the #QSS response, we need to make sure that we never
return a value for which we don't have an enum defined.

Also, use set_error() instead of the propagate_error() + error_new()
combo.
2017-06-05 14:04:42 +02:00
Carlo Lobrano
4cd5044bfd telit: manage QSS transitions
Currently, Telit's SIM swap implementation is stateless and
based on #QSS unsolicited messages 0/1 (SIM_REMOVED/SIM_INSERTED).

However, the user might have configured the modem in order to provide a
more detailed information, with #QSS values 2/3 (SIM UNLOCKED/SIM READY).

In this case and with current implementation, even receiving "#QSS: 3" will
trigger the "SIM swap" logic. The same issue might occur in other use cases
too, i.e. with SIM locked or when the message is received from both USB
ports.

This patch makes SIM swap implementation stateful, and it considers as an
actual SIM swap, only transitions from #QSS: 0 to #QSS: 1/2/3 and vice
versa.
2017-06-05 14:04:42 +02:00
Aleksander Morgado
b5e94185bb huawei: let the E3372 run NDISDUP via TTY
This modem ends up exposing a cdc-wdm port and a WWAN network
interface, but the cdc-wdm port is totally unusable, it won't reply to
any AT command or anything.

Instead this modem can do NDISDUP via TTY, which is what the Windows
drivers are also doing.
2017-06-02 13:13:59 +02:00
Aleksander Morgado
e2e2c3e019 cinterion: retry GPS Engine activation up to 3 times
The default setup with 100ms between GPS commands doesn't seem to be
always enough for the Engine activation step:

   [1495016625.392972] (ttyACM1): --> 'AT^SGPSC="NMEA/Output","on"<CR>'
   [1495016625.503885] (ttyACM1): <-- '<CR><LF>^SGPSC: "Nmea/Output","on"<CR><LF><CR><LF><CR><LF>OK<CR><LF>'
   [1495016625.607650] (ttyACM1): --> 'AT^SGPSC="Power/Antenna","on"<CR>'
   [1495016625.697862] (ttyACM1): <-- '<CR><LF>^SGPSC: "Power/Antenna","on"<CR><LF><CR><LF>OK<CR><LF>'
   [1495016625.809393] (ttyACM1): --> 'AT^SGPSC="Engine","1"<CR>'
   [1495016625.895970] (ttyACM1): <-- '<CR><LF>+CME ERROR: 767<CR><LF>'

We now setup up to 3 retries for the Engine activation step before
returning an error, and we also update to 2000ms the wait time before
the Engine activation command is run.
2017-05-30 21:06:12 +02:00
Aleksander Morgado
aa8ac416f8 cinterion: support AT^SGPSC capable modems
The AT^SGPSS command provides an easy way to just start/stop GPS, but
unfortunately it isn't supported by all Cinterion modems.

The AT^SGPSC command instead is more widely available but it requires
several steps to start and stop the different elements of the GPS
receiver.

Implement support for both, preferring AT^SGPSSS if available and
falling back to AT^SGPSC otherwise.
2017-05-30 21:06:04 +02:00
Aleksander Morgado
d772301cd4 cinterion: setup GPS port only if GPS support detected
i.e. if AT^SGPSS not supported, we don't even add traces handler to
the GPS data port.
2017-05-30 21:05:56 +02:00
Aleksander Morgado
1857e9b36e cinterion: flag PLS8 GPS data port 2017-05-30 21:05:50 +02:00
Aleksander Morgado
bf549d1bca cinterion,location: refactor enable/disable and capabilities checks
When checking for location capabilities, we will make sure AT^SGPSS is
supported and if it isn't we won't report GPS capabilities.

The location enable and disable paths are refactored to make it easier
to add possible new GPS commands to use instead of AT^SGPSS, if this
isn't supported (e.g. in the PLS8 devices).
2017-05-30 21:05:44 +02:00
Aleksander Morgado
2eb55d3224 plugins: use G_N_ELEMENTS when iterating ports array 2017-05-30 17:28:23 +02:00
Aleksander Morgado
b874fba0e6 ublox: use send-delay=0 by default
Looks like the u-blox SARA-U260 requires this, see:
https://lists.freedesktop.org/archives/modemmanager-devel/2017-May/004670.html
2017-05-30 17:18:38 +02:00
Aleksander Morgado
fcd4a8c5dc altair,hso,samsung: setup send-delay=0 for probing
The Altair, Option HSO and Samsung plugins all use the send-delay=0
setting once the modem object has been created. For consistency, use
the same setting during port probing.
2017-05-30 17:18:32 +02:00
Aleksander Morgado
2b8a7e4c16 telit: remove custom +CMER enabling
This is now managed directly in the generic plugin.
2017-05-29 14:59:16 +02:00
Aleksander Morgado
ec98b9e956 cinterion: remove custom +CMER enabling
This is now managed directly in the generic plugin.
2017-05-29 14:59:01 +02:00