Why does the command mmcli 3gpp-scan not return object for scan-networks array
Eric Caruso
ejcaruso at chromium.org
Fri Feb 3 18:08:44 UTC 2023
Just adding a little clarification here,
On Fri, Feb 3, 2023 at 4:27 AM Aleksander Morgado
<aleksandermj at chromium.org> wrote:
>
> Hey,
>
> > I am currently evaluating the modemmanager in my Openwrt system.
> > If I now enter the following command `mmcli -m 0 -J --3gpp-scan
> > --timeout=300` to show the network providers in my environment,
> > I get the following json string:
> > ```
> > {
> > "modem":{
> > "3gpp":{
> > "scan-networks":[
> > "operator-code: 26201, operator-name: TDG,
> > access-technologies: lte, availability: forbidden","operator-code:
> > 26203, operator-name: o2 - de, access-technologies: lte, availability:
> > forbidden","operator-code: 26202, operator-name: vodafone.de,
> > access-technologies: lte, availability: current"
> > ]
> > }
> > }
> > }
> > ```
> >
> > I'm not sure if this is correct, but I would expect that several objects
> > appear under the `scan-networks` array, and not a string.
> > So I would expect that the output should look like this?
> >
> > ```
> > {
> > "modem":{
> > "3gpp":{
> > "scan-networks":[
> > {
> > "operator-code": "26201",
> > "operator-name: "TDG",
> > "access-technologies": "lte",
> > "availability": "forbidden"
> > },
> > {
> > "operator-code": "26203",
> > "operator-name": "o2 - de",
> > "access-technologies": "lte",
> > "availability": "forbidden"
> > },
> > {
> > "operator-code": "26202",
> > "operator-name": "vodafone.de",
> > "access-technologies": "lte",
> > "availability": "current"
> > }
> > ]
> > }
> > }
> > }
> > ```
mmcli is choosing to format each network as a single string. But the
D-Bus call itself returns aa{sv} (a list of dictionaries) as you are
expecting. The relevant code is in cli/mmcli-output.c if you want to
change how it is formatted.
> >
> > I am using the latest openwrt modemmanger from the master Branch 1.20.2
> > [1].
> >
> > Is this a bug?
> >
>
> Just not developed, patches welcome :D
>
> --
> Aleksander
Cheers,
-Eric
More information about the ModemManager-devel
mailing list