aboutsummaryrefslogtreecommitdiff
path: root/plugins/cinterion/mm-modem-helpers-cinterion.c
AgeCommit message (Collapse)Author
2023-01-03build: move plugins directory to src/pluginsAleksander Morgado
We are going to allow including the plugin sources built within the ModemManager daemon binary; moving the sources within the daemon sources directory makes it easier.
2022-09-28cinterion: add support for mode setting using SXRATChristian Taedcke
The previously used COPS command to set to LTE-only mode did not work for an ELS81 modem. Now ^SXRAT is used to switch modes instead of COPS, if SXRAT is supported by the modem.
2022-09-05modem-helpers-cinterion: rework CNMI test response parserAleksander Morgado
We setup all output variables with g_autoptr() and then use g_steal_pointer() to return the needed ones.
2022-09-05core: port GRegex/GMatchInfo to use autoptr()Aleksander Morgado
The behavior of GRegex changed in 2.73.2 once it was ported from pcre1 to pcre2. In some cases it was made more strict, which is fine, in other cases it exposed some change in how it behaves on certain matches that is not extremely clear whether it's ok or not. See https://gitlab.gnome.org/GNOME/glib/-/issues/2729 See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601 See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/621 Either way, one thing that was assumed was that initializing all GRegex/GMatchInfo variables to NULL and making sure they're NULL before they're initialized by glib (especially the GMatchInfo) was a good and safer approach. So, whenever possible, g_autoptr() is used to cleanup the allocated GMatchInfo/GRegex variables, and otherwise, g_clear_pointer() is used to ensure that no free/unref is attempted unless the given variable is not NULL, and also so that the variable is reseted to NULL after being disposed.
2022-04-08sms: prevent crash if date is out of rangeCarlo Lobrano
g_date_time_new, and g_date_time_new_utc return NULL if inputs are out of range, and currently mm_new_iso8601_time passes the GDateTime created by those two functions to date_time_format_iso8601 without checking for NULL values, causing a g_date_time_format_iso8601 crash if PDU data is corrupted with wrong date. To prevent this, mm_new_iso8601_time now can return NULL and set a new GError if GDateTime created by g_date_time_new is NULL. Fixes #546
2021-10-22cli, plugins: factorize usage of iso8601 datetime formatFrederic Martinsons
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com> Includes updates by Aleksander Morgado to fix coding style issues.
2021-05-27cinterion: avoid maybe-uninitialized warning by GCC 10Felipe Borges
Reported at https://gitlab.gnome.org/GNOME/gnome-control-center/-/issues/1371
2021-03-21cinterion: make sure FALSE sets GError in parse_smong_response()Aleksander Morgado
The g_regex_match_full() method may return FALSE without setting the GError, so that case needs to be considered. In addition to that, the following g_assert() was not doing what it should have been, as it was comparing the address of the variable and not the variable itself; rework the code to avoid that as well: g_assert (access_tech != MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN);
2021-03-21cinterion: make sure FALSE sets GError in provcfg_response_to_cid()Aleksander Morgado
The g_regex_match_full() method may return FALSE without setting the GError, so that case needs to be considered. Reported by Jan Mazura. Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347
2021-03-21cinterion: allow '*' in Prov/Cfg responseAleksander Morgado
E.g. in a Cinterion PLS8-E (REVISION 04.004) to match the following line: ^SCFG: "MEopMode/Prov/Cfg","fallback*" Fix suggested by Jan Mazura. See https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/347
2021-02-23cinterion: rework mno decoding to use str_to_utf8()Aleksander Morgado
2021-02-23cinterion: rework band encoding to use str_to_utf8()Aleksander Morgado
Also providing support to report errors when attempting to decode the strings.
2021-02-03cinterion: remove unused variablesAndrew Lassalle
2020-11-04cinterion: load initial EPS bearer cid only onceAleksander Morgado
There is no need to reload it on every settings update attempt; just load it once when the 3GPP interface is initialized, and re-use the loaded value on every new update attempt.
2020-11-04cinterion: setup SGAUTH response parser as a helper methodAleksander Morgado
2020-11-04cinterion: move auth helpers to the helpers sourcesAleksander Morgado
2020-08-11cinterion: setup initial LTE parametersGiacinto Cifelli
2020-07-26cinterion: radio/band single scfg line: no varianceGiacinto Cifelli
the AT^SCFG="Radio/Band" command does not return a different answer for different charsets. This code was working previously because the charset was left to default (GSM) at the time of this operation, and therefore the string was unchanged anyway.
2020-05-26cinterion: simplify checkGiacinto Cifelli
no longer need to check the charset because of the fix in charsets, that now accepts GSM and UCS2.
2020-05-26cinterion: minor coding style fixes in new band managementAleksander Morgado
2020-05-26cinterion: radio/band handling for LTE modemsGiacinto Cifelli
2020-05-26Revert "charsets: don't warn in unlikely case of needing to convert to HEX ↵Aleksander Morgado
from UTF-8" This reverts commit 6a7dd87f30b2cc1b459abab38a0805aa8ba1bfbc. Reverting because the merge request was set to squash all together....
2020-05-26charsets: don't warn in unlikely case of needing to convert to HEX from UTF-8Giacinto Cifelli
This would really be an implementation detail, not a real use case. Just don't warn in this case, as in the conversion in the opposite direction.
2020-05-19cinterion,helpers: minor coding style fixAleksander Morgado
2020-05-19cinterion,helpers: avoid cast-align errorsAleksander Morgado
We can safely cast the data in a GArray to gpointer first, and then to the pointer type we require. cinterion/mm-modem-helpers-cinterion.c: In function 'mm_cinterion_build_band': cinterion/mm-modem-helpers-cinterion.c:409:54: error: cast increases required alignment of target type [-Werror=cast-align] bands_string = mm_common_build_bands_string ((MMModemBand *)bands->data, bands->len); ^
2020-05-15plugins/cinterion: added Signal interfaceGiacinto Cifelli
Not all Cinterion modems support AT+CESQ. However a much larger group of them support AT^SMONI This commit uses the latter instead of the default former.
2020-04-08cinterion: port to use object loggingAleksander Morgado
2019-07-12voice,call,cinterion: add Purism as copyright holderAleksander Morgado
The GSM supplementary services related changes, as well as the rework done to manage calls per call id, is copyrighted by Purism SPC.
2019-07-11cinterion: new +CTZU URC parserAleksander Morgado
2019-07-11cinterion: support ^SLCC URCs as part of voice managementAleksander Morgado
This command will give us URCs whenever the extended list of current calls changes, which includes information about the actual state of each call, even for calls in waiting state. Therefore, as this is a URC that applies to all calls, it's enabled and disabled as part of the modem voice interface, instead of doing it as part of the call object itself (i.e. not treated as an in-call URC).
2019-07-10misc: use g_regex_match() for simplicityBen Chan
This CL converts a few g_regex_match_full() expressions to their equivalent g_regex_match() in order to simplify the code, i.e. g_regex_match_full (regex, str, strlen (str), 0, 0, &match_info, NULL) is equivalent to: g_regex_match_full (regex, str, -1, 0, 0, &match_info, NULL) or simply: g_regex_match (regex, str, 0, &match_info)
2018-10-18core: remove unnecessary NULL checks for g_match_info_free()Ben Chan
g_match_info_free() already check if the given pointer is NULL and does nothing on a NULL pointer.
2018-07-30mm-modem-helpers-cinterion: update band table for PLS8-JReinhard Speyerer
The default AT^SCFG="Radio/Band" value for Cinterion PLS8-J devices is "16819472". Add UMTS band 19 and LTE band 19 entries based on the information given in the PLS8 datasheet.
2018-07-27mm-modem-helpers-cinterion: update freq/band tablemstanger
This info comes from PLS8-X/E/J/V/US, HC25 & PHS8 references, the last two can be found publicly via Google search. Swapped bit-mask locations for G850 & PCS bands as they may have changed with FW or where accidently put in the wrong place. Updated many 3G & 4G bit-mask fields.
2017-09-07cinterion: update frequency bands supportAleksander Morgado
Updated to use the non-deprecated MMModemBand values.
2017-06-06cinterion: use ^SIND unsolicited messages for access tech reportingAleksander Morgado
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-03-07cinterion: improve ^SCFG=? response parser to handle EHS5 formatAleksander Morgado
Two main changes in the regex: * Ignore double quotes around interval numbers. * Ignore second set of values (i.e. the one after the comma), as it may not even be given). We now support at least these two formats: ^SCFG: "Radio/Band",("1-511","0-1") ^SCFG: "Radio/Band\",("1"-"147") Reported-by: Colin Helliwell <colin.helliwell@ln-systems.com>
2017-02-16cinterion: improve ^SMONG response parser:Aleksander Morgado
* Allow whitespaces prefixing the values row. * Allow more than one \r\n between the title and the table header. Reported-by: Colin Helliwell <colin.helliwell@ln-systems.com>
2017-02-13cinterion: support number ranges in CNMI=? parserAleksander Morgado
https://lists.freedesktop.org/archives/modemmanager-devel/2017-February/003911.html
2017-01-04cinterion: implement connection status monitoring via ^SWWAN?Aleksander Morgado
And consolidate the connection status checks done during connection and disconnection so that we re-use the same logic.
2017-01-04cinterion: simplify ^SWWAN response parsingAleksander Morgado
We get as input the ^SWWAN index we're interested in, and we loop through the list of ^SWWAN lines looking for the one we need. This updated helper method allows working with multi-line ^SWWAN responses, e.g. given when more than one PDP context is active.
2017-01-04cinterion: implement support for the new SWWAN interfaceMatthew Stanger
2014-06-25cinterion: new 'AT+CNMI=?' parser helperAleksander Morgado
2014-03-03cinterion: after SIM unlock, query SIM status until readyAleksander Morgado
2014-02-28cinterion: consolidate setting current bands in 2G and 3G devicesAleksander Morgado
2014-02-28cinterion: consolidate current bands loading for 2G and 3G devicesAleksander Morgado
2014-02-28cinterion: consolidate supported bands loading for 2G and 3G devicesAleksander Morgado
2014-02-28cinterion: add helper to build Cinterion band maskAleksander Morgado
2014-02-28cinterion: add helper to parse AT^SCFG="Radio/Band" response in 3G devicesAleksander Morgado
2014-02-28cinterion: use AT^SCFG=? to parse supported bands in 3G devicesAleksander Morgado