Commit Graph
7219 Commits
Author SHA1 Message Date
Aleksander Morgado cd2f8d9d63 port-qmi: keep track of the endpoint info
The endpoint info of a given MMPortQmi is immutable (it's associated
to the specific kernel driver in use and to the specific physical
interface number of the device).

We'll load it as soon as the kernel device object is set in the port,
and we'll keep it in the private struct so that it can be used at any
time, e.g. by the WDA Get/Set Data Format operations on newest
devices, where the endpoint info TLV is mandatory.
2021-03-10 10:59:22 +01:00
Aleksander Morgado d1a893775e docs: add api indices for 1.18 2021-03-10 10:59:22 +01:00
Aleksander Morgado 73db7f205c api,bearer: new 'Multiplexed' property
This property will be TRUE if the bearer has the data session
connected through a multiplexed interface.

If the bearer is disconnected, or connected without multiplexing, the
property will report FALSE.
2021-03-10 10:59:22 +01:00
Aleksander Morgado 05b9ab7c25 api,modem: new 'MaxActiveMultiplexedBearers' property
In addition to the amount of bearers a user may connect without
multiplexing enabled (the default until now), we now also expose the
maximum number of bearers a user may connect after enabling
multiplexing over one single network interface (if supported).

The method responsible for creating the MMBearerList is now also
subclassable, so that implementations supporting multiplexing can
provide their own version with their own thresholds.
2021-03-10 10:59:22 +01:00
Aleksander Morgado 35e20a48c8 api,modem: deprecate the 'MaxBearers' property
This property was never initialized with a correct value, we would
always use the same value as used for MaxActiveBearers, which isn't
technically right. Just suggest to ignore this property, and flag
it as deprecated.

In addition to deprecating the API property, we will internally no
longer limit the amount of bearer objects that may be created with
different connection settings. The bearer object exposed in DBus is a
representation of the connection that may be setup, and so we can hold
as many representations as we want as long as the amount of connected
bearers doesn't exceed the maximum amount for each modem.

Leaving around the disconnected modems also serves another purpose.
Each bearer holds information about the amount of times a connection
with it has been attempted, and the amount of data transferred through
it. If we use the Simple.Connect() method to connect the modem using
different bearer settings, we won't lose the information of the past
connection attempts with different settings.
2021-03-10 10:59:22 +01:00
Aleksander Morgado 064e92e9b7 api,simple: new 'multiplex' setting in bearer properties
Both the Simple.Connect() and Modem.CreateBearer() are updated to
allow a new 'multiplex' setting in the properties provided by the user
in both of these methods.

The new setting expects a MMBearerMultiplexSupport enum indicating
what kind of multiplex needs the user has:
 * none: if multiplex must not be used.
 * requested: if multiplex should be used if available.
 * required: if multiplex must be used.

The underlying implementations will take care of accepting or
rejecting the setting depending on the system and modem capabilities.
2021-03-10 10:59:19 +01:00
Andrew Lassalle 71bad1d862 sim: Fix wrong return type
The function should return a boolean, so using g_return_if_fail is not
correct.
2021-03-09 15:38:16 -08:00
Teijo Kinnunen 8b1ae5afab modem-helpers,mm-base-sim: Sim.SetPreferredNetworks AT implementation
Implement Sim.SetPreferredNetworks method by using the AT+CPOL command.
2021-03-09 16:33:45 +01:00
Teijo Kinnunen 0919abaa2f mmcli,sim: implement --sim-set-preferred-networks function 2021-03-09 08:52:55 +02:00
Teijo Kinnunen 66e93751b8 api,sim: add new Sim.SetPreferredNetworks method
This commit includes D-Bus processing and documentation, but not any
modem access implementation.
2021-03-09 08:52:55 +02:00
Teijo Kinnunen 72d753ba83 base-sim: select PLMN list before reading preferred networks
Before reading preferred network list with AT+CPOL?, AT+CPLS=0 is
now invoked first to make sure that the correct PLMN list (i.e.
user-defined) is selected.
2021-03-09 08:52:55 +02:00
Aleksander Morgado a659970634 broadband-modem-qmi: update EPS/5GS reg state when idle/searching
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/317
2021-03-05 17:36:33 +00:00
Louis-Alexis Eyraud 154455a723 zte: disable CMER/CIND support explicitly
It looks like when indicators are enabled in ZTE modems like the
MF833V, the whole connection process is very unstable. The AT
reference doesn't do any mention to +CIND/CMER/CIEV either, so we'll
just disable all and use +CSQ based signal loading.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/303

