Commit Graph
9110 Commits
Author SHA1 Message Date
Dan Williams c320e50753 examples: add sms-watch-python
Add an example that watches for and prints all SMS messages of
all modems.

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-02-17 21:57:33 +00:00
Aleksander Morgado bc7198df8a Merge request !1289 from 'piotrdrag/pl-update-250209'
po: update Polish translation 250209

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1289
2025-02-17 21:46:11 +00:00
Piotr Drąg 5bf0851e50 po: update Polish translation 2025-02-09 15:04:01 +01:00
Dan Williams 6aac8d4201 Merge request !1286 from 'aleksander/fix-assert'
broadband-modem: exit with error if enable() while in unknown state

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1286
2025-02-06 02:42:31 +00:00
Aleksander Morgado ef5fe9b8d5 broadband-modem: prefer explicit return to break
Just to make it explicit that there is no more logic running
afterwards.
2025-02-03 10:21:32 +00:00
Aleksander Morgado 4ce23a9ebd broadband-modem: exit with error if enable() while in unknown state
We should not assert if the modem is flagged as invalid but an
outstanding enabling request is processed. Let's exit gracefully and
let the object get properly disposed afterwards.

   (libc.so.6 - pthread_kill.c: 44)         __pthread_kill_implementation
   (libc.so.6 - raise.c: 26)    raise
   (libc.so.6 - abort.c: 79)    abort
   (libglib-2.0.so.0 - gtestutils.c: 3450)  g_assertion_message
   (libglib-2.0.so.0 - gtestutils.c: 3476)  g_assertion_message_expr
   (ModemManager - mm-broadband-modem.c)    enable
   (ModemManager - mm-iface-modem.c: 2340)  handle_enable_auth_ready
   (libgio-2.0.so.0 - gtask.c: 1309)        g_task_return_now
   (libgio-2.0.so.0 - gtask.c: 1378)        g_task_return
   (ModemManager - mm-base-modem.c: 2011)   lock_after_authorize_ready
   (libgio-2.0.so.0 - gtask.c: 1309)        g_task_return_now
   (libgio-2.0.so.0 - gtask.c: 1378)        g_task_return
   (ModemManager - mm-base-modem.c: 1841)   base_modem_operation_run
   (ModemManager - mm-base-modem.c: 764)    state_operation_ready
   (libgio-2.0.so.0 - gtask.c: 1309)        g_task_return_now
   (libgio-2.0.so.0 - gtask.c: 1323)        complete_in_idle_cb
   (libglib-2.0.so.0 - gmain.c: 3460)       g_main_dispatch
   (libglib-2.0.so.0 - gmain.c: 4200)       g_main_context_dispatch
   (libglib-2.0.so.0 - gmain.c: 4276)       g_main_context_iterate
   (libglib-2.0.so.0 - gmain.c: 4479)       g_main_loop_run
   (ModemManager - main.c: 236) main
   (libc.so.6 - libc_start_call_main.h: 58) __libc_start_call_main
   (libc.so.6 - libc-start.c: 360)          __libc_start_main_impl
   (ModemManager + 0x000b8850)              _start
2025-02-03 10:18:19 +00:00
Dan Williams 0743d88d42 Merge request !1285 from 'dp/fix-err-init'
shared-telit: fix missing error initialization in load_revision_ready

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1285

Closes #953
2025-01-31 15:47:32 +00:00
Daniele Palmas f6c0917a65 shared-telit: fix missing error initialization in load_revision_ready
Closes #953
2025-01-31 16:37:53 +01:00
Dan Williams a5332d260c Merge request !1260 from 'main'
broadband-modem-qmi: retry when "Get Serving System" fails

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1260

Closes #667
2025-01-23 02:58:59 +00:00
Valentin Blot 59d7be3658 broadband-modem-qmi: separate "system info" and "serving system" indications registration
Some modems succeed on enabling "system info" and disabling "serving system" in one
transaction, even though they don't support "system info". This commit separates the
two: first, try to enable "system info", and if it succeeds then disable "serving system".
2025-01-23 02:54:36 +00:00
Dan Williams 35c0556f73 Merge request !1282 from 'fix-its-location'
Specify a path to the ITS rules

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1282
2025-01-23 02:50:04 +00:00
Yegor Yefremov 907f7a2813 Specify a path to the ITS rules
Use our own ITS rules found under data/its. This resolves a
configuration breakage on some systems:

