Commit Graph
53 Commits
Author SHA1 Message Date
Guido Günther 5a3b810bc9 polkit,conf: Add missing Cell Broadcast methods
Fixes 62f7b76e8 ("cbm: Add CellBroadcast interface")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-23 14:15:14 -05:00
Guido Günther 3d3182534e pollkit,cell-broadcast: Use more specific error message
Text messages could also be SMS

Fixes 1fb74f266 ("data: Add a policy rule to access the cellbroadcast API")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-22 23:17:47 +02:00
Guido Günther c04f178dda build: Allow to use libqmi as subproject
This makes it simpler to build ModemManager git

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-22 08:20:19 -05:00
Guido Günther 9cb5a2d090 build: Allow to use libmbim as subproject
This makes it simpler to build ModemManager git

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-22 08:20:19 -05:00
Guido Günther 382c3e114c base-cbm: Install properties one by one
`g_object_class_install_property` picks up `PROP_BIND_TO` resulting in a
crash on the first CBM received.

Fixes: ec5104c9a ("Move log parent and connection property binding to helper")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-22 08:09:56 -05:00
Guido Günther 0ccc3fbeec broadband-modem-qmi/cellbroadcast: Allow for G_MAXUINT16
It's a valid channel value. Since start and end are guint16 we can drop
the check altogether.

Fixes: e25dd7db9 ("broadband-modem-qmi: Add support for loading channels")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-20 13:51:54 +02:00
Guido Günther f17430b662 broadband-modem-qmi/cellbroadcast: Return on failure
Return after setting the error

Fixes: e25dd7db9 ("broadband-modem-qmi: Add support for loading channels")

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-20 10:39:15 +02:00
Guido Günther 219e8eb103 broadband-modem-qmi: Enable Cell Broadcast
For QMI we have an extra QMI request so use that to make sure receiving
messages is actually enabled.

Closes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1325
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-13 05:01:32 +00:00
Guido Günther e25dd7db97 broadband-modem-qmi: Add support for loading channels
This allows to retrive the list of configured Cell Broadcast channels.

Closes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1325
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-13 05:01:32 +00:00
Guido Günther 1ea564f5e8 broadband-modem-qmi: Add support for setting channels
This allows to receive Cell Broadcast messages in the specified channel
range on SDM670 based devices (X12 modem) and SDM845 (X20 modem) without
any AT ports (like the OnePlus 6/6T and Google Pixel 3a).

Helps: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1325
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-13 05:01:32 +00:00
Guido Günther 9c5f5833e5 broadband-modem-qmi: Add initial interface bits
This allows to receive Cell Broadcast messages.

Tested with single part CBMs only as my setup currently only allows for
these.

Helps: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/merge_requests/1325
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-13 05:01:32 +00:00
Guido Günther bf8bd7c4ad ci: Build full libqmi
The basic collection is not enough for MM

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-13 05:01:32 +00:00
Guido Günther 3504a438c2 ci: Move variables to common-variables
This makes it a bit more obvious where the vars are available.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-04-13 05:01:32 +00:00
Guido Günther 51dd726018 man: Add cell broadcast options
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther 32e5693e75 mmcli/cell-broadcast: Allow to set channel list
Allows to set the channel list like:

   mmcli -m any  --cell-broadcast-set-channels=0-9999,4353

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther 2364a02d72 mmcli/cell-broadcast: Add status output
This allows to get the current channel list:

$ mmcli -m any  --cell-broadcast-status
  --------------------------
  Cell Broadcast | channels: 0-9999,4353
2025-03-29 22:19:17 +00:00
Guido Günther 577639659c libmm-glib,cell-broadcast: Add setters for channel list
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther d6367c76c0 libmm-glib,cell-broadcast: Support channels property
Support reading channels in the API too

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther 4414344d82 libmm-glib,helpers: Add helpers to parse CB channels in and out of strings
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther d00ff2d0a1 libmm-glib,test: Remove trailing whitespace
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-29 22:19:17 +00:00
Guido Günther b83df955fa modem: Load current channels on startup
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-28 20:53:52 +00:00
Guido Günther 2878833f5c modem: Allow to set current channel list
This adds support for setting the channels to override the boot up modem
defaults:

```
  busctl --system call org.freedesktop.ModemManager1 /org/freedesktop/ModemManager1/Modem/0 org.freedesktop.ModemManager1.Modem.CellBroadcast SetChannels 'a(uu)' 1 0 9999
  busctl --system get-property org.freedesktop.ModemManager1 /org/freedesktop/ModemManager1/Modem/0 org.freedesktop.ModemManager1.Modem.CellBroadcast Channels
  a(uu) 1 0 9999
```