Signed-off-by: Louis-Alexis Eyraud <louis-alexis.eyraud@sigfox.com>
2021-03-05 10:19:23 +01:00
Aleksander Morgado 55d60f3c12 sms: common timeout of 180s for the send operation
On low signal quality conditions, the process of sending the SMS to
the network may take a really long time, way more than the 30s used as
default in some implementations.

We now define a common timeout value of 180s for this operation in all
protocols.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/328
2021-03-04 20:45:00 +00:00
Aleksander Morgado 5d176a1e61 base-modem: explicitly say if NET or TTY data ports are supported
A modem that creates exclusively bearer objects that work with NET
ports (e.g. all QMI or MBIM modems) must not add any TTY port in the
list of data ports.

A modem that creates exclusively bearer objects that work with TTY
ports (e.g. the generic modem) must not add any NET port in the
list of data ports.

A modem that may use both TTY and NET ports should add all in the list
of data ports.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/324
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/329
2021-03-04 18:03:28 +01:00
Aleksander Morgado b509229d57 broadband-modem-qmi: use updated system info API 2021-03-02 14:38:35 +01:00
Aleksander Morgado 496c4e30e9 broadband-modem-qmi: enable network reject indications
We will issue warnings in the log whenever a network reject indication
is received.
2021-03-02 14:38:35 +01:00
Dylan Van Assche 8bc90b7131 broadband-modem-qmi: Enable AT URCs and QMI indications
Enable both AT URCs and QMI indications for messaging events.
This allows to receive text messages during suspend
on the PinePhone with a Quectel EG25 modem.
2021-03-01 16:18:33 +00:00
Aleksander Morgado 438ff54d03 libmm-glib,tests: include string.h explicitly
For strlen()
2021-03-01 16:02:33 +01:00
Aleksander Morgado da0e610f5f modem-helpers-mbim: include string.h explicitly
For strstr()
2021-03-01 15:56:14 +01:00
Aleksander Morgado a9611c6279 utils: import ptr array lookup with GEqualFunc from GLib 2.54
This fixes the build when using GLib < 2.54.
2021-03-01 15:55:22 +01:00
Pavan Holla e1372a716e iface-modem: detect hotswap on all slots
Prior to this change, hotswap was detected on the primary sim slot only.
After this change, hotswap on any slot triggers reenumeration of the
modem. SIM hotswap events happening on the non-active slot would also
trigger a full modem reprobe. The modem may already have been
connected while the SIM event happens on the secondary slot, and we force
disconnection to reload the inactive SIM info. However, a user would
expect feedback for their SIM action, so we need to reprobe the modem.
2021-02-27 15:26:43 +01:00
Aleksander Morgado fbc1636001 docs: add api index for 1.18 2021-02-26 12:28:01 +01:00
Teijo Kinnunen a4aba0a6b2 mmcli,sim: add preferred networks list to SIM properties 2021-02-26 12:28:01 +01:00
Teijo Kinnunen 816beeffcb libmm-glib,modem-helpers,mm-base-sim: implement Sim.PreferredNetworks
The ModemManager1.Sim.PreferredNetworks property contains the preferred
networks (and access technologies, if available) configured to the
SIM card.

This commit implements preferred networks reading with AT+CPOL.
2021-02-26 12:28:01 +01:00
Aleksander Morgado c7d366671f shared-qmi: network registration cancellation logic with asserts disabled
g_assert() calls may be disabled, and if so, the network registration
task would never get completed.
2021-02-26 11:18:22 +01:00
Aleksander Morgado f10e4af919 libmm-glib,bearer-properties: fix 'allow roaming' comparison
Fix the 'allow roaming' setting comparison, which was breaking the
whole bearer properties comparison logic, and therefore making
Simple.Connect() recreate over and over the bearer with the same
settings.

Fixes 5629f47a59
2021-02-25 15:23:36 +01:00
Yegor Yefremov 297a8c85ae examples: sms: resolve PEP8 issues
Use autopep8 utility to resolve issues like spaces before brackets
and wrong hanging indentation.

