Age | Commit message (Collapse) | Author |
|
Split into groups of non-pause characters and single pause characters
by themselves and return as an array of strings.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Unit test it better, plus remove code duplication in various plugins.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Fixes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/990
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Signed-off-by: Daniele Palmas <dnlplm@gmail.com>
|
|
Signed-off-by: Kirill Buksha <kirbuk200@gmail.com>
|
|
Add some test responses from the Quectel EG915Q and some other Quectel devices.
Then try to parse those responses.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Missing ! for strncmp() meant the test was backwards and would
erroneously report 1xRTT and EVDOr0 when those access technologies
were not in use.
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
`CSCB` has the form
```
CSCB: [0|1],"<channel-list>","<data-coding-scheme>"
```
If the first parameter is `0` this specifies the accepted types if `1`
it specifies rejected.
So far seen in the wild were CSCB strings with accepted types only and a
coding scheme of "" so this is what we handle for the moment.
Signed-off-by: Guido Günther <agx@sigxcpu.org>
|
|
|
|
Signed-off-by: Dan Williams <dan@ioncontrol.co>
|
|
Rework the AT string quote operation to build the output with the
GString helper, instead of manually calculating how many bytes we'll
need in the output. It just makes it clearer.
|
|
SIM A7600E-H sends only 3 parameters in CGDCONT read response (+CGDCONT: 1,"IP","nate.sktelecom.com").
The parsing regex requeres 4 parameters, so the response is not matched.
In addition fourth parameter is not used by parsing code.
|
|
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.
|
|
Looks like pcre2 (used since glib 2.73.2) requires EOLs to match if
G_REGEX_NEWLINE_CRLF is explicitly used. The tests are updated
accordingly, because the modem responses will anyway have the EOLs
as well.
See https://gitlab.gnome.org/GNOME/glib/-/issues/2729#note_1544130
Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/601
|
|
Including 5GNR network reporting (act=12)
https://forum.sierrawireless.com/t/5g-network-scan-with-the-em9191-operation-not-allowed/26374/9
|
|
The numeric fields in the +COPS=? response were relying on a very weak
parsing logic, assuming that they were single-digit numeric values and
not using the common string to integer conversion utilities.
This commit improves the conversion from the 3GPP/ETSI defined network
availability and access technology values to the MM defined ones,
providing enum-based matches even if the numeric values are the same.
The commit also fixes the parsing of access technology values > 10,
required to report 5G related values.
|
|
Signed-off-by: Frederic Martinsons <frederic.martinsons@sigfox.com>
Includes updates by Aleksander Morgado to fix coding style issues.
|
|
Calls in a CLCC response in data-only or fax-only mode
do not count as actuall calls.
|
|
|
|
Use mm_obj_warn() instead.
|
|
MNC digit count information is lost on conversion to integers. Make it
possible for the caller to get this information through a separate
boolean.
|
|
The new helpers allow converting a PDP context list returned from the
+CGDCONT? parser to a list of 3GPP profile objects.
The new mm_3gpp_profile_list_find_best() method is equivalent to the
mm_3gpp_select_best_cid() one, but using profile objects as
input/output instead of specific settings.
The unit tests that were testing mm_3gpp_select_best_cid() are also
converted to use mm_3gpp_profile_list_find_best().
|
|
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).
|
|
All BCD-encoded strings used by MM currently have the low nybble
of each byte come before the high nybble, but some strings (such
as the EID string returned by QMI Get Slot Status) are meant to
be read in order with the high nybble before the low one. As such,
extend mm_bcd_to_string to decode both.
|
|
|
|
|
|
The generic CREG parser is improved to also allow parsing +C5GREG
responses and URCs.
|
|
This fixes the s8500 wave unit test, which was incorrectly parsing the
Act field reported as 'B' as "GSM" (strtol(B)=0)
Also, given that the generic parsing methods are able to parse numbers
from quoted strings, this change allows us to remove the Thuraya
specific CREG matching that just took into consideration quoted
strings. The Thuraya unit tests are also fixed up to provide proper
testing of the logic.
|
|
We already support "SMS only" registration state.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
So that we can provide the specific object id in every log associated
to a given object.
|
|
test-modem-helpers.c: In function ‘test_cgev_indication’:
test-modem-helpers.c:2165:9: error: enumeration value ‘MM_3GPP_CGEV_UNKNOWN’ not handled in switch [-Werror=switch-enum]
2165 | switch (type) {
| ^~~~~~
cc1: all warnings being treated as errors
|
|
test-modem-helpers.c: In function ‘test_creg_match’:
test-modem-helpers.c:1127:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
1127 | for (i = 0; i < array->len; i++) {
| ^
|
|
test-modem-helpers.c: In function ‘test_cmgl_response_generic’:
test-modem-helpers.c:294:20: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
294 | .pdu = "07914306073011F00405812261F700003130916191314095C27"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
|
|
If the charset selected via CSCS is UCS2, the modem may decide to
return all the strings in the +COPS=? response in UCS2:
<debug> (ttyACM0): --> 'AT+COPS=?<CR>'
<debug> (ttyACM0): <-- '<CR><LF>+COPS: (2,"004D006F007600690073007400610072","004D006F007600690073007400610072","00320031003400300037",7)
<debug> Found network '00320031003400300037' ('004D006F007600690073007400610072','004D006F007600690073007400610072'); availability: current, access tech: lte
|
|
|
|
Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
|