Closes: https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/issues/934

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-28 20:53:52 +00:00
Guido Günther d8135be6e2 modem-helpers: Add helpers to parse channel lists
`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>
2025-03-28 20:53:52 +00:00
Guido Günther 0c20d13b30 libmm-glib,helpers: Add helpers for CellBroadcast channel lists
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-28 20:53:52 +00:00
Guido Günther 68933455df treewide: Fix typos
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-11 23:15:57 +01:00
Guido Günther 54dcc25d8b treewide: Fix some spelling errors
All in debug messages or code comments so not user / client visible.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-05 16:53:26 +00:00
Guido Günther db37e063f8 mbim: Fix typo in error message
Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-03-05 16:53:26 +00: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
Guido Günther f24d8279bc docs: mm_modem_get_sim is async
Signed-off-by: Guido Günther <guido.gunther@puri.sm>
2018-08-27 10:55:19 -05:00
Guido Günther c5cfa2cad1 broadband-modem-qmi: Fix compilation error due to removed variable
otherwise we fail with:

CC       ModemManager-mm-broadband-modem-qmi.o
mm-broadband-modem-qmi.c: In function ‘process_gsm_info’:
mm-broadband-modem-qmi.c:4182:18: error: ‘egprs_support_valid’ undeclared (first use in this function)
                 &egprs_support_valid,  &egprs_support,
                  ^
mm-broadband-modem-qmi.c:4182:18: note: each undeclared identifier is reported only once for each function it appears in
mm-broadband-modem-qmi.c:4182:40: error: ‘egprs_support’ undeclared (first use in this function)
                 &egprs_support_valid,  &egprs_support,
2014-01-26 20:05:50 +01:00
Guido Günther 3c2800f02e broadband-modem-qmi: Fix compilation error due to variable type change
otherwise we fail with:

CC       ModemManager-mm-broadband-modem-qmi.o
mm-broadband-modem-qmi.c: In function ‘get_signal_info_ready’:
mm-broadband-modem-qmi.c:2309:5: error: passing argument 3 of ‘signal_info_get_quality’ from incompatible pointer type [-Werror]
     if (!signal_info_get_quality (ctx->self, output, &quality)) {
     ^
mm-broadband-modem-qmi.c:2236:1: note: expected ‘gint8 *’ but argument is of type ‘guint *’
 signal_info_get_quality (MMBroadbandModemQmi *self,
 ^
cc1: all warnings being treated as errors
2014-01-26 20:05:31 +01:00
Guido Günther 983c197c6b broadband-modem-qmi: Fix compilation error due to variable name change
otherwise we fail with:

CC       ModemManager-mm-broadband-modem-qmi.o
mm-broadband-modem-qmi.c: In function ‘modem_load_current_bands’:
mm-broadband-modem-qmi.c:1881:35: error: ‘ctx’ undeclared (first use in this function)
     if (qmi_client_check_version (ctx->client, 1, 19)) {
                                   ^
mm-broadband-modem-qmi.c:1881:35: note: each undeclared identifier is reported only once for each function it appears in
2014-01-26 20:05:01 +01:00
Guido Günther a57618b091 zte: skip hex encoding (bgo #652682) 2011-07-21 15:16:44 -05:00
Guido Günther 70715c1c12 huawei: implement ussd encoding/decoding
Huawei wants the USSD as packed GSM.
2011-07-21 15:16:44 -05:00
Guido Günther b82cec8c7e ussd: Add mm_modem_gsm_ussd_{de,en}code to the MMModemGsmUssd interface
since some some modems need different quirks to encode/decode USSD
messages.
2011-07-21 15:16:44 -05:00
Guido Günther 94e717b854 test: improve ussd.py help message 2011-07-21 15:16:44 -05:00
Guido Günther 26e7b3f8ce trivial: update .gitignore 2011-07-21 15:16:44 -05:00
Guido Günther 7613b46b50 test: handle cancel and distinguish between initiate and respond (bgo #638038) 2011-01-14 12:56:52 -06:00
Guido Günther d44ae44558 gsm: wire up USSD Respond function (bgo #638038) 2011-01-14 12:25:05 -06:00
Guido Günther 807120996f api: add reply parameter to USSD Respond method (bgo #638038)
The network will usually send back the new sub menu to pick from.
2011-01-14 12:23:21 -06:00
Guido Günther 3c13d9aec8 gsm: add preliminary USSD support (bgo #590798)
We currently convert to and from the modem's set charset and always pass
'15' as the data coding scheme. Passing the correct data coding scheme
as third argument to CUSD only upsets the network. This contradicts 3GPP
TS 23.038. Other tools like gsm-ussd handle it the same way.

Network responses that require further actions are not yet implemented.

(some fixes and cleanups by Dan Williams)
2010-11-05 14:50:50 -05:00