msgfmt: cannot locate ITS rules for data/org.freedesktop.ModemManager1.policy.in

According to the msgfmt manual, we need to specify a path to the parent
directory containing its folder. Hence, we add a path to data as the
data_dirs option.
2025-01-23 02:36:31 +00:00
Dan Williams 4e31b7fdda Merge request !1274 from 'resume-inhibitor-crash'
suspend: support logind not sending PrepareForSleep(true)

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1274

Closes #949
2025-01-23 02:35:44 +00:00
Arnav Singh 5eb8203f8e suspend: support logind not sending PrepareForSleep(true)
elogind sends PrepareForSleep(false) when resuming but doesn't necessarily
send PrepareForSleep(true) when sleeping. This means we didn't necessarily
drop our previous inhibitor when it's time to take a new one. So instead of
asserting that we dropped our previous inhibitor, just reuse it.
2025-01-22 08:42:02 -08:00
Dan Williams 18f6190ff2 Merge request !1283 from 'mm-sim-validate-fix-gsize-format'
modem-helpers: fix gsize format

https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1283

See merge request mobile-broadband/ModemManager!1283
2025-01-22 15:50:50 +00:00
Lukas Voegl 42262a5827 modem-helpers: fix gsize format 2025-01-17 14:50:28 +01:00
Rafael Fontenelle 90c07311a0 po: Update Brazilian Portuguese translation 2025-01-14 01:05:45 +00:00
Dan Williams b178d46265 cli: set higher 3GPP Scan(), Register(), and Connect() method timeouts
Similar to voice call mmcli timeouts, set larger proxy-wide timeouts for
long-running operations. Match these timeouts with the internal ModemManager
timeouts for the AT/MBIM/QMI operation timeouts.

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

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2025-01-11 20:53:15 -06:00
Dan Williams 60de5751b4 port-probe: add some QCDM/DIAG response bytes to non-AT responses
Seen on a Qualcomm-based Quectel EG915Q on the diag port:

ModemManager[34547]: <dbg> [1732077670.330527] [ttyUSB0/at] <-- ' \0\0\0\8\0\0\0\2\0\0\0\0`%\160$"\6\169\128\200\1\30\197\142\0G\184\225\128\0\1+\127\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254\255\255\255\255\255\255\255\254'

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-12-27 23:42:09 -06:00
Aleksander Morgado 377a124865 port-probe: explicit close port steps
If by any chance the same ports needs to go through AT and
QMI/MBIM probing, make sure the serial port created during
AT probing is closed before starting the QMI/MBIM probing.
2024-12-27 15:24:01 +00:00
Aleksander Morgado e2633b46f0 port-probe: only run custom init on ports that will go through AT probing 2024-12-27 15:24:01 +00:00
Aleksander Morgado 0744ebd1c0 port-probe: rename serial_probe->probe 2024-12-27 15:24:01 +00:00
Dan Williams 72e8ac2e80 port-serial: clean up whitespace formatting
Remove stray tabs.

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-12-23 01:06:53 -06:00
Aleksander Morgado 623e786f7c libmm-glib,unlock-retries: remove invalid 'closure' annotation
../libmm-glib/mm-unlock-retries.c:135: Warning: ModemManager:
  invalid "closure" annotation: only valid on callback parameters
2024-12-22 17:12:40 +01:00
Michal Mazur 66aa3d16e5 device,plugin: reset MMDevice's hotplugged after creating the modem
The hotplugged flag was added to simplify modem probe on first time it
is created. Before the re-probe it must be set to FALSE to destroy all
existing netlink interfaces and force full reconfiguration.
2024-12-19 09:42:26 +00:00
Mank Wang 1e865d76a8 Netprisma:Add support for more USB devices 2024-12-09 09:28:57 +08:00
Guido Günther eda130f3bf docs: Add Cbm And CellBroadcast 2024-12-01 21:41:10 +00:00
Guido Günther b491bc474e cli: Add support for listing and deleting Cell Broadcast messages
This adds

