Commit Graph

8 Commits

Author SHA1 Message Date
Aleksander Morgado
f419f56628 build: drop autotools 2022-11-07 14:26:02 +00:00
Yegor Yefremov
cc07d21410 examples: network-scan: get rid of global variables
Move the code into the main() routine.
2021-02-24 14:59:48 +01:00
Yegor Yefremov
3a32409000 examples: network-scan: enable modem before the network scan
Otherwise we get the following exception:

Traceback (most recent call last):
  File "/root/network-scan-python", line 57, in <module>
    networks = modem3gpp.scan_sync()
gi.repository.GLib.Error: mm_core_error_quark: GDBus.Error:org.freedesktop.ModemManager1.Error.Core.WrongState: Cannot scan networks: not enabled yet (8)
2021-02-14 23:35:54 +01:00
Yegor Yefremov
c7d0defdde examples: network-scan: resolve PEP8 issues
Use autopep8 utility to resolve issues like spaces before brackets
and wrong hanging indentation.

Also treat objects like boolean variables to check whether they are
None or not.
2021-02-14 23:35:49 +01:00
Aleksander Morgado
12329ac788 examples,python: ignore scan operation in modems without 3GPP interface
Traceback (most recent call last):
    File "/home/aleksander/Development/foss/ModemManager/examples/network-scan-python/./network-scan-python", line 46, in <module>
      modem3gpp.set_default_timeout(300000)
  AttributeError: 'NoneType' object has no attribute 'set_default_timeout'
2021-02-13 11:24:24 +01:00
Yegor Yefremov
16d1cf3318 examples: rework imports
Remove unused imports and fix import sorting using isort utility.
2021-02-13 11:09:59 +01:00
Aleksander Morgado
fcbffbd123 libmm-glib,3gpp: make MMModem3gppNetwork a boxed type
So that bindings know how to free the list of structs.

This commit ends up triggering an API break in the bindings generated
via GObject introspection, because the methods to access the items of
a MMModem3gppNetwork are no longer treated as Modem3gpp class methods.

E.g. instead of:
  ModemManager.Modem3gpp.network_get_operator_code(network)
We should now do:
  network.get_operator_code()

There is no API break in libmm-glib.
2019-12-13 18:04:02 +01:00
Aleksander Morgado
248cd55f0e examples: new network-scan-python example
This is currently not working completely ok because python doesn't
know how to free the GList of MMModem3gppNetwork elements.

  /org/freedesktop/ModemManager1/Modem/1: starting network scan...
  21403: Orange - Orange (unknown, forbidden)
  21401: vodafone ES - vodafone ES (unknown, forbidden)
  21403: Orange - Orange (unknown, forbidden)
  21403: Orange - Orange (unknown, forbidden)
  21401: vodafone ES - vodafone ES (unknown, forbidden)
  21404: Yoigo - Yoigo (unknown, forbidden)
  21401: vodafone ES - vodafone ES (unknown, forbidden)
  21404: Yoigo - Yoigo (unknown, forbidden)
  21407: Movistar - Movistar (unknown, available)
  21407: Movistar - Movistar (unknown, available)
  21407: Movistar - Movistar (unknown, current)
  free(): invalid pointer
  Aborted
2019-12-13 17:36:06 +01:00