aboutsummaryrefslogtreecommitdiff
path: root/plugins/cinterion/tests/test-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-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.
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-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
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-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: 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,tests: 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/tests/test-modem-helpers-cinterion.c: In function 'common_test_scfg': cinterion/tests/test-modem-helpers-cinterion.c:56:56: error: cast increases required alignment of target type [-Werror=cast-align] expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data, ^ cinterion/tests/test-modem-helpers-cinterion.c:58:47: error: cast increases required alignment of target type [-Werror=cast-align] bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data, ^ cinterion/tests/test-modem-helpers-cinterion.c: In function 'common_test_scfg_response': cinterion/tests/test-modem-helpers-cinterion.c:209:56: error: cast increases required alignment of target type [-Werror=cast-align] expected_bands_str = mm_common_build_bands_string ((const MMModemBand *)expected_bands->data, ^ cinterion/tests/test-modem-helpers-cinterion.c:211:47: error: cast increases required alignment of target type [-Werror=cast-align] bands_str = mm_common_build_bands_string ((const MMModemBand *)bands->data, ^
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-08log: common logging method definition for all testers and helpersAleksander Morgado
2020-04-08cinterion: port to use object loggingAleksander Morgado
2020-04-08log: new object logging supportAleksander Morgado
So that we can provide the specific object id in every log associated to a given object.
2020-01-31cinterion,helpers: fix warnings with -Wdiscarded-qualifiersAleksander Morgado
CC cinterion/tests/test_modem_helpers_cinterion-test-modem-helpers-cinterion.o cinterion/tests/test-modem-helpers-cinterion.c: In function ‘test_slcc_urc_single’: cinterion/tests/test-modem-helpers-cinterion.c:749:64: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 749 | { 1, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE, "123456789" } | ^~~~~~~~~~~ cinterion/tests/test-modem-helpers-cinterion.c: In function ‘test_slcc_urc_multiple’: cinterion/tests/test-modem-helpers-cinterion.c:764:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 764 | { 2, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE, "123456789" }, | ^~~~~~~~~~~ cinterion/tests/test-modem-helpers-cinterion.c:765:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 765 | { 3, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE, "987654321" }, | ^~~~~~~~~~~ cinterion/tests/test-modem-helpers-cinterion.c: In function ‘test_slcc_urc_complex’: cinterion/tests/test-modem-helpers-cinterion.c:781:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 781 | { 1, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE, "123456789" }, | ^~~~~~~~~~~ cinterion/tests/test-modem-helpers-cinterion.c:782:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers] 782 | { 2, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_WAITING, "987654321" }, |
2019-10-14tests: print MM logs only on verbose test modeAleksander Morgado
Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
2019-10-14tests: avoid g_print() and use g_debug() insteadAleksander Morgado
The debug-level logs won't be printed e.g. during 'make check', but will be included when running the tester manually.
2019-08-02cinterion: fix memory leak in common_test_ctzu_urc()Ben Chan
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).
2018-07-31cinterion: fix band related unit testsAleksander Morgado
The sort_band() method used in the tester was totally wrong, it was comparing the addresses of the variables instead of the MMModemBand values. Use the common mm_common_bands_garray_sort() instead, which works as expected.
2017-09-07cinterion: update frequency bands supportAleksander Morgado
Updated to use the non-deprecated MMModemBand values.
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-02-03glib: remove invocations of g_type_init()Ben Chan
g_type_init() has been deprecated (and also marked with the attribute 'deprecated') since glib 2.36 as the type system is automatically initialized. Since the minimum version of glib required by ModemManager is 2.36, calling g_type_init() isn't necessarily in the ModemManager code.
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-06-03cinterion: fix memory leaks in testsBen Chan
2014-03-03cinterion: after SIM unlock, query SIM status until readyAleksander 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 parse AT^SCFG="Radio/Band" response in 3G devicesAleksander Morgado
2014-02-28cinterion: use AT^SCFG=? to parse supported bands in 3G devicesAleksander Morgado