```
   $ mmcli -m 0 --cell-broadcast-list-cbm
       /org/freedesktop/ModemManager1/CBM/0 (received)
       /org/freedesktop/ModemManager1/CBM/0 (received)

   $ mmcli -m 0 --cell-broadcast-delete-cbm=0
   successfully deleted CBM from modem

   $ mmcli -m 0 --cbm 0
   --------------------------
   General    |         path: /org/freedesktop/ModemManager1/CBM/1
   --------------------------
   Content    |         text: This is a test of the Ontario Alert Ready System. There is no danger to your health or safety
   --------------------------
   Properties |       update: 0
              | message code: 0
```

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther 502e0c920f tests: Add cbm monitor
Listen for new CBMs and dump their content on the console.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther 0e4bc1b6ea api: Add Cell Broadcast support
Add access to the modem's CellBroadcast interface and to fetch
Cell Broadcast messages.

Closes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/253
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther 60357247eb broadband-modem: Add Cell Broadcast implementation
The CBMs are read via unsolicted events for which we register
an event handler.

We don't enable unsolicted events explicitly as this already happens
via the `+CNMI=*,*,2,*,*` whens setting up unsolicted events in
`modem_messaging_enable_unsolicited_events` (ETSI TS 127 005).
2024-12-01 21:41:10 +00:00
Guido Günther 62f7b76e8e cbm: Add CellBroadcast interface
This adds support for the Cell Broadcast interface allowing to
receive, list, read and delete Cell Broadcast messages via the
org.freedesktop.ModemManager1.Modem.CellBroadcast and
org.freedesktop.ModemManager1.Cbm interfaces.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther eedf78d662 part: fix indent 2024-12-01 21:41:10 +00:00
Guido Günther c69a64c0cb cbm: Add parsing bits for cell broadcast messages
This allows to parse the CBMs parameters like channel, part number and
message text. We parse uncompressed GSM7 and UCS2 encodings as
described in 3GPP TS 23.038.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther 8cb68e87d8 modem-helpers: Add regex to parse CBM out of the serial stream
This will allow us to fetch cell broadcast messages.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther 1fb74f266f data: Add a policy rule to access the cellbroadcast API
Allow access to cell broadcast functionality.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther a8c10c676e sms: Make sms_decode_text public
This can be used for cell broadcast messages as well

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther ce8989182c cli: Fix indent
We indent with one space after }

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Guido Günther e627062674 cli: Fix copy/paste error in comment
We check call caps not messaging caps

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2024-12-01 21:41:10 +00:00
Lorenzo Zolfanelli 2ca948f403 fcc-unlock: add fcc-unlock specs for new quectel variants
Add symlinks in `fcc-unlock.available.d` for new supported Quectel
variants:

- EM05-G: 2c7c:0313, 2c7c,0314

Fixes #858
2024-11-20 12:24:43 +00:00
Lukas Voegl 68e725d45e broadband-modem-cinterion: implement load_current_modes
Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2024-11-20 12:07:20 +00:00
Lukas Voegl 32435b430f broadband-modem-cinterion: never discard operator or mode
When setting an operator, AT+COPS overwrites the currently set allowed mode. Equally, the other way around, when setting the current mode, the configured operator is overwritten.

Signed-off-by: Lukas Voegl <lvoegl@tdt.de>
2024-11-20 12:07:20 +00:00
Aleksander Morgado 3de6cca46d broadband-modem-qmi: don't build operator id in network reject indication if it's unknown 2024-11-20 12:56:57 +01:00
Aleksander Morgado b2d52001e4 broadband-modem-qmi: avoid conditional jump due to uninitialized variable in network reject indications
==3851== Conditional jump or move depends on uninitialised value(s)
==3851==    at 0x23CF65: network_reject_indication_cb (mm-broadband-modem-qmi.c:5434)
==3851==    by 0x4D00865: g_cclosure_marshal_VOID__BOXEDv (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7200.4)
==3851==    by 0x4D196FF: g_signal_emit_valist (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7200.4)
==3851==    by 0x4D19862: g_signal_emit (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.7200.4)
==3851==    by 0x4F7C250: process_indication (qmi-nas.c:70290)
==3851==    by 0x4DFA6C4: __qmi_client_process_indication (qmi-client.c:172)
==3851==    by 0x4DFEE2D: process_indication_idle (qmi-device.c:1697)
==3851==    by 0x4A26C43: g_main_context_dispatch (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4)
==3851==    by 0x4A7C2B7: ??? (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4)
==3851==    by 0x4A262B2: g_main_loop_run (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7200.4)
==3851==    by 0x178042: main (main.c:236)

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/931
2024-11-20 12:56:48 +01:00
Dan Williams ed13e053cd port-probe: fix custom init probing not having open AT port
Referenced commit broke custom init flows because the AT port
was not opened when custom inits were run, which was the case
before the commit landed.

