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.
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
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.
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.
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.
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.
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).
The //TRANSLIT extension is not always supported by the different
iconv() implementations that we may find out there, so let's
completely avoid using it.
For some of the charsets it actually didn't make much sense anyway,
e.g. as converting to UTF-16 or UTF-8 would always be possible without
requiring //TRANSLIT to take effect.
The //TRANSLIT extension was also being used sometimes in the source
charset identification, which was also not fully correct, as we would
only expect it in the target charset identification.
If the conversion is not fully compatible, the user of the method
needs to request transliteration enabled explicitly in order to avoid
returning errors in this method.
Until now, this method would automatically apply transliteration;
i.e. replacing characters with '?' when no direct translation was
available.
We can attempt to do that transliteration on strings that are not
critical, e.g. the operator name reported by the network. But we
should not do that on other types of strings, e.g. on SMS contents
that may really have additional purposes than just being
human-readable.
This commit makes the transliteration option to be explicitly
requested by the caller.
There's no point in adding a quoting option to this method; if the
caller needs the appended string quoted, it should quote it before
passing it to this method.
It was nowhere used anyway.
If we were requesting for IPv4v6 and we only got IPv4 reported as
activated, we would right away ignore the IPv6 bits, even if we
received IPv6 settings later on when querying for them. Change that,
so that if an IP address of a given type is received, we assume the
corresponding context was really activated even if the modem didn't
report it in the connect set response.
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/320
This setting is unused since some releases ago, and the corresponding
libmm-glib methods were already flagged as deprecated. Let's add an
explicit mention to this deprecation on the DBus API itself.