Also treat objects like boolean variables to check whether they are
None or not.
2021-02-25 14:14:55 +01:00
Aleksander Morgado aba237df4e broadband-modem-qmi: allow lookup of QMI for data without SIO port 2021-02-25 14:13:03 +01:00
Aleksander Morgado 381e2f382b base-modem: separate method to lookup exact port by name
There's no point in returning a list of all ports with a given name,
just provide a lookup method that returns the single port with the
given name.
2021-02-25 14:13:03 +01:00
Aleksander Morgado b8e076f9c4 kernel-device-udev: keep track of the client object
Instead of creating new clients internally whenever we need them, just
make sure each MMKernelDeviceUdev object keeps a full reference to the
GUdevClient that generated all GUdevDevices.
2021-02-25 12:13:16 +01:00
Aleksander Morgado 1b35d74c15 kernel-device: add get_interface_number() method
We already have methods to query for interface specific attributes
like class/subclass/protocol, so add a new one for the interface
number, and make sure we use ATTRS{bInterfaceNumber} to load it
always, instead of assuming the ID_USB_INTERFACE_NUM property is set.
2021-02-24 20:47:57 +01:00
Yegor Yefremov cc07d21410 examples: network-scan: get rid of global variables
Move the code into the main() routine.
2021-02-24 14:59:48 +01:00
Aleksander Morgado 6250603496 build: improve releasing notes 2021-02-24 09:16:49 +01:00
Aleksander Morgado 4a06a02765 charsets: detect iconv() support in runtime
The only purpose of this is to log what we found, nothing else, as a
quick way to detect platform support for the charsets we need.
2021-02-23 11:35:11 +00:00
Aleksander Morgado 8a8e00168b charsets: define common translit fallback character 2021-02-23 11:35:11 +00:00
Aleksander Morgado c84454c1b0 charsets: remove charset_hex_to_utf8()
No longer used, replaced by the new common conversion methods.
2021-02-23 11:35:11 +00:00
Aleksander Morgado 0ff3eb7ee0 charsets: remove take_and_convert methods
These methods worked in a very strict way for some encodings, and in a
very very loose way for others. E.g. when converting from hex-encoded
UCS-2, we would attempt to convert as much text as we could even if
the input string was truly not even close to UCS-2. This kind of "do
our best" could make sense when processing e.g. the operator name
reported by the modem, as that is some string to show to the user and
there may be no strict requirement to have it perfectly fine. But the
kind of loose comparison done for UCS-2 doesn't make sense e.g. when
converting USSD responses or SMS messages.
2021-02-23 11:35:11 +00:00
Aleksander Morgado ab4c31ec0b cinterion: rework mno decoding to use str_to_utf8() 2021-02-23 11:35:11 +00:00
Aleksander Morgado 6bc07b4b14 cinterion: rework band encoding to use str_to_utf8()
Also providing support to report errors when attempting to decode the
strings.
2021-02-23 11:35:11 +00:00
Aleksander Morgado 16df1e17e6 helpers: rework normalize_operator() to use str_to_utf8()
Instead of blindly assuming that we can take whatever string given as
valid UTF-8, we'll always attempt to convert from the current modem
charset into UTF-8. Before we were doing this for hex-encoded UCS2,
but not for example for GSM-7.

And due to the now applied GSM-7 conversion, the mf627a/mf627b +COPS
parsing unit tests are updated accordingly, because when converting
from an input string that contains byte 0x40 ('@' in UTF-8) as if it
were GSM-7, the 0x40 is taken as character '¡', encoded as 0xc2,0xa1
in UTF-8).
2021-02-23 11:35:11 +00:00
Aleksander Morgado 63fa9eee46 charsets,tests: update take_and_convert tests to str_from/to 2021-02-23 11:35:11 +00:00
Aleksander Morgado 3ac248a7a6 cinterion: move sequence to set bands to private ctx
The sequence of commands is exclusively used during the set current
bands operation, so there is no point in storing it in the private
object data.
2021-02-23 11:35:11 +00:00
Aleksander Morgado e5363b546b charsets: use new str_from_utf8() instead of take_and_convert_to_current_charset() 2021-02-23 11:35:11 +00:00
Aleksander Morgado 395ab06c03 charsets: use new bytearray_to_utf8() instead of hex_to_utf8() 2021-02-23 11:35:11 +00:00
Aleksander Morgado 5ea4a591a4 charsets: use new bytearray_to_utf8() instead of byte_array_to_utf8() 2021-02-23 11:35:11 +00:00
Aleksander Morgado 033e174e44 charsets: make charset_gsm_unpacked_to_utf8() private
Use the generic mm_modem_charset_bytearray_to_utf8() instead.
2021-02-23 11:35:11 +00:00
Aleksander Morgado 8bfdfb187b charsets: use new bytearray_from_utf8() instead of byte_array_append() 2021-02-23 11:35:11 +00:00
Aleksander Morgado 75b37e16b1 charsets: make charset_utf8_to_unpacked_gsm() private
Use the generic mm_modem_charset_bytearray_from_utf8() instead.
2021-02-23 11:35:11 +00:00
Aleksander Morgado 9c613d33e1 charsets: new common APIs to convert from/to charsets and UTF-8 2021-02-23 11:35:11 +00:00