Rework probing flow to follow a step model like much of our
other code, and ensure that the AT port is opened as part
of the custom init flow.

Fixes: 7937a89a37 port-probe: rework and consolidate port probe flow for AT/QCDM/QMI/MBIM

Signed-off-by: Dan Williams <dan@ioncontrol.co>
2024-11-20 11:50:43 +00:00
Bolan Wang 1d43bb0dac plugin,mtk: workaround for invalid rssi threshold on FM350.
FM350 modems report an invalid rssi threshold (always 0) in the signal-state response message.
It results in signal quality not being updated. We can use this patch to workaround this bug.
2024-11-20 10:38:23 +00:00
Aleksander Morgado 87e1e8b2d4 shared-qmi: don't assume LOC assistance data servers is initialized once
0x00007bcb78abf8b4	(libglib-2.0.so.0 -gtestutils.c:3450)		??g_assertion_message
  0x00007bcb78abf928	(libglib-2.0.so.0 -gtestutils.c:3476)		??g_assertion_message_expr
  0x00005594f143b221	(ModemManager -mm-shared-qmi.c:6651)		loc_location_get_predicted_orbits_data_source_indication_cb
  0x00007bcb78866043	(libgobject-2.0.so.0 -gmarshal.c:1686)		??g_cclosure_marshal_VOID__BOXEDv
  0x00007bcb7886338b	(libgobject-2.0.so.0 -gclosure.c:895)		_g_closure_invoke_va
  0x00007bcb78878a10	(libgobject-2.0.so.0 -gsignal.c:3472)		??g_signal_emit_valist
  0x00007bcb78879486	(libgobject-2.0.so.0 -gsignal.c:3622)		??g_signal_emit
  0x00007bcb785acc70	(libqmi-glib.so.5 -qmi-loc.c:16976)		process_indication
  0x00007bcb78520ede	(libqmi-glib.so.5 -qmi-device.c:1697)		process_indication_idle
  0x00007bcb78a9b75c	(libglib-2.0.so.0 -gmain.c:3460)		??g_main_dispatch
  0x00007bcb78a9b75c	(libglib-2.0.so.0 -gmain.c:4200)		??g_main_context_dispatch
  0x00007bcb78a9ba81	(libglib-2.0.so.0 -gmain.c:4276)		g_main_context_iterate
  0x00007bcb78a9bcff	(libglib-2.0.so.0 -gmain.c:4479)		??g_main_loop_run
  0x00005594f13a7463	(ModemManager -main.c:236)		??main
  0x00007bcb7825c705	(libc.so.6 -libc_start_call_main.h:58)		??__libc_start_call_main
  0x00007bcb7825c7c1	(libc.so.6 -libc-start.c:360)		??__libc_start_main_impl
  0x00005594f13a6da0	(ModemManager + 0x000b5da0)		??_start
2024-11-12 18:21:25 +00:00
Daniele Palmas 3457df7df0 broadband-modem-telit: fix endless loop when enabling events in secondary port 2024-11-09 02:45:51 +00:00
Florian Eckert 33107894ee fibocom: add NL668-EAU to rules file
The NL668-EAU is a 4G, 3G, 2G CAT4 modem from fibocom.
https://www.fibocom.com/en/products/LTECat-NL668-EAU.html

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-11-08 09:05:09 +01:00
Florian Eckert cf2fd4d2e1 fibocom: add additional USB_VID for NL668-EAU
The NL668-EAU 4G, 3G, 2G CAT4 is a modem from fibocom and is using a diffrent
USB_VID for this modem. By adding the new USB_VID, the 'fibocom' plugin is
now responsible and not the 'generic' plugin.

Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2024-11-08 09:04:38 +01:00