aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-modem-firmware.c
diff options
context:
space:
mode:
authorFlorian Eckert <fe@dev.tdt.de>2023-02-07 13:51:28 +0100
committerAleksander Morgado <aleksandermj@chromium.org>2023-02-17 10:15:36 +0000
commitc3365a36f0adf3dfce603dcd27c29efa85aad9ac (patch)
tree6d65fbbbd777d61e61b1e984eeec29c7d1843519 /cli/mmcli-modem-firmware.c
parent6f00fb867bdac03ea273a58e2d14ae85468e7857 (diff)
cli,output: print valid json for network scan result
A network scan with json output currently returns the following: root@G3-10940 ~ # mmcli -m 0 -J --3gpp-scan --timeout=300 | jq { "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" ] } } } This is a valid JSON, but in order to be able to access the individual data elements more easily, the line can also be dumped as a json object. The following commit converts the lines into a JSON obejct, so that it looks like this: root@G3-10940 ~ # mmcli -m 0 -J --3gpp-scan --timeout=300 | jq { "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" } ] } } } Signed-off-by: Florian Eckert <fe@dev.tdt.de>
Diffstat (limited to 'cli/mmcli-modem-firmware.c')
0 files changed, 0 insertions, 0 deletions