├── .gitignore ├── .gitlab-ci.yml ├── AUTHORS ├── COPYING ├── COPYING.LIB ├── Makefile.am ├── NEWS ├── README ├── TODO ├── autogen.sh ├── build-aux ├── Makefile.am ├── header-generator.xsl ├── mm-enums-template.c ├── mm-enums-template.h ├── mm-errors-quarks-template.c ├── mm-errors-template.c └── mm-errors-template.h ├── cli ├── Makefile.am ├── mmcli-bearer.c ├── mmcli-call.c ├── mmcli-common.c ├── mmcli-common.h ├── mmcli-completion ├── mmcli-manager.c ├── mmcli-modem-3gpp.c ├── mmcli-modem-cdma.c ├── mmcli-modem-firmware.c ├── mmcli-modem-location.c ├── mmcli-modem-messaging.c ├── mmcli-modem-oma.c ├── mmcli-modem-signal.c ├── mmcli-modem-simple.c ├── mmcli-modem-time.c ├── mmcli-modem-voice.c ├── mmcli-modem.c ├── mmcli-output.c ├── mmcli-output.h ├── mmcli-sim.c ├── mmcli-sms.c ├── mmcli.c └── mmcli.h ├── configure.ac ├── data ├── Makefile.am ├── ModemManager-icon.svg ├── ModemManager-interface-initialization-sequence-subclassed.dia ├── ModemManager-interface-initialization-sequence-subclassed.png ├── ModemManager-interface-initialization-sequence.dia ├── ModemManager-interface-initialization-sequence.png ├── ModemManager-logo-square.png ├── ModemManager-logo-square.svg ├── ModemManager-logo-wide-text.png ├── ModemManager-logo-wide-text.svg ├── ModemManager-logo-wide.png ├── ModemManager-logo-wide.svg ├── ModemManager-states.dia ├── ModemManager-states.png ├── ModemManager.pc.in ├── ModemManager.png ├── ModemManager.service.in ├── its │ ├── polkit.its │ └── polkit.loc ├── mm-glib.pc.in ├── org.freedesktop.ModemManager1.conf.nopolkit ├── org.freedesktop.ModemManager1.conf.polkit ├── org.freedesktop.ModemManager1.policy.in.in ├── org.freedesktop.ModemManager1.service.in ├── tests │ ├── Makefile.am │ └── org.freedesktop.ModemManager1.service.in └── valgrind.suppressions ├── decode ├── analyze.py ├── decode.py ├── defs.py ├── packet.py ├── qmiprotgen.py ├── qmiprotocol.py ├── qmux.py ├── wmc.py └── xml2ascii.py ├── docs ├── Makefile.am ├── man │ ├── Makefile.am │ ├── ModemManager.8 │ └── mmcli.1 └── reference │ ├── Makefile.am │ ├── api │ ├── Makefile.am │ ├── ModemManager-dbus-reference.xml │ ├── ModemManager-docs.xml │ ├── ModemManager-migration-reference.xml │ ├── ModemManager-overview.xml │ ├── ModemManager-sections.txt │ ├── ModemManager.types │ └── version.xml.in │ └── libmm-glib │ ├── Makefile.am │ ├── libmm-glib-docs.xml │ ├── libmm-glib-sections.txt │ └── version.xml.in ├── examples ├── Makefile.am ├── modem-watcher-javascript │ ├── Makefile.am │ ├── README │ ├── main.js │ ├── modem-watcher-javascript │ └── modemWatcher.js ├── modem-watcher-python │ ├── Makefile.am │ ├── ModemWatcher.py │ ├── README │ └── modem-watcher-python ├── network-scan-python │ ├── Makefile.am │ ├── README │ └── network-scan-python └── sms-python │ ├── Makefile.am │ ├── README │ └── sms-python ├── gtester.make ├── gtk-doc.make ├── include ├── Makefile.am ├── ModemManager-compat.h ├── ModemManager-enums.h ├── ModemManager-errors.h ├── ModemManager-tags.h ├── ModemManager-version.h.in └── ModemManager.h ├── introspection ├── Makefile.am ├── all.xml ├── org.freedesktop.ModemManager1.Bearer.xml ├── org.freedesktop.ModemManager1.Call.xml ├── org.freedesktop.ModemManager1.Modem.Firmware.xml ├── org.freedesktop.ModemManager1.Modem.Location.xml ├── org.freedesktop.ModemManager1.Modem.Messaging.xml ├── org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml ├── org.freedesktop.ModemManager1.Modem.Modem3gpp.xml ├── org.freedesktop.ModemManager1.Modem.ModemCdma.xml ├── org.freedesktop.ModemManager1.Modem.Oma.xml ├── org.freedesktop.ModemManager1.Modem.Signal.xml ├── org.freedesktop.ModemManager1.Modem.Simple.xml ├── org.freedesktop.ModemManager1.Modem.Time.xml ├── org.freedesktop.ModemManager1.Modem.Voice.xml ├── org.freedesktop.ModemManager1.Modem.xml ├── org.freedesktop.ModemManager1.Sim.xml ├── org.freedesktop.ModemManager1.Sms.xml ├── org.freedesktop.ModemManager1.xml ├── tests │ ├── Makefile.am │ └── org.freedesktop.ModemManager1.Test.xml └── wip-org.freedesktop.ModemManager1.Modem.Contacts.xml ├── libmm-glib ├── Makefile.am ├── generated │ ├── Makefile.am │ └── tests │ │ └── Makefile.am ├── libmm-glib.h ├── mm-bearer-ip-config.c ├── mm-bearer-ip-config.h ├── mm-bearer-properties.c ├── mm-bearer-properties.h ├── mm-bearer-stats.c ├── mm-bearer-stats.h ├── mm-bearer.c ├── mm-bearer.h ├── mm-call-audio-format.c ├── mm-call-audio-format.h ├── mm-call-properties.c ├── mm-call-properties.h ├── mm-call.c ├── mm-call.h ├── mm-cdma-manual-activation-properties.c ├── mm-cdma-manual-activation-properties.h ├── mm-common-helpers.c ├── mm-common-helpers.h ├── mm-firmware-properties.c ├── mm-firmware-properties.h ├── mm-firmware-update-settings.c ├── mm-firmware-update-settings.h ├── mm-helper-types.c ├── mm-helper-types.h ├── mm-helpers.h ├── mm-kernel-event-properties.c ├── mm-kernel-event-properties.h ├── mm-location-3gpp.c ├── mm-location-3gpp.h ├── mm-location-cdma-bs.c ├── mm-location-cdma-bs.h ├── mm-location-common.h ├── mm-location-gps-nmea.c ├── mm-location-gps-nmea.h ├── mm-location-gps-raw.c ├── mm-location-gps-raw.h ├── mm-manager.c ├── mm-manager.h ├── mm-modem-3gpp-ussd.c ├── mm-modem-3gpp-ussd.h ├── mm-modem-3gpp.c ├── mm-modem-3gpp.h ├── mm-modem-cdma.c ├── mm-modem-cdma.h ├── mm-modem-firmware.c ├── mm-modem-firmware.h ├── mm-modem-location.c ├── mm-modem-location.h ├── mm-modem-messaging.c ├── mm-modem-messaging.h ├── mm-modem-oma.c ├── mm-modem-oma.h ├── mm-modem-signal.c ├── mm-modem-signal.h ├── mm-modem-simple.c ├── mm-modem-simple.h ├── mm-modem-time.c ├── mm-modem-time.h ├── mm-modem-voice.c ├── mm-modem-voice.h ├── mm-modem.c ├── mm-modem.h ├── mm-network-timezone.c ├── mm-network-timezone.h ├── mm-object.c ├── mm-object.h ├── mm-pco.c ├── mm-pco.h ├── mm-signal.c ├── mm-signal.h ├── mm-sim.c ├── mm-sim.h ├── mm-simple-connect-properties.c ├── mm-simple-connect-properties.h ├── mm-simple-status.c ├── mm-simple-status.h ├── mm-sms-properties.c ├── mm-sms-properties.h ├── mm-sms.c ├── mm-sms.h ├── mm-unlock-retries.c ├── mm-unlock-retries.h └── tests │ ├── Makefile.am │ ├── test-common-helpers.c │ └── test-pco.c ├── libqcdm ├── AUTHORS ├── ChangeLog ├── Makefile.am ├── NEWS ├── README ├── autogen.sh ├── configure.ac ├── src │ ├── Makefile.am │ ├── com.c │ ├── com.h │ ├── commands.c │ ├── commands.h │ ├── dm-commands.h │ ├── errors.c │ ├── errors.h │ ├── log-items.h │ ├── logs.c │ ├── logs.h │ ├── nv-items.h │ ├── result-private.h │ ├── result.c │ ├── result.h │ ├── utils.c │ └── utils.h └── tests │ ├── Makefile.am │ ├── ipv6pref.c │ ├── modepref.c │ ├── reset.c │ ├── test-qcdm-com.c │ ├── test-qcdm-com.h │ ├── test-qcdm-crc.c │ ├── test-qcdm-crc.h │ ├── test-qcdm-escaping.c │ ├── test-qcdm-escaping.h │ ├── test-qcdm-result.c │ ├── test-qcdm-result.h │ ├── test-qcdm-utils.c │ ├── test-qcdm-utils.h │ └── test-qcdm.c ├── m4 ├── ax_code_coverage.m4 ├── gtk-doc.m4 ├── introspection.m4 ├── mm-enable-plugin.m4 └── vapigen.m4 ├── plugins ├── Makefile.am ├── README.txt ├── altair │ ├── mm-broadband-bearer-altair-lte.c │ ├── mm-broadband-bearer-altair-lte.h │ ├── mm-broadband-modem-altair-lte.c │ ├── mm-broadband-modem-altair-lte.h │ ├── mm-modem-helpers-altair-lte.c │ ├── mm-modem-helpers-altair-lte.h │ ├── mm-plugin-altair-lte.c │ ├── mm-plugin-altair-lte.h │ └── tests │ │ └── test-modem-helpers-altair-lte.c ├── anydata │ ├── mm-broadband-modem-anydata.c │ ├── mm-broadband-modem-anydata.h │ ├── mm-plugin-anydata.c │ └── mm-plugin-anydata.h ├── cinterion │ ├── 77-mm-cinterion-port-types.rules │ ├── mm-broadband-bearer-cinterion.c │ ├── mm-broadband-bearer-cinterion.h │ ├── mm-broadband-modem-cinterion.c │ ├── mm-broadband-modem-cinterion.h │ ├── mm-broadband-modem-qmi-cinterion.c │ ├── mm-broadband-modem-qmi-cinterion.h │ ├── mm-modem-helpers-cinterion.c │ ├── mm-modem-helpers-cinterion.h │ ├── mm-plugin-cinterion.c │ ├── mm-plugin-cinterion.h │ ├── mm-shared-cinterion.c │ ├── mm-shared-cinterion.h │ └── tests │ │ └── test-modem-helpers-cinterion.c ├── dell │ ├── 77-mm-dell-port-types.rules │ ├── mm-plugin-dell.c │ └── mm-plugin-dell.h ├── dlink │ ├── 77-mm-dlink-port-types.rules │ ├── mm-plugin-dlink.c │ └── mm-plugin-dlink.h ├── fibocom │ ├── 77-mm-fibocom-port-types.rules │ ├── mm-plugin-fibocom.c │ └── mm-plugin-fibocom.h ├── foxconn │ ├── 77-mm-foxconn-port-types.rules │ ├── mm-broadband-modem-foxconn-t77w968.c │ ├── mm-broadband-modem-foxconn-t77w968.h │ ├── mm-foxconn-t77w968-carrier-mapping.conf │ ├── mm-plugin-foxconn.c │ ├── mm-plugin-foxconn.h │ └── mm-shared.c ├── generic │ ├── mm-plugin-generic.c │ ├── mm-plugin-generic.h │ └── tests │ │ └── test-service-generic.c ├── haier │ ├── 77-mm-haier-port-types.rules │ ├── mm-plugin-haier.c │ └── mm-plugin-haier.h ├── huawei │ ├── 77-mm-huawei-net-port-types.rules │ ├── mm-broadband-bearer-huawei.c │ ├── mm-broadband-bearer-huawei.h │ ├── mm-broadband-modem-huawei.c │ ├── mm-broadband-modem-huawei.h │ ├── mm-modem-helpers-huawei.c │ ├── mm-modem-helpers-huawei.h │ ├── mm-plugin-huawei.c │ ├── mm-plugin-huawei.h │ ├── mm-sim-huawei.c │ ├── mm-sim-huawei.h │ └── tests │ │ └── test-modem-helpers-huawei.c ├── icera │ ├── mm-broadband-bearer-icera.c │ ├── mm-broadband-bearer-icera.h │ ├── mm-broadband-modem-icera.c │ ├── mm-broadband-modem-icera.h │ ├── mm-modem-helpers-icera.c │ ├── mm-modem-helpers-icera.h │ ├── mm-shared.c │ └── tests │ │ └── test-modem-helpers-icera.c ├── iridium │ ├── mm-bearer-iridium.c │ ├── mm-bearer-iridium.h │ ├── mm-broadband-modem-iridium.c │ ├── mm-broadband-modem-iridium.h │ ├── mm-plugin-iridium.c │ ├── mm-plugin-iridium.h │ ├── mm-sim-iridium.c │ └── mm-sim-iridium.h ├── linktop │ ├── mm-broadband-modem-linktop.c │ ├── mm-broadband-modem-linktop.h │ ├── mm-modem-helpers-linktop.c │ ├── mm-modem-helpers-linktop.h │ ├── mm-plugin-linktop.c │ ├── mm-plugin-linktop.h │ └── tests │ │ └── test-modem-helpers-linktop.c ├── longcheer │ ├── 77-mm-longcheer-port-types.rules │ ├── mm-broadband-modem-longcheer.c │ ├── mm-broadband-modem-longcheer.h │ ├── mm-plugin-longcheer.c │ └── mm-plugin-longcheer.h ├── mbm │ ├── 77-mm-ericsson-mbm.rules │ ├── mm-broadband-bearer-mbm.c │ ├── mm-broadband-bearer-mbm.h │ ├── mm-broadband-modem-mbm.c │ ├── mm-broadband-modem-mbm.h │ ├── mm-modem-helpers-mbm.c │ ├── mm-modem-helpers-mbm.h │ ├── mm-plugin-mbm.c │ ├── mm-plugin-mbm.h │ ├── mm-sim-mbm.c │ ├── mm-sim-mbm.h │ └── tests │ │ └── test-modem-helpers-mbm.c ├── motorola │ ├── mm-broadband-modem-motorola.c │ ├── mm-broadband-modem-motorola.h │ ├── mm-plugin-motorola.c │ └── mm-plugin-motorola.h ├── mtk │ ├── 77-mm-mtk-port-types.rules │ ├── mm-broadband-modem-mtk.c │ ├── mm-broadband-modem-mtk.h │ ├── mm-plugin-mtk.c │ └── mm-plugin-mtk.h ├── nokia │ ├── 77-mm-nokia-port-types.rules │ ├── mm-broadband-modem-nokia.c │ ├── mm-broadband-modem-nokia.h │ ├── mm-plugin-nokia-icera.c │ ├── mm-plugin-nokia-icera.h │ ├── mm-plugin-nokia.c │ ├── mm-plugin-nokia.h │ ├── mm-sim-nokia.c │ └── mm-sim-nokia.h ├── novatel │ ├── mm-broadband-bearer-novatel-lte.c │ ├── mm-broadband-bearer-novatel-lte.h │ ├── mm-broadband-modem-novatel-lte.c │ ├── mm-broadband-modem-novatel-lte.h │ ├── mm-broadband-modem-novatel.c │ ├── mm-broadband-modem-novatel.h │ ├── mm-common-novatel.c │ ├── mm-common-novatel.h │ ├── mm-plugin-novatel-lte.c │ ├── mm-plugin-novatel-lte.h │ ├── mm-plugin-novatel.c │ ├── mm-plugin-novatel.h │ ├── mm-shared.c │ ├── mm-sim-novatel-lte.c │ └── mm-sim-novatel-lte.h ├── option │ ├── mm-broadband-bearer-hso.c │ ├── mm-broadband-bearer-hso.h │ ├── mm-broadband-modem-hso.c │ ├── mm-broadband-modem-hso.h │ ├── mm-broadband-modem-option.c │ ├── mm-broadband-modem-option.h │ ├── mm-plugin-hso.c │ ├── mm-plugin-hso.h │ ├── mm-plugin-option.c │ ├── mm-plugin-option.h │ └── mm-shared.c ├── pantech │ ├── mm-broadband-modem-pantech.c │ ├── mm-broadband-modem-pantech.h │ ├── mm-plugin-pantech.c │ ├── mm-plugin-pantech.h │ ├── mm-sim-pantech.c │ └── mm-sim-pantech.h ├── quectel │ ├── 77-mm-quectel-port-types.rules │ ├── mm-broadband-modem-qmi-quectel.c │ ├── mm-broadband-modem-qmi-quectel.h │ ├── mm-broadband-modem-quectel.c │ ├── mm-broadband-modem-quectel.h │ ├── mm-plugin-quectel.c │ ├── mm-plugin-quectel.h │ ├── mm-shared-quectel.c │ └── mm-shared-quectel.h ├── samsung │ ├── mm-broadband-modem-samsung.c │ ├── mm-broadband-modem-samsung.h │ ├── mm-plugin-samsung.c │ └── mm-plugin-samsung.h ├── sierra │ ├── 77-mm-sierra.rules │ ├── mm-broadband-bearer-sierra.c │ ├── mm-broadband-bearer-sierra.h │ ├── mm-broadband-modem-sierra-icera.c │ ├── mm-broadband-modem-sierra-icera.h │ ├── mm-broadband-modem-sierra.c │ ├── mm-broadband-modem-sierra.h │ ├── mm-common-sierra.c │ ├── mm-common-sierra.h │ ├── mm-modem-helpers-sierra.c │ ├── mm-modem-helpers-sierra.h │ ├── mm-plugin-sierra-legacy.c │ ├── mm-plugin-sierra-legacy.h │ ├── mm-plugin-sierra.c │ ├── mm-plugin-sierra.h │ ├── mm-shared.c │ ├── mm-sim-sierra.c │ ├── mm-sim-sierra.h │ └── tests │ │ └── test-modem-helpers-sierra.c ├── simtech │ ├── 77-mm-simtech-port-types.rules │ ├── mm-broadband-modem-qmi-simtech.c │ ├── mm-broadband-modem-qmi-simtech.h │ ├── mm-broadband-modem-simtech.c │ ├── mm-broadband-modem-simtech.h │ ├── mm-modem-helpers-simtech.c │ ├── mm-modem-helpers-simtech.h │ ├── mm-plugin-simtech.c │ ├── mm-plugin-simtech.h │ ├── mm-shared-simtech.c │ ├── mm-shared-simtech.h │ └── tests │ │ └── test-modem-helpers-simtech.c ├── telit │ ├── 77-mm-telit-port-types.rules │ ├── mm-broadband-modem-mbim-telit.c │ ├── mm-broadband-modem-mbim-telit.h │ ├── mm-broadband-modem-telit.c │ ├── mm-broadband-modem-telit.h │ ├── mm-common-telit.c │ ├── mm-common-telit.h │ ├── mm-modem-helpers-telit.c │ ├── mm-modem-helpers-telit.h │ ├── mm-plugin-telit.c │ ├── mm-plugin-telit.h │ ├── mm-shared-telit.c │ ├── mm-shared-telit.h │ ├── mm-shared.c │ └── tests │ │ └── test-mm-modem-helpers-telit.c ├── tests │ ├── gsm-port.conf │ ├── test-fixture.c │ ├── test-fixture.h │ ├── test-helpers.c │ ├── test-helpers.h │ ├── test-keyfiles.c │ ├── test-port-context.c │ ├── test-port-context.h │ └── test-udev-rules.c ├── thuraya │ ├── mm-broadband-modem-thuraya.c │ ├── mm-broadband-modem-thuraya.h │ ├── mm-modem-helpers-thuraya.c │ ├── mm-modem-helpers-thuraya.h │ ├── mm-plugin-thuraya.c │ ├── mm-plugin-thuraya.h │ └── tests │ │ └── test-mm-modem-helpers-thuraya.c ├── tplink │ ├── 77-mm-tplink-port-types.rules │ ├── mm-plugin-tplink.c │ └── mm-plugin-tplink.h ├── ublox │ ├── 77-mm-ublox-port-types.rules │ ├── README │ ├── mm-broadband-bearer-ublox.c │ ├── mm-broadband-bearer-ublox.h │ ├── mm-broadband-modem-ublox.c │ ├── mm-broadband-modem-ublox.h │ ├── mm-modem-helpers-ublox.c │ ├── mm-modem-helpers-ublox.h │ ├── mm-plugin-ublox.c │ ├── mm-plugin-ublox.h │ ├── mm-sim-ublox.c │ ├── mm-sim-ublox.h │ └── tests │ │ └── test-modem-helpers-ublox.c ├── via │ ├── mm-broadband-modem-via.c │ ├── mm-broadband-modem-via.h │ ├── mm-plugin-via.c │ └── mm-plugin-via.h ├── wavecom │ ├── mm-broadband-modem-wavecom.c │ ├── mm-broadband-modem-wavecom.h │ ├── mm-plugin-wavecom.c │ └── mm-plugin-wavecom.h ├── x22x │ ├── 77-mm-x22x-port-types.rules │ ├── mm-broadband-modem-x22x.c │ ├── mm-broadband-modem-x22x.h │ ├── mm-plugin-x22x.c │ └── mm-plugin-x22x.h ├── xmm │ ├── mm-broadband-modem-mbim-xmm.c │ ├── mm-broadband-modem-mbim-xmm.h │ ├── mm-broadband-modem-xmm.c │ ├── mm-broadband-modem-xmm.h │ ├── mm-modem-helpers-xmm.c │ ├── mm-modem-helpers-xmm.h │ ├── mm-shared-xmm.c │ ├── mm-shared-xmm.h │ ├── mm-shared.c │ └── tests │ │ └── test-modem-helpers-xmm.c ├── xmm7360 │ ├── README.md │ ├── mm-bearer-xmm7360.c │ ├── mm-bearer-xmm7360.h │ ├── mm-broadband-modem-xmm7360.c │ ├── mm-broadband-modem-xmm7360.h │ ├── mm-plugin-xmm7360.c │ ├── mm-plugin-xmm7360.h │ ├── mm-xmm7360-rpc.c │ └── mm-xmm7360-rpc.h └── zte │ ├── 77-mm-zte-port-types.rules │ ├── mm-broadband-modem-zte-icera.c │ ├── mm-broadband-modem-zte-icera.h │ ├── mm-broadband-modem-zte.c │ ├── mm-broadband-modem-zte.h │ ├── mm-common-zte.c │ ├── mm-common-zte.h │ ├── mm-plugin-zte.c │ └── mm-plugin-zte.h ├── po ├── LINGUAS ├── Makevars ├── POTFILES.in ├── POTFILES.skip ├── cs.po ├── da.po ├── de.po ├── fr.po ├── fur.po ├── hu.po ├── id.po ├── it.po ├── lt.po ├── pl.po ├── pt_BR.po ├── sk.po ├── sv.po ├── tr.po ├── uk.po └── zh_CN.po ├── src ├── 77-mm-pcmcia-device-blacklist.rules ├── 77-mm-usb-device-blacklist.rules ├── 77-mm-usb-serial-adapters-greylist.rules ├── 80-mm-candidate.rules ├── Makefile.am ├── kerneldevice │ ├── mm-kernel-device-generic-rules.c │ ├── mm-kernel-device-generic-rules.h │ ├── mm-kernel-device-generic.c │ ├── mm-kernel-device-generic.h │ ├── mm-kernel-device-udev.c │ ├── mm-kernel-device-udev.h │ ├── mm-kernel-device.c │ └── mm-kernel-device.h ├── main.c ├── mm-auth-provider.c ├── mm-auth-provider.h ├── mm-base-bearer.c ├── mm-base-bearer.h ├── mm-base-call.c ├── mm-base-call.h ├── mm-base-manager.c ├── mm-base-manager.h ├── mm-base-modem-at.c ├── mm-base-modem-at.h ├── mm-base-modem.c ├── mm-base-modem.h ├── mm-base-sim.c ├── mm-base-sim.h ├── mm-base-sms.c ├── mm-base-sms.h ├── mm-bearer-list.c ├── mm-bearer-list.h ├── mm-bearer-mbim.c ├── mm-bearer-mbim.h ├── mm-bearer-qmi.c ├── mm-bearer-qmi.h ├── mm-broadband-bearer.c ├── mm-broadband-bearer.h ├── mm-broadband-modem-mbim.c ├── mm-broadband-modem-mbim.h ├── mm-broadband-modem-qmi.c ├── mm-broadband-modem-qmi.h ├── mm-broadband-modem.c ├── mm-broadband-modem.h ├── mm-call-list.c ├── mm-call-list.h ├── mm-charsets.c ├── mm-charsets.h ├── mm-context.c ├── mm-context.h ├── mm-device.c ├── mm-device.h ├── mm-error-helpers.c ├── mm-error-helpers.h ├── mm-filter.c ├── mm-filter.h ├── mm-iface-modem-3gpp-ussd.c ├── mm-iface-modem-3gpp-ussd.h ├── mm-iface-modem-3gpp.c ├── mm-iface-modem-3gpp.h ├── mm-iface-modem-cdma.c ├── mm-iface-modem-cdma.h ├── mm-iface-modem-firmware.c ├── mm-iface-modem-firmware.h ├── mm-iface-modem-location.c ├── mm-iface-modem-location.h ├── mm-iface-modem-messaging.c ├── mm-iface-modem-messaging.h ├── mm-iface-modem-oma.c ├── mm-iface-modem-oma.h ├── mm-iface-modem-signal.c ├── mm-iface-modem-signal.h ├── mm-iface-modem-simple.c ├── mm-iface-modem-simple.h ├── mm-iface-modem-time.c ├── mm-iface-modem-time.h ├── mm-iface-modem-voice.c ├── mm-iface-modem-voice.h ├── mm-iface-modem.c ├── mm-iface-modem.h ├── mm-log.c ├── mm-log.h ├── mm-modem-helpers-mbim.c ├── mm-modem-helpers-mbim.h ├── mm-modem-helpers-qmi.c ├── mm-modem-helpers-qmi.h ├── mm-modem-helpers.c ├── mm-modem-helpers.h ├── mm-plugin-manager.c ├── mm-plugin-manager.h ├── mm-plugin.c ├── mm-plugin.h ├── mm-port-mbim.c ├── mm-port-mbim.h ├── mm-port-probe-at.c ├── mm-port-probe-at.h ├── mm-port-probe.c ├── mm-port-probe.h ├── mm-port-qmi.c ├── mm-port-qmi.h ├── mm-port-serial-at.c ├── mm-port-serial-at.h ├── mm-port-serial-gps.c ├── mm-port-serial-gps.h ├── mm-port-serial-qcdm.c ├── mm-port-serial-qcdm.h ├── mm-port-serial.c ├── mm-port-serial.h ├── mm-port.c ├── mm-port.h ├── mm-private-boxed-types.c ├── mm-private-boxed-types.h ├── mm-serial-parsers.c ├── mm-serial-parsers.h ├── mm-shared-qmi.c ├── mm-shared-qmi.h ├── mm-shared.h ├── mm-sim-mbim.c ├── mm-sim-mbim.h ├── mm-sim-qmi.c ├── mm-sim-qmi.h ├── mm-sleep-monitor.c ├── mm-sleep-monitor.h ├── mm-sms-list.c ├── mm-sms-list.h ├── mm-sms-mbim.c ├── mm-sms-mbim.h ├── mm-sms-part-3gpp.c ├── mm-sms-part-3gpp.h ├── mm-sms-part-cdma.c ├── mm-sms-part-cdma.h ├── mm-sms-part.c ├── mm-sms-part.h ├── mm-sms-qmi.c ├── mm-sms-qmi.h ├── mm-utils.h └── tests │ ├── Makefile.am │ ├── test-at-serial-port.c │ ├── test-charsets.c │ ├── test-error-helpers.c │ ├── test-modem-helpers-qmi.c │ ├── test-modem-helpers.c │ ├── test-qcdm-serial-port.c │ ├── test-sms-part-3gpp.c │ ├── test-sms-part-cdma.c │ └── test-udev-rules.c ├── test ├── Makefile.am ├── lsudev.c ├── mmcli-test-sms ├── mmrules.c ├── mmsmsmonitor.c ├── mmsmspdu.c └── mmtty.c ├── vapi ├── Makefile.am ├── ModemManager-1.0.metadata └── libmm-glib.deps └── vl600 ├── atcom.py └── vl600.txt /Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = \ 3 | . \ 4 | build-aux \ 5 | po \ 6 | data \ 7 | include \ 8 | libqcdm \ 9 | libmm-glib \ 10 | src \ 11 | plugins \ 12 | cli \ 13 | vapi \ 14 | introspection \ 15 | test \ 16 | examples \ 17 | docs \ 18 | $(NULL) 19 | 20 | ChangeLog: 21 | $(AM_V_GEN) if test -d "$(srcdir)/.git"; then \ 22 | (GIT_DIR=$(top_srcdir)/.git $(top_srcdir)/missing --run git log --stat) | fmt --split-only > $@.tmp \ 23 | && mv -f $@.tmp $@ \ 24 | || ($(RM) $@.tmp; \ 25 | echo Failed to generate ChangeLog, your ChangeLog may be outdated >&2; \ 26 | (test -f $@ || echo git-log is required to generate this file >> $@)); \ 27 | else \ 28 | test -f $@ || \ 29 | (echo A git checkout and git-log is required to generate ChangeLog >&2 && \ 30 | echo A git checkout and git-log is required to generate this file >> $@); \ 31 | fi 32 | 33 | AM_DISTCHECK_CONFIGURE_FLAGS = \ 34 | --with-udev-base-dir="$$dc_install_base" \ 35 | --with-systemdsystemunitdir="$$dc_install_base/$(SYSTEMD_UNIT_DIR)" \ 36 | --enable-gtk-doc=yes \ 37 | $(NULL) 38 | 39 | EXTRA_DIST = \ 40 | autogen.sh \ 41 | gtester.make \ 42 | COPYING.LIB \ 43 | $(NULL) 44 | 45 | ACLOCAL_AMFLAGS = -I m4 46 | 47 | @CODE_COVERAGE_RULES@ 48 | 49 | if CODE_COVERAGE_ENABLED 50 | clean-local: 51 | -find $(top_builddir) -name "*.gcno" -delete 52 | endif 53 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ModemManager. 2 | ModemManager provides a unified high level API for communicating with mobile 3 | broadband modems, regardless of the protocol used to communicate with the 4 | actual device (Generic AT, vendor-specific AT, QCDM, QMI, MBIM...). 5 | 6 | Using. 7 | ModemManager is a system daemon and is not meant to be used directly from 8 | the command line. However, since it provides a DBus API, it is possible to use 9 | 'dbus-send' commands or the new 'mmcli' command line interface to control it 10 | from the terminal. The devices are queried from udev and automatically updated 11 | based on hardware events, although a manual re-scan can also be requested to 12 | look for RS232 modems. 13 | 14 | Implementation. 15 | ModemManager is a DBus system bus activated service (meaning it's started 16 | automatically when a request arrives). It is written in C, using glib and gio. 17 | Several GInterfaces specify different features that the modems support, 18 | including the generic MMIfaceModem3gpp and MMIfaceModemCdma which provide basic 19 | operations for 3GPP (GSM, UMTS, LTE) or CDMA (CDMA1x, EV-DO) modems. If a given 20 | feature is not available in the modem, the specific interface will not be 21 | exported in DBus. 22 | 23 | Plugins. 24 | Plugins are loaded on startup, and must implement the MMPlugin interface. It 25 | consists of a couple of methods which tell the daemon whether the plugin 26 | supports a port and to create custom MMBroadbandModem implementations. It most 27 | likely makes sense to derive custom modem implementations from one of the 28 | generic classes and just add (or override) operations which are not standard. 29 | There are multiple fully working plugins in the plugins/ directory that can be 30 | used as an example for writing new plugins. Writing new plugins is highly 31 | encouraged! The plugin API is open for changes, so if you're writing a plugin 32 | and need to add or change some public method, feel free to suggest it! 33 | 34 | License. 35 | The ModemManager and mmcli binaries are both GPLv2+. 36 | The libmm-glib library is LGPLv2+. 37 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run this to generate all the initial makefiles, etc. 3 | 4 | srcdir=`dirname $0` 5 | test -z "$srcdir" && srcdir=. 6 | REQUIRED_AUTOMAKE_VERSION=1.9 7 | PKG_NAME=ModemManager 8 | 9 | (test -f $srcdir/configure.ac \ 10 | && test -f $srcdir/src/main.c) || { 11 | echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" 12 | echo " top-level $PKG_NAME directory" 13 | exit 1 14 | } 15 | 16 | (cd $srcdir; 17 | autoreconf --force --install --verbose 18 | ) 19 | 20 | if test -z "$NOCONFIGURE"; then 21 | $srcdir/configure --enable-maintainer-mode "$@" 22 | fi 23 | -------------------------------------------------------------------------------- /build-aux/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | header-generator.xsl \ 4 | mm-enums-template.h \ 5 | mm-enums-template.c \ 6 | mm-errors-template.h \ 7 | mm-errors-template.c \ 8 | mm-errors-quarks-template.c 9 | -------------------------------------------------------------------------------- /build-aux/mm-enums-template.h: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | 3 | #include 4 | 5 | G_BEGIN_DECLS 6 | /*** END file-header ***/ 7 | 8 | /*** BEGIN file-production ***/ 9 | 10 | /* enumerations from "@filename@" */ 11 | /*** END file-production ***/ 12 | 13 | /*** BEGIN value-header ***/ 14 | GType @enum_name@_get_type (void) G_GNUC_CONST; 15 | #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) 16 | 17 | /* Define type-specific symbols */ 18 | #undef __MM_IS_ENUM__ 19 | #undef __MM_IS_FLAGS__ 20 | #define __MM_IS_@TYPE@__ 21 | 22 | #if defined __MM_IS_ENUM__ 23 | const gchar *@enum_name@_get_string (@EnumName@ val); 24 | #endif 25 | 26 | #if defined __MM_IS_FLAGS__ 27 | gchar *@enum_name@_build_string_from_mask (@EnumName@ mask); 28 | #endif 29 | 30 | /*** END value-header ***/ 31 | 32 | /*** BEGIN file-tail ***/ 33 | G_END_DECLS 34 | 35 | /*** END file-tail ***/ 36 | -------------------------------------------------------------------------------- /build-aux/mm-errors-quarks-template.c: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | 3 | #include 4 | 5 | /*** END file-header ***/ 6 | 7 | /*** BEGIN file-production ***/ 8 | /* enumerations from "@filename@" */ 9 | /*** END file-production ***/ 10 | 11 | /*** BEGIN value-header ***/ 12 | 13 | #define ERROR_PREFIX @ENUMNAME@_DBUS_PREFIX 14 | static const GDBusErrorEntry @enum_name@_entries[] = { 15 | /*** END value-header ***/ 16 | 17 | /*** BEGIN value-production ***/ 18 | { @VALUENAME@, ERROR_PREFIX ".@valuenick@" }, 19 | /*** END value-production ***/ 20 | 21 | /*** BEGIN value-tail ***/ 22 | }; 23 | #undef ERROR_PREFIX 24 | 25 | GQuark 26 | @enum_name@_quark (void) 27 | { 28 | static volatile gsize quark_volatile = 0; 29 | 30 | if (!quark_volatile) 31 | g_dbus_error_register_error_domain ("@enum_name@_quark", 32 | &quark_volatile, 33 | @enum_name@_entries, 34 | G_N_ELEMENTS (@enum_name@_entries)); 35 | 36 | return (GQuark) quark_volatile; 37 | } 38 | 39 | /*** END value-tail ***/ 40 | 41 | /*** BEGIN file-tail ***/ 42 | /*** END file-tail ***/ 43 | -------------------------------------------------------------------------------- /build-aux/mm-errors-template.c: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | /*** END file-header ***/ 3 | 4 | /*** BEGIN file-production ***/ 5 | /* enumerations from "@filename@" */ 6 | /*** END file-production ***/ 7 | 8 | /*** BEGIN value-header ***/ 9 | 10 | /* @enum_name@_quark() implemented in mm-errors-quarks.c */ 11 | 12 | GType 13 | @enum_name@_get_type (void) 14 | { 15 | static volatile gsize g_define_type_id__volatile = 0; 16 | 17 | if (g_once_init_enter (&g_define_type_id__volatile)) 18 | { 19 | static const G@Type@Value values[] = { 20 | /*** END value-header ***/ 21 | 22 | /*** BEGIN value-production ***/ 23 | { @VALUENAME@, "@VALUENAME@", "@valuenick@" }, 24 | /*** END value-production ***/ 25 | 26 | /*** BEGIN value-tail ***/ 27 | { 0, NULL, NULL } 28 | }; 29 | GType g_define_type_id = 30 | g_@type@_register_static (g_intern_static_string ("@EnumName@"), values); 31 | g_once_init_leave (&g_define_type_id__volatile, g_define_type_id); 32 | } 33 | 34 | return g_define_type_id__volatile; 35 | } 36 | 37 | /*** END value-tail ***/ 38 | 39 | /*** BEGIN file-tail ***/ 40 | /*** END file-tail ***/ 41 | -------------------------------------------------------------------------------- /build-aux/mm-errors-template.h: -------------------------------------------------------------------------------- 1 | /*** BEGIN file-header ***/ 2 | 3 | #include 4 | 5 | G_BEGIN_DECLS 6 | /*** END file-header ***/ 7 | 8 | /*** BEGIN file-production ***/ 9 | 10 | /* enumerations from "@filename@" */ 11 | /*** END file-production ***/ 12 | 13 | /*** BEGIN value-header ***/ 14 | GQuark @enum_name@_quark (void); /* implemented in mm-errors-quarks.c */ 15 | GType @enum_name@_get_type (void) G_GNUC_CONST; 16 | #define @ENUMNAME@ (@enum_name@_quark ()) 17 | #define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ()) 18 | /*** END value-header ***/ 19 | 20 | /*** BEGIN file-tail ***/ 21 | G_END_DECLS 22 | 23 | /*** END file-tail ***/ 24 | -------------------------------------------------------------------------------- /cli/Makefile.am: -------------------------------------------------------------------------------- 1 | bin_PROGRAMS = mmcli 2 | 3 | mmcli_CPPFLAGS = \ 4 | $(WARN_CFLAGS) \ 5 | $(MMCLI_CFLAGS) \ 6 | -I$(top_srcdir) \ 7 | -I$(top_srcdir)/include \ 8 | -I$(top_builddir)/include \ 9 | -I$(top_srcdir)/libmm-glib \ 10 | -I${top_srcdir}/libmm-glib/generated \ 11 | -I${top_builddir}/libmm-glib/generated \ 12 | $(NULL) 13 | 14 | mmcli_SOURCES = \ 15 | mmcli.h \ 16 | mmcli.c \ 17 | mmcli-common.h mmcli-common.c \ 18 | mmcli-output.h mmcli-output.c \ 19 | mmcli-manager.c \ 20 | mmcli-modem.c \ 21 | mmcli-modem-3gpp.c \ 22 | mmcli-modem-cdma.c \ 23 | mmcli-modem-simple.c \ 24 | mmcli-modem-location.c \ 25 | mmcli-modem-messaging.c \ 26 | mmcli-modem-voice.c \ 27 | mmcli-modem-time.c \ 28 | mmcli-modem-firmware.c \ 29 | mmcli-modem-signal.c \ 30 | mmcli-modem-oma.c \ 31 | mmcli-bearer.c \ 32 | mmcli-sim.c \ 33 | mmcli-sms.c \ 34 | mmcli-call.c \ 35 | $(NULL) 36 | 37 | mmcli_LDADD = \ 38 | $(top_builddir)/libmm-glib/libmm-glib.la \ 39 | $(NULL) 40 | 41 | mmcli_LDFLAGS = \ 42 | $(WARN_LDFLAGS) \ 43 | $(MMCLI_LIBS) \ 44 | $(NULL) 45 | 46 | if WITH_UDEV 47 | mmcli_CPPFLAGS += $(GUDEV_CFLAGS) 48 | mmcli_LDFLAGS += $(GUDEV_LIBS) 49 | endif 50 | 51 | completiondir = $(datadir)/bash-completion/completions 52 | 53 | install-data-hook: 54 | $(mkinstalldirs) $(DESTDIR)$(completiondir) 55 | $(INSTALL_DATA) $(srcdir)/mmcli-completion $(DESTDIR)$(completiondir)/mmcli 56 | 57 | uninstall-hook: 58 | rm -f $(DESTDIR)$(completiondir)/mmcli 59 | 60 | EXTRA_DIST = mmcli-completion 61 | -------------------------------------------------------------------------------- /data/ModemManager-interface-initialization-sequence-subclassed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/data/ModemManager-interface-initialization-sequence-subclassed.png -------------------------------------------------------------------------------- /data/ModemManager-interface-initialization-sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/data/ModemManager-interface-initialization-sequence.png -------------------------------------------------------------------------------- /data/ModemManager-logo-square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/data/ModemManager-logo-square.png -------------------------------------------------------------------------------- /data/ModemManager-logo-wide-text.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/data/ModemManager-logo-wide-text.png -------------------------------------------------------------------------------- /data/ModemManager-logo-wide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/data/ModemManager-logo-wide.png -------------------------------------------------------------------------------- /data/ModemManager-states.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/data/ModemManager-states.png -------------------------------------------------------------------------------- /data/ModemManager.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: ModemManager 7 | Description: Common headers provided by ModemManager 8 | Version: @VERSION@ 9 | Cflags: -I${includedir}/ModemManager 10 | -------------------------------------------------------------------------------- /data/ModemManager.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/data/ModemManager.png -------------------------------------------------------------------------------- /data/ModemManager.service.in: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Modem Manager 3 | After=@MM_POLKIT_SERVICE@ 4 | Requires=@MM_POLKIT_SERVICE@ 5 | 6 | [Service] 7 | Type=dbus 8 | BusName=org.freedesktop.ModemManager1 9 | ExecStart=@sbindir@/ModemManager 10 | StandardError=null 11 | Restart=on-abort 12 | CapabilityBoundingSet=CAP_SYS_ADMIN 13 | ProtectSystem=true 14 | ProtectHome=true 15 | PrivateTmp=true 16 | RestrictAddressFamilies=AF_NETLINK AF_UNIX 17 | NoNewPrivileges=true 18 | User=root 19 | 20 | [Install] 21 | WantedBy=multi-user.target 22 | Alias=dbus-org.freedesktop.ModemManager1.service 23 | -------------------------------------------------------------------------------- /data/its/polkit.its: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /data/its/polkit.loc: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /data/mm-glib.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: mm-glib 7 | Description: Library to control and monitor the ModemManager 8 | Version: @VERSION@ 9 | Requires: glib-2.0 gobject-2.0 gio-2.0 ModemManager 10 | Cflags: -I${includedir}/libmm-glib 11 | Libs: -L${libdir} -lmm-glib 12 | -------------------------------------------------------------------------------- /data/org.freedesktop.ModemManager1.conf.nopolkit: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /data/org.freedesktop.ModemManager1.service.in: -------------------------------------------------------------------------------- 1 | # This D-Bus service activation file is only for systemd support since 2 | # an auto-activated ModemManager would be quite surprising for those people 3 | # who have MM installed but turned off. Thus the Exec path available to 4 | # D-Bus is /bin/false, but systemd knows the real Exec path due to the MM 5 | # systemd .service file. 6 | 7 | [D-BUS Service] 8 | Name=org.freedesktop.ModemManager1 9 | Exec=@sbindir@/ModemManager 10 | User=root 11 | SystemdService=dbus-org.freedesktop.ModemManager1.service 12 | -------------------------------------------------------------------------------- /data/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = org.freedesktop.ModemManager1.service.in 3 | -------------------------------------------------------------------------------- /data/tests/org.freedesktop.ModemManager1.service.in: -------------------------------------------------------------------------------- 1 | # This D-Bus service activation file is only TESTS 2 | 3 | [D-BUS Service] 4 | Name=org.freedesktop.ModemManager1 5 | Exec=@abs_top_builddir@/src/ModemManager --test-session --no-auto-scan --test-enable --test-plugin-dir="@abs_top_builddir@/plugins/.libs" --debug 6 | -------------------------------------------------------------------------------- /decode/decode.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details: 13 | # 14 | # Copyright (C) 2011 Red Hat, Inc. 15 | # 16 | 17 | import binascii 18 | import string 19 | import sys 20 | import defs 21 | from packet import Packet 22 | 23 | packets = [] 24 | control = None 25 | transfer = None 26 | 27 | def get_protocol(arg): 28 | return arg[arg.index("=") + 1:] 29 | 30 | if __name__ == "__main__": 31 | i = 1 32 | if sys.argv[i].startswith("--control="): 33 | control = get_protocol(sys.argv[i]) 34 | i = i + 1 35 | if sys.argv[i].startswith("--transfer="): 36 | transfer = get_protocol(sys.argv[i]) 37 | i = i + 1 38 | 39 | path = sys.argv[i] 40 | f = open(path, 'r') 41 | lines = f.readlines() 42 | f.close() 43 | 44 | packet = None 45 | for l in lines: 46 | if packet: 47 | done = packet.add_line(l) 48 | if done: 49 | packets.append(packet) 50 | packet = None 51 | else: 52 | packet = Packet(l, control, transfer) 53 | if packet.direction == defs.TO_UNKNOWN: 54 | packet = None 55 | 56 | for p in packets: 57 | p.show() 58 | -------------------------------------------------------------------------------- /decode/defs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 2 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details: 13 | # 14 | # Copyright (C) 2011 Red Hat, Inc. 15 | # 16 | 17 | TO_UNKNOWN = 0 18 | TO_MODEM = 1 19 | TO_HOST = 2 20 | 21 | -------------------------------------------------------------------------------- /docs/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = reference man 3 | 4 | # require gtk-doc when making dist 5 | # 6 | if ENABLE_GTK_DOC 7 | dist-check-gtk-doc: 8 | else 9 | dist-check-gtk-doc: 10 | @echo "*** gtk-doc must be enabled in order to make dist" 11 | @false 12 | endif 13 | 14 | dist-hook: dist-check-gtk-doc 15 | -------------------------------------------------------------------------------- /docs/man/Makefile.am: -------------------------------------------------------------------------------- 1 | man_MANS = ModemManager.8 mmcli.1 2 | 3 | EXTRA_DIST = $(man_MANS) 4 | -------------------------------------------------------------------------------- /docs/reference/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = api libmm-glib 3 | -------------------------------------------------------------------------------- /docs/reference/api/ModemManager.types: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/docs/reference/api/ModemManager.types -------------------------------------------------------------------------------- /docs/reference/api/version.xml.in: -------------------------------------------------------------------------------- 1 | @VERSION@ 2 | -------------------------------------------------------------------------------- /docs/reference/libmm-glib/version.xml.in: -------------------------------------------------------------------------------- 1 | @VERSION@ 2 | -------------------------------------------------------------------------------- /examples/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = modem-watcher-python modem-watcher-javascript sms-python network-scan-python 2 | -------------------------------------------------------------------------------- /examples/modem-watcher-javascript/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | main.js \ 4 | modemWatcher.js \ 5 | modem-watcher-javascript 6 | -------------------------------------------------------------------------------- /examples/modem-watcher-javascript/README: -------------------------------------------------------------------------------- 1 | 2 | The modem-watcher-javascript program makes use of the 'libmm-glib' library through 3 | GObject Introspection to talk to ModemManager. 4 | 5 | The program will just print in stdout whenever: 6 | * ModemManager is found in the bus 7 | * ModemManager is lost in the bus 8 | * A new modem is added to ModemManager 9 | * A modem is removed from ModemManager 10 | 11 | The output will look like this: 12 | 13 | $ ./modem-watcher-javascript 14 | [ModemWatcher] ModemManager service is available in bus 15 | [ModemWatcher] Vodafone (Huawei) (K3772) modem managed by ModemManager [861320000017897]: /org/freedesktop/ModemManager1/Modem/1 16 | [ModemWatcher] modem unmanaged by ModemManager: /org/freedesktop/ModemManager1/Modem/1 17 | [ModemWatcher] ModemManager service not available in bus 18 | 19 | Note that the program requires ModemManager and libmm-glib to be installed in 20 | the system and the introspection typelibs available in the standard paths. 21 | 22 | Have fun! -------------------------------------------------------------------------------- /examples/modem-watcher-javascript/main.js: -------------------------------------------------------------------------------- 1 | 2 | const Mainloop = imports.mainloop; 3 | const GLib = imports.gi.GLib; 4 | 5 | const modemWatcher = imports.modemWatcher; 6 | 7 | function start() { 8 | let watcher = new modemWatcher.ModemWatcher(); 9 | 10 | Mainloop.run(); 11 | } 12 | -------------------------------------------------------------------------------- /examples/modem-watcher-javascript/modem-watcher-javascript: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # This program is free software; you can redistribute it and/or modify it under 4 | # the terms of the GNU Lesser General Public License as published by the Free 5 | # Software Foundation; either version 2 of the License, or (at your option) any 6 | # later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, but WITHOUT 9 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 10 | # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 11 | # details. 12 | # 13 | # You should have received a copy of the GNU Lesser General Public License along 14 | # with this program; if not, write to the Free Software Foundation, Inc., 51 15 | # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 16 | # 17 | # Copyright (C) 2014 Aleksander Morgado 18 | # 19 | 20 | exec gjs-console -I . -c "const Main = imports.main; Main.start();" 21 | -------------------------------------------------------------------------------- /examples/modem-watcher-python/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | ModemWatcher.py \ 4 | modem-watcher-python 5 | -------------------------------------------------------------------------------- /examples/modem-watcher-python/README: -------------------------------------------------------------------------------- 1 | 2 | The modem-watcher-python program makes use of the 'libmm-glib' library through 3 | GObject Introspection to talk to ModemManager. 4 | 5 | The program will just print in stdout whenever: 6 | * ModemManager is found in the bus 7 | * ModemManager is lost in the bus 8 | * A new modem is added to ModemManager 9 | * A modem is removed from ModemManager 10 | 11 | The output will look like this: 12 | 13 | $ ./modem-watcher-python 14 | [ModemWatcher] ModemManager service is available in bus 15 | [ModemWatcher] Vodafone (Huawei) (K3772) modem managed by ModemManager [861320000017897]: /org/freedesktop/ModemManager1/Modem/0 16 | [ModemWatcher] modem unmanaged by ModemManager: /org/freedesktop/ModemManager1/Modem/0 17 | [ModemWatcher] ModemManager service not available in bus 18 | 19 | Note that the program requires ModemManager and libmm-glib to be installed in 20 | the system and the introspection typelibs available in the standard paths. 21 | 22 | Have fun! -------------------------------------------------------------------------------- /examples/modem-watcher-python/modem-watcher-python: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 3 | # 4 | # This program is free software; you can redistribute it and/or modify it under 5 | # the terms of the GNU Lesser General Public License as published by the Free 6 | # Software Foundation; either version 2 of the License, or (at your option) any 7 | # later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | # details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public License along 15 | # with this program; if not, write to the Free Software Foundation, Inc., 51 16 | # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | # 18 | # Copyright (C) 2014 Aleksander Morgado 19 | # 20 | 21 | import sys, signal 22 | import ModemWatcher 23 | from gi.repository import GLib 24 | 25 | main_loop = None 26 | watcher = None 27 | 28 | def signal_handler(data): 29 | main_loop.quit() 30 | 31 | if __name__ == "__main__": 32 | # Create modem watcher 33 | watcher = ModemWatcher.ModemWatcher() 34 | 35 | # Main loop 36 | main_loop = GLib.MainLoop() 37 | GLib.unix_signal_add(GLib.PRIORITY_HIGH, signal.SIGHUP, signal_handler, None) 38 | GLib.unix_signal_add(GLib.PRIORITY_HIGH, signal.SIGTERM, signal_handler, None) 39 | try: 40 | main_loop.run() 41 | except KeyboardInterrupt: 42 | pass 43 | -------------------------------------------------------------------------------- /examples/network-scan-python/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | network-scan-python \ 4 | $(NULL) 5 | -------------------------------------------------------------------------------- /examples/network-scan-python/README: -------------------------------------------------------------------------------- 1 | 2 | The network-scan-python program makes use of the 'libmm-glib' library through 3 | GObject Introspection to talk to ModemManager. 4 | 5 | The program will: 6 | * Detect whether ModemManager is found in the bus 7 | * Loop through each modem found in the system, running a network scan for each 8 | 9 | The output will look like this: 10 | 11 | $ ./network-scan-python 12 | 13 | 14 | Note that the program requires ModemManager and libmm-glib to be installed in 15 | the system and the introspection typelibs available in the standard paths. 16 | 17 | Have fun! -------------------------------------------------------------------------------- /examples/sms-python/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | EXTRA_DIST = \ 3 | sms-python \ 4 | $(NULL) 5 | -------------------------------------------------------------------------------- /examples/sms-python/README: -------------------------------------------------------------------------------- 1 | 2 | The sms-python program makes use of the 'libmm-glib' library through 3 | GObject Introspection to talk to ModemManager. 4 | 5 | The program will: 6 | * Detect whether ModemManager is found in the bus 7 | * Prepare SMS properties object with the provided Number and Text. 8 | * Loop through each modem found in the system, and for each: 9 | ** Create a SMS 10 | ** Send the SMS 11 | 12 | The output will look like this: 13 | 14 | $ ./sms-python "+1234567890" "hello there, how are you?" 15 | /org/freedesktop/ModemManager1/Modem/0: sms sent 16 | 17 | Note that the program requires ModemManager and libmm-glib to be installed in 18 | the system and the introspection typelibs available in the standard paths. 19 | 20 | Have fun! -------------------------------------------------------------------------------- /examples/sms-python/sms-python: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- 3 | # 4 | # This program is free software; you can redistribute it and/or modify it under 5 | # the terms of the GNU Lesser General Public License as published by the Free 6 | # Software Foundation; either version 2 of the License, or (at your option) any 7 | # later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, but WITHOUT 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 11 | # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 12 | # details. 13 | # 14 | # You should have received a copy of the GNU Lesser General Public License along 15 | # with this program; if not, write to the Free Software Foundation, Inc., 51 16 | # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | # 18 | # Copyright (C) 2016 Aleksander Morgado 19 | # 20 | 21 | import sys, signal, gi 22 | 23 | gi.require_version('ModemManager', '1.0') 24 | from gi.repository import GLib, GObject, Gio, ModemManager 25 | 26 | if __name__ == "__main__": 27 | 28 | # Process input arguments 29 | if len(sys.argv) != 3: 30 | sys.stderr.write('error: wrong number of arguments\n') 31 | sys.stdout.write('usage: sms-python \n') 32 | sys.exit(1) 33 | 34 | # Prepare SMS properties 35 | sms_properties = ModemManager.SmsProperties.new () 36 | sms_properties.set_number(sys.argv[1]) 37 | sms_properties.set_text(sys.argv[2]) 38 | 39 | # Connection to ModemManager 40 | connection = Gio.bus_get_sync (Gio.BusType.SYSTEM, None) 41 | manager = ModemManager.Manager.new_sync (connection, Gio.DBusObjectManagerClientFlags.DO_NOT_AUTO_START, None) 42 | if manager.get_name_owner() is None: 43 | sys.stderr.write('ModemManager not found in bus') 44 | sys.exit(2) 45 | 46 | # Iterate modems and send SMS with each 47 | for obj in manager.get_objects(): 48 | messaging = obj.get_modem_messaging() 49 | sms = messaging.create_sync(sms_properties) 50 | sms.send_sync() 51 | print('%s: sms sent' % messaging.get_object_path()) 52 | -------------------------------------------------------------------------------- /include/Makefile.am: -------------------------------------------------------------------------------- 1 | XSLTPROC = xsltproc --xinclude --nonet 2 | 3 | XMLS = $(wildcard $(top_srcdir)/introspection/*.xml) 4 | 5 | includedir = @includedir@/ModemManager 6 | 7 | include_HEADERS = \ 8 | ModemManager-names.h \ 9 | ModemManager-enums.h \ 10 | ModemManager-errors.h \ 11 | ModemManager-compat.h \ 12 | ModemManager-version.h \ 13 | ModemManager.h 14 | 15 | ModemManager-names.h: $(XMLS) $(top_srcdir)/build-aux/header-generator.xsl 16 | $(AM_V_GEN) $(XSLTPROC) $(top_srcdir)/build-aux/header-generator.xsl $(top_srcdir)/introspection/all.xml > $@ 17 | 18 | CLEANFILES = \ 19 | ModemManager-names.h 20 | 21 | EXTRA_DIST = \ 22 | ModemManager-tags.h \ 23 | ModemManager-version.h.in 24 | -------------------------------------------------------------------------------- /include/ModemManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ModemManager Interface Specification 3 | * version 1.x 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA. 19 | * 20 | * Copyright (C) 2008 - 2009 Novell, Inc. 21 | * Copyright (C) 2009 - 2013 Red Hat, Inc. 22 | * Copyright (C) 2011 - 2013 Google, Inc. 23 | * Copyright (C) 2011 - 2013 Lanedo Gmbh 24 | */ 25 | 26 | #ifndef _MODEM_MANAGER_H_ 27 | #define _MODEM_MANAGER_H_ 28 | 29 | #define __MODEM_MANAGER_H_INSIDE__ 30 | 31 | /* Public header with DBus Interface, Method, Signal and Property names */ 32 | #include 33 | 34 | /* Public header with enumerations and flags */ 35 | #include 36 | 37 | /* Public header with errors */ 38 | #include 39 | 40 | /* Public header with compatibility types and methods */ 41 | #include 42 | 43 | /* Public header with version info */ 44 | #include 45 | 46 | #endif /* _MODEM_MANAGER_H_ */ 47 | -------------------------------------------------------------------------------- /introspection/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | SUBDIRS = . tests 3 | 4 | # DBus Introspection files 5 | xmldir = $(datadir)/dbus-1/interfaces 6 | xml_DATA = \ 7 | org.freedesktop.ModemManager1.xml \ 8 | org.freedesktop.ModemManager1.Modem.xml \ 9 | org.freedesktop.ModemManager1.Modem.Modem3gpp.xml \ 10 | org.freedesktop.ModemManager1.Modem.ModemCdma.xml \ 11 | org.freedesktop.ModemManager1.Modem.Simple.xml \ 12 | org.freedesktop.ModemManager1.Sim.xml \ 13 | org.freedesktop.ModemManager1.Bearer.xml \ 14 | org.freedesktop.ModemManager1.Modem.Location.xml \ 15 | org.freedesktop.ModemManager1.Modem.Messaging.xml \ 16 | org.freedesktop.ModemManager1.Sms.xml \ 17 | org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml \ 18 | org.freedesktop.ModemManager1.Modem.Firmware.xml \ 19 | org.freedesktop.ModemManager1.Modem.Oma.xml \ 20 | org.freedesktop.ModemManager1.Modem.Signal.xml \ 21 | org.freedesktop.ModemManager1.Modem.Time.xml \ 22 | org.freedesktop.ModemManager1.Modem.Voice.xml \ 23 | org.freedesktop.ModemManager1.Call.xml \ 24 | $(NULL) 25 | 26 | EXTRA_DIST = \ 27 | $(xml_DATA) \ 28 | all.xml \ 29 | $(NULL) 30 | -------------------------------------------------------------------------------- /introspection/all.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /introspection/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | # DBus Introspection files 3 | EXTRA_DIST = org.freedesktop.ModemManager1.Test.xml 4 | -------------------------------------------------------------------------------- /introspection/tests/org.freedesktop.ModemManager1.Test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | 10 | 11 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /libmm-glib/generated/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | AM_CFLAGS = $(CODE_COVERAGE_CFLAGS) 2 | AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) 3 | 4 | noinst_LTLIBRARIES = libmm-test-generated.la 5 | 6 | GENERATED_H = mm-gdbus-test.h 7 | GENERATED_C = mm-gdbus-test.c 8 | 9 | BUILT_SOURCES = $(GENERATED_H) $(GENERATED_C) 10 | 11 | # Test interface 12 | mm_gdbus_test_generated = \ 13 | mm-gdbus-test.h \ 14 | mm-gdbus-test.c 15 | $(mm_gdbus_test_generated): $(top_srcdir)/introspection/tests/org.freedesktop.ModemManager1.Test.xml 16 | $(AM_V_GEN) $(GDBUS_CODEGEN) \ 17 | --interface-prefix org.freedesktop.ModemManager1. \ 18 | --c-namespace=MmGdbus \ 19 | --generate-c-code mm-gdbus-test \ 20 | $< \ 21 | $(NULL) 22 | 23 | nodist_libmm_test_generated_la_SOURCES = \ 24 | $(GENERATED_H) \ 25 | $(GENERATED_C) 26 | 27 | libmm_test_generated_la_CPPFLAGS = \ 28 | $(LIBMM_GLIB_CFLAGS) \ 29 | -I$(top_srcdir) \ 30 | -I$(top_srcdir)/include \ 31 | -I$(top_builddir)/include \ 32 | -Wno-unused-function \ 33 | -Wno-float-equal \ 34 | -Wno-shadow 35 | 36 | libmm_test_generated_la_LIBADD = \ 37 | $(LIBMM_GLIB_LIBS) 38 | 39 | CLEANFILES = $(GENERATED_H) $(GENERATED_C) 40 | -------------------------------------------------------------------------------- /libmm-glib/mm-helper-types.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * libmm -- Access modem status & information from glib applications 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA. 19 | * 20 | * Copyright (C) 2013 Aleksander Morgado 21 | */ 22 | 23 | #include "mm-helper-types.h" 24 | 25 | /** 26 | * mm_modem_port_info_array_free: 27 | * @array: an array of #MMModemPortInfo values. 28 | * @array_size: length of @array. 29 | * 30 | * Frees an array of #MMModemPortInfo values. 31 | * 32 | * Since: 1.0 33 | */ 34 | void 35 | mm_modem_port_info_array_free (MMModemPortInfo *array, 36 | guint array_size) 37 | { 38 | guint i; 39 | 40 | for (i = 0; i < array_size; i++) 41 | g_free (array[i].name); 42 | g_free (array); 43 | } 44 | -------------------------------------------------------------------------------- /libmm-glib/mm-helpers.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * libmm -- Access modem status & information from glib applications 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation; either 8 | * version 2 of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the 17 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA. 19 | * 20 | * Copyright (C) 2011 Aleksander Morgado 21 | */ 22 | 23 | #ifndef _MM_HELPERS_H_ 24 | #define _MM_HELPERS_H_ 25 | 26 | #define RETURN_NON_EMPTY_CONSTANT_STRING(input) do { \ 27 | const gchar *str; \ 28 | \ 29 | str = (input); \ 30 | if (str && str[0]) \ 31 | return str; \ 32 | } while (0); \ 33 | return NULL 34 | 35 | #define RETURN_NON_EMPTY_STRING(input) do { \ 36 | gchar *str; \ 37 | \ 38 | str = (input); \ 39 | if (str && str[0]) \ 40 | return str; \ 41 | g_free (str); \ 42 | } while (0); \ 43 | return NULL 44 | 45 | #endif /* _MM_HELPERS_H_ */ 46 | -------------------------------------------------------------------------------- /libmm-glib/mm-location-common.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2012 Lanedo GmbH 14 | */ 15 | 16 | #ifndef MM_LOCATION_COMMON_H 17 | #define MM_LOCATION_COMMON_H 18 | 19 | #if !defined (__MODEM_MANAGER_H_INSIDE__) 20 | #error "Only can be included directly." 21 | #endif 22 | 23 | /** 24 | * MM_LOCATION_LONGITUDE_UNKNOWN: 25 | * 26 | * Identifier for an unknown longitude value. 27 | * 28 | * Proper longitude values fall in the [-180,180] range. 29 | * 30 | * Since: 1.0 31 | */ 32 | #define MM_LOCATION_LONGITUDE_UNKNOWN -G_MAXDOUBLE 33 | 34 | /** 35 | * MM_LOCATION_LATITUDE_UNKNOWN: 36 | * 37 | * Identifier for an unknown latitude value. 38 | * 39 | * Proper latitude values fall in the [-90,90] range. 40 | * 41 | * Since: 1.0 42 | */ 43 | #define MM_LOCATION_LATITUDE_UNKNOWN -G_MAXDOUBLE 44 | 45 | /** 46 | * MM_LOCATION_ALTITUDE_UNKNOWN: 47 | * 48 | * Identifier for an unknown altitude value. 49 | * 50 | * Since: 1.0 51 | */ 52 | #define MM_LOCATION_ALTITUDE_UNKNOWN -G_MAXDOUBLE 53 | 54 | #endif /* MM_LOCATION_COMMON_H */ 55 | -------------------------------------------------------------------------------- /libmm-glib/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/gtester.make 2 | 3 | AM_CFLAGS = $(CODE_COVERAGE_CFLAGS) 4 | AM_LDFLAGS = $(CODE_COVERAGE_LDFLAGS) 5 | 6 | LIBMM_GLIB_TESTS_COMMON_CPPFLAGS = \ 7 | $(MM_CFLAGS) \ 8 | -I$(top_srcdir) \ 9 | -I$(top_srcdir)/include \ 10 | -I$(top_builddir)/include \ 11 | -I$(top_srcdir)/libmm-glib \ 12 | -I$(top_builddir)/libmm-glib \ 13 | -I${top_srcdir}/libmm-glib/generated \ 14 | -I${top_builddir}/libmm-glib/generated \ 15 | -DLIBMM_GLIB_COMPILATION 16 | 17 | LIBMM_GLIB_TESTS_COMMON_LDADD = \ 18 | $(top_builddir)/libmm-glib/libmm-glib.la \ 19 | $(MM_LIBS) 20 | 21 | noinst_PROGRAMS = \ 22 | test-common-helpers \ 23 | test-pco 24 | TEST_PROGS += $(noinst_PROGRAMS) 25 | 26 | test_common_helpers_SOURCES = test-common-helpers.c 27 | test_common_helpers_CPPFLAGS = $(LIBMM_GLIB_TESTS_COMMON_CPPFLAGS) 28 | test_common_helpers_LDADD = $(LIBMM_GLIB_TESTS_COMMON_LDADD) 29 | 30 | test_pco_SOURCES = test-pco.c 31 | test_pco_CPPFLAGS = $(LIBMM_GLIB_TESTS_COMMON_CPPFLAGS) 32 | test_pco_LDADD = $(LIBMM_GLIB_TESTS_COMMON_LDADD) 33 | -------------------------------------------------------------------------------- /libqcdm/AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/libqcdm/AUTHORS -------------------------------------------------------------------------------- /libqcdm/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/libqcdm/ChangeLog -------------------------------------------------------------------------------- /libqcdm/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS=src tests 2 | 3 | -------------------------------------------------------------------------------- /libqcdm/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/libqcdm/NEWS -------------------------------------------------------------------------------- /libqcdm/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/libqcdm/README -------------------------------------------------------------------------------- /libqcdm/autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Run this to generate all the initial makefiles, etc. 3 | # NOTE 4 | # This autogen.sh is only used when building libqcdm separately from ModemManager 5 | 6 | srcdir=`dirname $0` 7 | test -z "$srcdir" && srcdir=. 8 | REQUIRED_AUTOMAKE_VERSION=1.7 9 | PKG_NAME=libqcdm 10 | 11 | (test -f $srcdir/configure.ac \ 12 | && test -f $srcdir/src/com.c) || { 13 | echo -n "**Error**: Directory "\`$srcdir\'" does not look like the" 14 | echo " top-level $PKG_NAME directory" 15 | exit 1 16 | } 17 | 18 | (cd $srcdir; 19 | autoreconf --install --symlink && 20 | autoreconf && 21 | ./configure --enable-maintainer-mode $@ 22 | ) 23 | -------------------------------------------------------------------------------- /libqcdm/configure.ac: -------------------------------------------------------------------------------- 1 | # NOTE 2 | # This configure.ac is only used when building libqcdm separately from 3 | # ModemManager. 4 | # 5 | 6 | AC_PREREQ(2.52) 7 | 8 | AC_INIT(libqcdm, 0.1, dcbw@redhat.com, libqcdm) 9 | AM_INIT_AUTOMAKE([1.9 subdir-objects tar-ustar no-dist-gzip dist-bzip2]) 10 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) 11 | AM_MAINTAINER_MODE 12 | 13 | AC_CONFIG_MACRO_DIR([m4]) 14 | 15 | AC_CONFIG_HEADERS(config.h) 16 | 17 | dnl Define _GNU_SOURCE for various things like strcasestr() 18 | AC_GNU_SOURCE 19 | 20 | dnl Required programs 21 | AC_PROG_CC 22 | AM_PROG_CC_C_O 23 | AC_PROG_INSTALL 24 | AC_PROG_LIBTOOL 25 | 26 | dnl 27 | dnl Tests 28 | dnl 29 | AC_ARG_WITH(tests, AS_HELP_STRING([--with-tests], [Build libqcdm tests])) 30 | AM_CONDITIONAL(WITH_TESTS, test "x$with_tests" = "xyes") 31 | case $with_tests in 32 | yes) 33 | PKG_CHECK_MODULES(MM, glib-2.0 >= 2.18) 34 | AC_SUBST(MM_CFLAGS) 35 | AC_SUBST(MM_LIBS) 36 | ;; 37 | *) ;; 38 | esac 39 | 40 | AM_CONDITIONAL(QCDM_STANDALONE, test "yes" = "yes") 41 | 42 | AC_CONFIG_FILES([ 43 | Makefile 44 | src/Makefile 45 | tests/Makefile 46 | ]) 47 | AC_OUTPUT 48 | 49 | -------------------------------------------------------------------------------- /libqcdm/src/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | AM_CFLAGS = \ 3 | $(WARN_CFLAGS) \ 4 | $(CODE_COVERAGE_CFLAGS) \ 5 | $(NULL) 6 | 7 | AM_LDFLAGS = \ 8 | $(WARN_LDFLAGS) \ 9 | $(CODE_COVERAGE_LDFLAGS) \ 10 | $(NULL) 11 | 12 | noinst_LTLIBRARIES = libqcdm.la libqcdm-test.la 13 | 14 | libqcdm_la_CPPFLAGS = \ 15 | $(MM_CFLAGS) 16 | 17 | libqcdm_la_SOURCES = \ 18 | dm-commands.h \ 19 | nv-items.h \ 20 | log-items.h \ 21 | com.c \ 22 | com.h \ 23 | commands.c \ 24 | commands.h \ 25 | errors.c \ 26 | errors.h \ 27 | logs.c \ 28 | logs.h \ 29 | result.c \ 30 | result.h \ 31 | result-private.h \ 32 | utils.c \ 33 | utils.h 34 | 35 | libqcdm_la_LIBADD = \ 36 | $(MM_LIBS) 37 | 38 | 39 | ########################################### 40 | # Test library without symbol versioning 41 | ########################################### 42 | 43 | libqcdm_test_la_CPPFLAGS = \ 44 | $(MM_CFLAGS) 45 | 46 | libqcdm_test_la_SOURCES = \ 47 | utils.c \ 48 | utils.h 49 | 50 | libqcdm_test_la_LIBADD = \ 51 | $(MM_LIBS) 52 | -------------------------------------------------------------------------------- /libqcdm/src/com.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2010 Red Hat, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or 6 | * modify it under the terms of version 2 of the GNU General Public 7 | * License as published by the Free Software Foundation 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | 23 | #include "com.h" 24 | #include "errors.h" 25 | 26 | int 27 | qcdm_port_setup (int fd) 28 | { 29 | struct termios stbuf; 30 | 31 | errno = 0; 32 | memset (&stbuf, 0, sizeof (stbuf)); 33 | if (tcgetattr (fd, &stbuf) != 0) { 34 | qcdm_err (0, "tcgetattr() error: %d", errno); 35 | return -QCDM_ERROR_SERIAL_CONFIG_FAILED; 36 | } 37 | 38 | stbuf.c_cflag &= ~(CBAUD | CSIZE | CSTOPB | CLOCAL | PARENB); 39 | stbuf.c_iflag &= ~(HUPCL | IUTF8 | IUCLC | ISTRIP | IXON | IXOFF | IXANY | ICRNL); 40 | stbuf.c_oflag &= ~(OPOST | OCRNL | ONLCR | OLCUC | ONLRET); 41 | stbuf.c_lflag &= ~(ICANON | ISIG | IEXTEN | ECHO | ECHOE | ECHOK | ECHONL); 42 | stbuf.c_lflag &= ~(NOFLSH | TOSTOP | ECHOPRT | ECHOCTL | ECHOKE); 43 | stbuf.c_cc[VMIN] = 1; 44 | stbuf.c_cc[VTIME] = 0; 45 | stbuf.c_cc[VEOF] = 1; 46 | stbuf.c_cflag |= (B115200 | CS8 | CREAD | 0 | 0); /* No parity, 1 stop bit */ 47 | 48 | errno = 0; 49 | if (tcsetattr (fd, TCSANOW, &stbuf) < 0) { 50 | qcdm_err (0, "tcgetattr() error: %d", errno); 51 | return -QCDM_ERROR_SERIAL_CONFIG_FAILED; 52 | } 53 | 54 | return QCDM_SUCCESS; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /libqcdm/src/com.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2010 Red Hat, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or 6 | * modify it under the terms of version 2 of the GNU General Public 7 | * License as published by the Free Software Foundation 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef LIBQCDM_COM_H 19 | #define LIBQCDM_COM_H 20 | 21 | #include "utils.h" 22 | 23 | int qcdm_port_setup (int fd); 24 | 25 | #endif /* LIBQCDM_COM_H */ 26 | -------------------------------------------------------------------------------- /libqcdm/src/errors.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2010 Red Hat, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or 6 | * modify it under the terms of version 2 of the GNU General Public 7 | * License as published by the Free Software Foundation 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #include "errors.h" 19 | #include 20 | #include 21 | 22 | void 23 | _qcdm_log (const char *file, 24 | int line, 25 | const char *func, 26 | int level, 27 | int domain, 28 | const char *format, 29 | ...) 30 | { 31 | va_list args; 32 | char *message = NULL; 33 | int n; 34 | const char *prefix = "info"; 35 | 36 | qcdm_return_if_fail (format != NULL); 37 | qcdm_return_if_fail (format[0] != '\0'); 38 | 39 | /* level & domain ignored for now */ 40 | 41 | if (getenv ("QCDM_DEBUG") == NULL) 42 | return; 43 | 44 | va_start (args, format); 45 | n = vasprintf (&message, format, args); 46 | va_end (args); 47 | 48 | if (level & QCDM_LOGL_ERR) 49 | prefix = "err"; 50 | else if (level & QCDM_LOGL_WARN) 51 | prefix = "warn"; 52 | else if (level & QCDM_LOGL_DEBUG) 53 | prefix = "dbg"; 54 | 55 | if (n >= 0) { 56 | fprintf (stderr, "<%s> [%s:%u] %s(): %s\n", prefix, file, line, func, message); 57 | free (message); 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /libqcdm/src/result-private.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2011 Red Hat, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or 6 | * modify it under the terms of version 2 of the GNU General Public 7 | * License as published by the Free Software Foundation 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef LIBQCDM_RESULT_PRIVATE_H 19 | #define LIBQCDM_RESULT_PRIVATE_H 20 | 21 | #include "result.h" 22 | 23 | QcdmResult *qcdm_result_new (void); 24 | 25 | void qcdm_result_add_string (QcdmResult *result, 26 | const char *key, 27 | const char *str); 28 | 29 | void qcdm_result_add_u8 (QcdmResult *result, 30 | const char *key, 31 | uint8_t num); 32 | 33 | void qcdm_result_add_u8_array (QcdmResult *result, 34 | const char *key, 35 | const uint8_t *array, 36 | size_t array_len); 37 | 38 | int qcdm_result_get_u8_array (QcdmResult *result, 39 | const char *key, 40 | const uint8_t **out_val, 41 | size_t *out_len); 42 | 43 | void qcdm_result_add_u16_array (QcdmResult *result, 44 | const char *key, 45 | const uint16_t *array, 46 | size_t array_len); 47 | 48 | void qcdm_result_add_u32 (QcdmResult *result, 49 | const char *key, 50 | uint32_t num); 51 | 52 | #endif /* LIBQCDM_RESULT_PRIVATE_H */ 53 | -------------------------------------------------------------------------------- /libqcdm/src/result.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2010 Red Hat, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or 6 | * modify it under the terms of version 2 of the GNU General Public 7 | * License as published by the Free Software Foundation 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef LIBQCDM_RESULT_H 19 | #define LIBQCDM_RESULT_H 20 | 21 | #include 22 | 23 | typedef struct QcdmResult QcdmResult; 24 | 25 | int qcdm_result_get_string (QcdmResult *r, 26 | const char *key, 27 | const char **out_val); 28 | 29 | int qcdm_result_get_u8 (QcdmResult *r, 30 | const char *key, 31 | uint8_t *out_val); 32 | 33 | int qcdm_result_get_u32 (QcdmResult *r, 34 | const char *key, 35 | uint32_t *out_val); 36 | 37 | int qcdm_result_get_u16_array (QcdmResult *result, 38 | const char *key, 39 | const uint16_t **out_val, 40 | size_t *out_len); 41 | 42 | QcdmResult *qcdm_result_ref (QcdmResult *r); 43 | 44 | void qcdm_result_unref (QcdmResult *r); 45 | 46 | #endif /* LIBQCDM_RESULT_H */ 47 | -------------------------------------------------------------------------------- /libqcdm/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | include $(top_srcdir)/gtester.make 2 | 3 | AM_CFLAGS = \ 4 | $(WARN_CFLAGS) \ 5 | $(CODE_COVERAGE_CFLAGS) \ 6 | $(NULL) 7 | 8 | AM_LDFLAGS = \ 9 | $(WARN_LDFLAGS) \ 10 | $(CODE_COVERAGE_LDFLAGS) \ 11 | $(NULL) 12 | 13 | noinst_PROGRAMS = test-qcdm modepref ipv6pref reset 14 | TEST_PROGS += test-qcdm 15 | 16 | test_qcdm_SOURCES = \ 17 | test-qcdm-crc.c \ 18 | test-qcdm-crc.h \ 19 | test-qcdm-escaping.c \ 20 | test-qcdm-escaping.h \ 21 | test-qcdm-utils.c \ 22 | test-qcdm-utils.h \ 23 | test-qcdm-com.c \ 24 | test-qcdm-com.h \ 25 | test-qcdm-result.c \ 26 | test-qcdm-result.h \ 27 | test-qcdm.c 28 | test_qcdm_CPPFLAGS = \ 29 | $(MM_CFLAGS) \ 30 | -I$(top_srcdir)/libqcdm/src \ 31 | -I$(top_srcdir)/src 32 | test_qcdm_LDADD = $(MM_LIBS) 33 | 34 | modepref_SOURCES = modepref.c 35 | modepref_CPPFLAGS = \ 36 | $(MM_CFLAGS) \ 37 | -I$(top_srcdir)/libqcdm/src \ 38 | -I$(top_srcdir)/src 39 | modepref_LDADD = $(MM_LIBS) 40 | 41 | ipv6pref_SOURCES = ipv6pref.c 42 | ipv6pref_CPPFLAGS = \ 43 | $(MM_CFLAGS) \ 44 | -I$(top_srcdir)/libqcdm/src \ 45 | -I$(top_srcdir)/src 46 | ipv6pref_LDADD = $(MM_LIBS) 47 | 48 | reset_SOURCES = reset.c 49 | reset_CPPFLAGS = \ 50 | $(MM_CFLAGS) \ 51 | -I$(top_srcdir)/libqcdm/src \ 52 | -I$(top_srcdir)/src 53 | reset_LDADD = $(MM_LIBS) 54 | 55 | if QCDM_STANDALONE 56 | test_qcdm_LDADD += $(top_builddir)/src/libqcdm.la 57 | modepref_LDADD += $(top_builddir)/src/libqcdm.la 58 | ipv6pref_LDADD += $(top_builddir)/src/libqcdm.la 59 | reset_LDADD += $(top_builddir)/src/libqcdm.la 60 | else 61 | test_qcdm_LDADD += $(top_builddir)/libqcdm/src/libqcdm.la 62 | modepref_LDADD += $(top_builddir)/libqcdm/src/libqcdm.la 63 | ipv6pref_LDADD += $(top_builddir)/libqcdm/src/libqcdm.la 64 | reset_LDADD += $(top_builddir)/libqcdm/src/libqcdm.la 65 | endif 66 | -------------------------------------------------------------------------------- /libqcdm/tests/test-qcdm-crc.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2010 Red Hat, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or 6 | * modify it under the terms of version 2 of the GNU General Public 7 | * License as published by the Free Software Foundation 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef TEST_QCDM_CRC_H 19 | #define TEST_QCDM_CRC_H 20 | 21 | void test_crc16_2 (void *f, void *data); 22 | void test_crc16_1 (void *f, void *data); 23 | 24 | #endif /* TEST_QCDM_CRC_H */ 25 | 26 | -------------------------------------------------------------------------------- /libqcdm/tests/test-qcdm-escaping.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2010 Red Hat, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or 6 | * modify it under the terms of version 2 of the GNU General Public 7 | * License as published by the Free Software Foundation 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef TEST_QCDM_ESCAPING_H 19 | #define TEST_QCDM_ESCAPING_H 20 | 21 | void test_escape1 (void *f, void *data); 22 | void test_escape2 (void *f, void *data); 23 | void test_escape_unescape (void *f, void *data); 24 | 25 | #endif /* TEST_QCDM_ESCAPING_H */ 26 | 27 | -------------------------------------------------------------------------------- /libqcdm/tests/test-qcdm-result.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2010 Red Hat, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or 6 | * modify it under the terms of version 2 of the GNU General Public 7 | * License as published by the Free Software Foundation 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef TEST_QCDM_RESULT_H 19 | #define TEST_QCDM_RESULT_H 20 | 21 | void test_result_string (void *f, void *data); 22 | void test_result_uint32 (void *f, void *data); 23 | void test_result_uint8 (void *f, void *data); 24 | void test_result_uint8_array (void *f, void *data); 25 | 26 | #endif /* TEST_QCDM_RESULT_H */ 27 | 28 | -------------------------------------------------------------------------------- /libqcdm/tests/test-qcdm-utils.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * Copyright (C) 2010 Red Hat, Inc. 4 | * 5 | * This program is free software: you can redistribute it and/or 6 | * modify it under the terms of version 2 of the GNU General Public 7 | * License as published by the Free Software Foundation 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | 18 | #ifndef TEST_QCDM_UTILS_H 19 | #define TEST_QCDM_UTILS_H 20 | 21 | void test_utils_decapsulate_buffer (void *f, void *data); 22 | 23 | void test_utils_encapsulate_buffer (void *f, void *data); 24 | 25 | void test_utils_decapsulate_sierra_cns (void *f, void *data); 26 | 27 | #endif /* TEST_QCDM_UTILS_H */ 28 | 29 | -------------------------------------------------------------------------------- /m4/mm-enable-plugin.m4: -------------------------------------------------------------------------------- 1 | dnl -*- mode: autoconf -*- 2 | dnl Copyright 2019 Aleksander Morgado 3 | dnl 4 | dnl This file is free software; the author(s) gives unlimited 5 | dnl permission to copy and/or distribute it, with or without 6 | dnl modifications, as long as this notice is preserved. 7 | dnl 8 | 9 | # serial 1 10 | 11 | dnl Usage: 12 | dnl MM_ENABLE_ALL_PLUGINS 13 | AC_DEFUN([MM_ENABLE_ALL_PLUGINS], 14 | [dnl 15 | AC_ARG_ENABLE(all-plugins, 16 | AS_HELP_STRING([--enable-all-plugins], 17 | [Build all plugins [[default=yes]]]), 18 | [], 19 | [enable_all_plugins=yes]) 20 | ]) 21 | 22 | dnl Usage: 23 | dnl MM_ENABLE_PLUGIN([NAME],[WITH_SHARED_NAME_1,WITH_SHARED_NAME_2,...]) 24 | AC_DEFUN([MM_ENABLE_PLUGIN], 25 | [dnl 26 | m4_pushdef([var_enable_plugin], patsubst([enable_plugin_$1], -, _))dnl 27 | m4_pushdef([VAR_ENABLE_PLUGIN], patsubst(translit([enable_plugin_$1], [a-z], [A-Z]), -, _))dnl 28 | AC_ARG_ENABLE(plugin-$1, 29 | AS_HELP_STRING([--enable-plugin-$1], [Build $1 plugin]), 30 | [], 31 | [var_enable_plugin=$enable_all_plugins]) 32 | if test "x$var_enable_plugin" = "xyes"; then 33 | AC_DEFINE([VAR_ENABLE_PLUGIN], 1, [Define if $1 plugin is enabled]) 34 | m4_ifval([$2],[m4_foreach(with_shared,[$2],[dnl 35 | with_shared="yes" 36 | ])])dnl 37 | fi 38 | AM_CONDITIONAL(VAR_ENABLE_PLUGIN, [test "x$var_enable_plugin" = "xyes"]) 39 | m4_popdef([VAR_ENABLE_PLUGIN])dnl 40 | m4_popdef([var_enable_plugin])dnl 41 | ]) 42 | 43 | dnl Usage: 44 | dnl MM_BUILD_SHARED([NAME]) 45 | AC_DEFUN([MM_BUILD_SHARED], 46 | [dnl 47 | m4_pushdef([with_shared], patsubst([with_shared_$1], -, _))dnl 48 | m4_pushdef([WITH_SHARED], patsubst(translit([with_shared_$1], [a-z], [A-Z]), -, _))dnl 49 | AM_CONDITIONAL(WITH_SHARED, test "x$with_shared" = "xyes") 50 | if test "x$with_shared" = "xyes"; then 51 | AC_DEFINE([WITH_SHARED], 1, [Define if $1 utils are built]) 52 | else 53 | with_shared="no" 54 | fi 55 | m4_popdef([WITH_SHARED])dnl 56 | m4_popdef([with_shared])dnl 57 | ]) 58 | -------------------------------------------------------------------------------- /plugins/altair/mm-modem-helpers-altair-lte.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2013 Google Inc. 14 | * 15 | */ 16 | 17 | #ifndef MM_MODEM_HELPERS_ALTAIR_H 18 | #define MM_MODEM_HELPERS_ALTAIR_H 19 | 20 | #include 21 | 22 | #define _LIBMM_INSIDE_MM 23 | #include 24 | 25 | /* Bands response parser */ 26 | GArray *mm_altair_parse_bands_response (const gchar *response); 27 | 28 | /* +CEER response parser */ 29 | gchar *mm_altair_parse_ceer_response (const gchar *response, 30 | GError **error); 31 | 32 | /* %CGINFO="cid",1 response parser */ 33 | gint mm_altair_parse_cid (const gchar *response, GError **error); 34 | 35 | /* %PCOINFO response parser */ 36 | MMPco *mm_altair_parse_vendor_pco_info (const gchar *pco_info, GError **error); 37 | 38 | #endif /* MM_MODEM_HELPERS_ALTAIR_H */ 39 | -------------------------------------------------------------------------------- /plugins/altair/mm-plugin-altair-lte.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2013 Altair Semiconductor 20 | * 21 | * Author: Ori Inbar 22 | */ 23 | 24 | #ifndef MM_PLUGIN_ALTAIR_LTE_H 25 | #define MM_PLUGIN_ALTAIR_LTE_H 26 | 27 | #include "mm-plugin.h" 28 | 29 | #define MM_TYPE_PLUGIN_ALTAIR_LTE (mm_plugin_altair_lte_get_type ()) 30 | #define MM_PLUGIN_ALTAIR_LTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_ALTAIR_LTE, MMPluginAltairLte)) 31 | #define MM_PLUGIN_ALTAIR_LTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_ALTAIR_LTE, MMPluginAltairLteClass)) 32 | #define MM_IS_PLUGIN_ALTAIR_LTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_ALTAIR_LTE)) 33 | #define MM_IS_PLUGIN_ALTAIR_LTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_ALTAIR_LTE)) 34 | #define MM_PLUGIN_ALTAIR_LTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_ALTAIR_LTE, MMPluginAltairLteClass)) 35 | 36 | typedef struct { 37 | MMPlugin parent; 38 | } MMPluginAltairLte; 39 | 40 | typedef struct { 41 | MMPluginClass parent; 42 | } MMPluginAltairLteClass; 43 | 44 | GType mm_plugin_altair_lte_get_type (void); 45 | 46 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 47 | 48 | #endif /* MM_PLUGIN_ALTAIR_LTE_H */ 49 | -------------------------------------------------------------------------------- /plugins/anydata/mm-plugin-anydata.h: -------------------------------------------------------------------------------- 1 | 2 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 3 | /* 4 | * This program is free software; you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation; either version 2 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details: 13 | * 14 | * Copyright (C) 2008 - 2009 Novell, Inc. 15 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 16 | * Copyright (C) 2012 Aleksander Morgado 17 | */ 18 | 19 | #ifndef MM_PLUGIN_ANYDATA_H 20 | #define MM_PLUGIN_ANYDATA_H 21 | 22 | #include "mm-plugin.h" 23 | 24 | #define MM_TYPE_PLUGIN_ANYDATA (mm_plugin_anydata_get_type ()) 25 | #define MM_PLUGIN_ANYDATA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydata)) 26 | #define MM_PLUGIN_ANYDATA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydataClass)) 27 | #define MM_IS_PLUGIN_ANYDATA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_ANYDATA)) 28 | #define MM_IS_PLUGIN_ANYDATA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_ANYDATA)) 29 | #define MM_PLUGIN_ANYDATA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_ANYDATA, MMPluginAnydataClass)) 30 | 31 | typedef struct { 32 | MMPlugin parent; 33 | } MMPluginAnydata; 34 | 35 | typedef struct { 36 | MMPluginClass parent; 37 | } MMPluginAnydataClass; 38 | 39 | GType mm_plugin_anydata_get_type (void); 40 | 41 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 42 | 43 | #endif /* MM_PLUGIN_ANYDATA_H */ 44 | -------------------------------------------------------------------------------- /plugins/cinterion/77-mm-cinterion-port-types.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | 3 | ACTION!="add|change|move|bind", GOTO="mm_cinterion_port_types_end" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e2d", GOTO="mm_cinterion_port_types" 5 | GOTO="mm_cinterion_port_types_end" 6 | 7 | LABEL="mm_cinterion_port_types" 8 | SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" 9 | 10 | # PHS8 11 | ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0053", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_GPS}="1" 12 | 13 | # PLS8 port types 14 | # ttyACM0 (if #0): AT port 15 | # ttyACM1 (if #2): AT port 16 | # ttyACM2 (if #4): GPS data port 17 | # ttyACM3 (if #6): unknown 18 | # ttyACM4 (if #8): unknown 19 | ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_GPS}="1" 20 | ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="06", ENV{ID_MM_PORT_IGNORE}="1" 21 | ATTRS{idVendor}=="1e2d", ATTRS{idProduct}=="0061", ENV{.MM_USBIFNUM}=="08", ENV{ID_MM_PORT_IGNORE}="1" 22 | 23 | LABEL="mm_cinterion_port_types_end" 24 | -------------------------------------------------------------------------------- /plugins/cinterion/mm-plugin-cinterion.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2011 Ammonit Measurement GmbH 20 | * Author: Aleksander Morgado 21 | */ 22 | 23 | #ifndef MM_PLUGIN_CINTERION_H 24 | #define MM_PLUGIN_CINTERION_H 25 | 26 | #include "mm-plugin.h" 27 | 28 | #define MM_TYPE_PLUGIN_CINTERION (mm_plugin_cinterion_get_type ()) 29 | #define MM_PLUGIN_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterion)) 30 | #define MM_PLUGIN_CINTERION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterionClass)) 31 | #define MM_IS_PLUGIN_CINTERION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_CINTERION)) 32 | #define MM_IS_PLUGIN_CINTERION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_CINTERION)) 33 | #define MM_PLUGIN_CINTERION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_CINTERION, MMPluginCinterionClass)) 34 | 35 | typedef struct { 36 | MMPlugin parent; 37 | } MMPluginCinterion; 38 | 39 | typedef struct { 40 | MMPluginClass parent; 41 | } MMPluginCinterionClass; 42 | 43 | GType mm_plugin_cinterion_get_type (void); 44 | 45 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 46 | 47 | #endif /* MM_PLUGIN_CINTERION_H */ 48 | -------------------------------------------------------------------------------- /plugins/dell/77-mm-dell-port-types.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | 3 | ACTION!="add|change|move|bind", GOTO="mm_dell_port_types_end" 4 | 5 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="413c", GOTO="mm_dell_vendorcheck" 6 | GOTO="mm_dell_port_types_end" 7 | 8 | LABEL="mm_dell_vendorcheck" 9 | SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" 10 | 11 | # Dell DW5821e (default 0x81d7, with esim support 0x81e0) 12 | # if 02: primary port 13 | # if 03: secondary port 14 | # if 04: raw NMEA port 15 | # if 05: diag/qcdm port 16 | ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81d7", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 17 | ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81d7", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" 18 | ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81d7", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_GPS}="1" 19 | ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81d7", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_QCDM}="1" 20 | ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81e0", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 21 | ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81e0", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" 22 | ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81e0", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_GPS}="1" 23 | ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81e0", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_QCDM}="1" 24 | 25 | # Dell DW5820e 26 | # if 02: AT port 27 | # if 04: debug port (ignore) 28 | # if 06: AT port 29 | ATTRS{idVendor}=="413c", ATTRS{idProduct}=="81d9", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_IGNORE}="1" 30 | 31 | GOTO="mm_dell_port_types_end" 32 | LABEL="mm_dell_port_types_end" 33 | -------------------------------------------------------------------------------- /plugins/dell/mm-plugin-dell.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2015 Aleksander Morgado 20 | */ 21 | 22 | #ifndef MM_PLUGIN_DELL_H 23 | #define MM_PLUGIN_DELL_H 24 | 25 | #include "mm-plugin.h" 26 | 27 | #define MM_TYPE_PLUGIN_DELL (mm_plugin_dell_get_type ()) 28 | #define MM_PLUGIN_DELL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_DELL, MMPluginDell)) 29 | #define MM_PLUGIN_DELL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_DELL, MMPluginDellClass)) 30 | #define MM_IS_PLUGIN_DELL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_DELL)) 31 | #define MM_IS_PLUGIN_DELL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_DELL)) 32 | #define MM_PLUGIN_DELL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_DELL, MMPluginDellClass)) 33 | 34 | typedef struct { 35 | MMPlugin parent; 36 | } MMPluginDell; 37 | 38 | typedef struct { 39 | MMPluginClass parent; 40 | } MMPluginDellClass; 41 | 42 | GType mm_plugin_dell_get_type (void); 43 | 44 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 45 | 46 | #endif /* MM_PLUGIN_DELL_H */ 47 | -------------------------------------------------------------------------------- /plugins/dlink/77-mm-dlink-port-types.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | 3 | ACTION!="add|change|move|bind", GOTO="mm_dlink_port_types_end" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2001", GOTO="mm_dlink_port_types" 5 | GOTO="mm_dlink_port_types_end" 6 | 7 | LABEL="mm_dlink_port_types" 8 | SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" 9 | 10 | # D-Link DWM-222 11 | ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7e35", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_IGNORE}="1" 12 | ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7e35", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 13 | ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7e35", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" 14 | ATTRS{idVendor}=="2001", ATTRS{idProduct}=="7e35", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_IGNORE}="1" 15 | 16 | LABEL="mm_dlink_port_types_end" 17 | -------------------------------------------------------------------------------- /plugins/dlink/mm-plugin-dlink.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_PLUGIN_DLINK_H 17 | #define MM_PLUGIN_DLINK_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_DLINK (mm_plugin_dlink_get_type ()) 22 | #define MM_PLUGIN_DLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_DLINK, MMPluginDlink)) 23 | #define MM_PLUGIN_DLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_DLINK, MMPluginDlinkClass)) 24 | #define MM_IS_PLUGIN_DLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_DLINK)) 25 | #define MM_IS_PLUGIN_DLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_DLINK)) 26 | #define MM_PLUGIN_DLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_DLINK, MMPluginDlinkClass)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginDlink; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginDlinkClass; 35 | 36 | GType mm_plugin_dlink_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_DLINK_H */ 41 | -------------------------------------------------------------------------------- /plugins/fibocom/77-mm-fibocom-port-types.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | ACTION!="add|change|move|bind", GOTO="mm_fibocom_port_types_end" 3 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2cb7", GOTO="mm_fibocom_port_types" 4 | GOTO="mm_fibocom_port_types_end" 5 | 6 | LABEL="mm_fibocom_port_types" 7 | 8 | SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" 9 | 10 | # Fibocom L850-GL 11 | # ttyACM0 (if #2): AT port 12 | # ttyACM1 (if #4): debug port (ignore) 13 | # ttyACM2 (if #6): AT port 14 | ATTRS{idVendor}=="2cb7", ATTRS{idProduct}=="0007", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_IGNORE}="1" 15 | 16 | LABEL="mm_fibocom_port_types_end" 17 | -------------------------------------------------------------------------------- /plugins/fibocom/mm-plugin-fibocom.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2018 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_PLUGIN_FIBOCOM_H 17 | #define MM_PLUGIN_FIBOCOM_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_FIBOCOM (mm_plugin_fibocom_get_type ()) 22 | #define MM_PLUGIN_FIBOCOM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_FIBOCOM, MMPluginFibocom)) 23 | #define MM_PLUGIN_FIBOCOM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_FIBOCOM, MMPluginFibocomClass)) 24 | #define MM_IS_PLUGIN_FIBOCOM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_FIBOCOM)) 25 | #define MM_IS_PLUGIN_FIBOCOM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_FIBOCOM)) 26 | #define MM_PLUGIN_FIBOCOM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_FIBOCOM, MMPluginFibocomClass)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginFibocom; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginFibocomClass; 35 | 36 | GType mm_plugin_fibocom_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_FIBOCOM_H */ 41 | -------------------------------------------------------------------------------- /plugins/foxconn/77-mm-foxconn-port-types.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | 3 | ACTION!="add|change|move|bind", GOTO="mm_foxconn_port_types_end" 4 | 5 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0489", GOTO="mm_foxconn_vendorcheck" 6 | GOTO="mm_foxconn_port_types_end" 7 | 8 | LABEL="mm_foxconn_vendorcheck" 9 | SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" 10 | 11 | # Foxconn T77w968 (default 0xe0b4, with esim support 0xe0b5) 12 | # if 02: primary port 13 | # if 03: secondary port 14 | # if 04: raw NMEA port 15 | # if 05: diag/qcdm port 16 | ATTRS{idVendor}=="0489", ATTRS{idProduct}=="e0b4", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 17 | ATTRS{idVendor}=="0489", ATTRS{idProduct}=="e0b4", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" 18 | ATTRS{idVendor}=="0489", ATTRS{idProduct}=="e0b4", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_GPS}="1" 19 | ATTRS{idVendor}=="0489", ATTRS{idProduct}=="e0b4", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_QCDM}="1" 20 | ATTRS{idVendor}=="0489", ATTRS{idProduct}=="e0b5", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 21 | ATTRS{idVendor}=="0489", ATTRS{idProduct}=="e0b5", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_SECONDARY}="1" 22 | ATTRS{idVendor}=="0489", ATTRS{idProduct}=="e0b5", ENV{.MM_USBIFNUM}=="04", ENV{ID_MM_PORT_TYPE_GPS}="1" 23 | ATTRS{idVendor}=="0489", ATTRS{idProduct}=="e0b5", ENV{.MM_USBIFNUM}=="05", ENV{ID_MM_PORT_TYPE_QCDM}="1" 24 | 25 | GOTO="mm_foxconn_port_types_end" 26 | LABEL="mm_foxconn_port_types_end" 27 | -------------------------------------------------------------------------------- /plugins/foxconn/mm-plugin-foxconn.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2019 Aleksander Morgado 20 | */ 21 | 22 | #ifndef MM_PLUGIN_FOXCONN_H 23 | #define MM_PLUGIN_FOXCONN_H 24 | 25 | #include "mm-plugin.h" 26 | 27 | #define MM_TYPE_PLUGIN_FOXCONN (mm_plugin_foxconn_get_type ()) 28 | #define MM_PLUGIN_FOXCONN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_FOXCONN, MMPluginFoxconn)) 29 | #define MM_PLUGIN_FOXCONN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_FOXCONN, MMPluginFoxconnClass)) 30 | #define MM_IS_PLUGIN_FOXCONN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_FOXCONN)) 31 | #define MM_IS_PLUGIN_FOXCONN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_FOXCONN)) 32 | #define MM_PLUGIN_FOXCONN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_FOXCONN, MMPluginFoxconnClass)) 33 | 34 | typedef struct { 35 | MMPlugin parent; 36 | } MMPluginFoxconn; 37 | 38 | typedef struct { 39 | MMPluginClass parent; 40 | } MMPluginFoxconnClass; 41 | 42 | GType mm_plugin_foxconn_get_type (void); 43 | 44 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 45 | 46 | #endif /* MM_PLUGIN_FOXCONN_H */ 47 | -------------------------------------------------------------------------------- /plugins/foxconn/mm-shared.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #include "mm-shared.h" 17 | 18 | MM_SHARED_DEFINE_MAJOR_VERSION 19 | MM_SHARED_DEFINE_MINOR_VERSION 20 | MM_SHARED_DEFINE_NAME(Foxconn) 21 | -------------------------------------------------------------------------------- /plugins/generic/mm-plugin-generic.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2009 Red Hat, Inc. 14 | */ 15 | 16 | #ifndef MM_PLUGIN_GENERIC_H 17 | #define MM_PLUGIN_GENERIC_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_GENERIC (mm_plugin_generic_get_type ()) 22 | #define MM_PLUGIN_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_GENERIC, MMPluginGeneric)) 23 | #define MM_PLUGIN_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_GENERIC, MMPluginGenericClass)) 24 | #define MM_IS_PLUGIN_GENERIC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_GENERIC)) 25 | #define MM_IS_PLUGIN_GENERIC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_GENERIC)) 26 | #define MM_PLUGIN_GENERIC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_GENERIC, MMPluginGenericClass)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginGeneric; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginGenericClass; 35 | 36 | GType mm_plugin_generic_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_GENERIC_H */ 41 | -------------------------------------------------------------------------------- /plugins/haier/77-mm-haier-port-types.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | 3 | ACTION!="add|change|move|bind", GOTO="mm_haier_port_types_end" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="201e", GOTO="mm_haier_port_types" 5 | GOTO="mm_haier_port_types_end" 6 | 7 | LABEL="mm_haier_port_types" 8 | SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" 9 | 10 | # Haier CE81B 11 | ATTRS{idVendor}=="201e", ATTRS{idProduct}=="10f8", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 12 | 13 | LABEL="mm_haier_port_types_end" 14 | -------------------------------------------------------------------------------- /plugins/haier/mm-plugin-haier.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2014 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_PLUGIN_HAIER_H 17 | #define MM_PLUGIN_HAIER_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_HAIER (mm_plugin_haier_get_type ()) 22 | #define MM_PLUGIN_HAIER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_HAIER, MMPluginHaier)) 23 | #define MM_PLUGIN_HAIER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_HAIER, MMPluginHaierClass)) 24 | #define MM_IS_PLUGIN_HAIER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_HAIER)) 25 | #define MM_IS_PLUGIN_HAIER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_HAIER)) 26 | #define MM_PLUGIN_HAIER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_HAIER, MMPluginHaierClass)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginHaier; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginHaierClass; 35 | 36 | GType mm_plugin_haier_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_HAIER_H */ 41 | -------------------------------------------------------------------------------- /plugins/huawei/77-mm-huawei-net-port-types.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | ACTION!="add|change|move|bind", GOTO="mm_huawei_port_types_end" 3 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="12d1", GOTO="mm_huawei_port_types" 4 | GOTO="mm_huawei_port_types_end" 5 | 6 | LABEL="mm_huawei_port_types" 7 | 8 | # MU609 does not support getportmode (crashes modem with default firmware) 9 | ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1573", ENV{ID_MM_HUAWEI_DISABLE_GETPORTMODE}="1" 10 | 11 | # Mark the modem and at port flags for ModemManager 12 | SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_PORT_TYPE_AT_PPP}="1" 13 | SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 14 | SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="01", ENV{ID_MM_PORT_TYPE_AT_PPP}="1" 15 | SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="02", ATTRS{bInterfaceProtocol}=="02", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 16 | 17 | # GPS NMEA port on MU609 18 | SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="05", ENV{ID_MM_PORT_TYPE_GPS}="1" 19 | # GPS NMEA port on MU909 20 | SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="ff", ATTRS{bInterfaceSubClass}=="01", ATTRS{bInterfaceProtocol}=="14", ENV{ID_MM_PORT_TYPE_GPS}="1" 21 | 22 | # Only the standard ECM or NCM port can support dial-up with AT NDISDUP through AT port 23 | SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="02", ATTRS{bInterfaceSubClass}=="06",ATTRS{bInterfaceProtocol}=="00", ENV{ID_MM_HUAWEI_NDISDUP_SUPPORTED}="1" 24 | SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="02", ATTRS{bInterfaceSubClass}=="0d",ATTRS{bInterfaceProtocol}=="00", ENV{ID_MM_HUAWEI_NDISDUP_SUPPORTED}="1" 25 | 26 | # Airtel branded E3372h-607, using huawei-cdc-ncm driver but with unresponsive cdc-wdm port 27 | ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1506", ENV{ID_MM_HUAWEI_NDISDUP_SUPPORTED}="1" 28 | 29 | LABEL="mm_huawei_port_types_end" 30 | -------------------------------------------------------------------------------- /plugins/huawei/mm-plugin-huawei.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_MODEM_HELPERS_ICERA_H 17 | #define MM_MODEM_HELPERS_ICERA_H 18 | 19 | #include "glib.h" 20 | 21 | /* %IPDPADDR response parser */ 22 | gboolean mm_icera_parse_ipdpaddr_response (const gchar *response, 23 | guint expected_cid, 24 | MMBearerIpConfig **out_ip4_config, 25 | MMBearerIpConfig **out_ip6_config, 26 | GError **error); 27 | 28 | #endif /* MM_MODEM_HELPERS_HUAWEI_H */ 29 | -------------------------------------------------------------------------------- /plugins/icera/mm-shared.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #include "mm-shared.h" 17 | 18 | MM_SHARED_DEFINE_MAJOR_VERSION 19 | MM_SHARED_DEFINE_MINOR_VERSION 20 | MM_SHARED_DEFINE_NAME(Icera) 21 | -------------------------------------------------------------------------------- /plugins/iridium/mm-plugin-iridium.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2011 - 2012 Ammonit Measurement GmbH 20 | * Author: Aleksander Morgado 21 | */ 22 | 23 | #ifndef MM_PLUGIN_IRIDIUM_H 24 | #define MM_PLUGIN_IRIDIUM_H 25 | 26 | #include "mm-plugin.h" 27 | 28 | #define MM_TYPE_PLUGIN_IRIDIUM (mm_plugin_iridium_get_type ()) 29 | #define MM_PLUGIN_IRIDIUM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridium)) 30 | #define MM_PLUGIN_IRIDIUM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridiumClass)) 31 | #define MM_IS_PLUGIN_IRIDIUM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_IRIDIUM)) 32 | #define MM_IS_PLUGIN_IRIDIUM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_IRIDIUM)) 33 | #define MM_PLUGIN_IRIDIUM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_IRIDIUM, MMPluginIridiumClass)) 34 | 35 | typedef struct { 36 | MMPlugin parent; 37 | } MMPluginIridium; 38 | 39 | typedef struct { 40 | MMPluginClass parent; 41 | } MMPluginIridiumClass; 42 | 43 | GType mm_plugin_iridium_get_type (void); 44 | 45 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 46 | 47 | #endif /* MM_PLUGIN_IRIDIUM_H */ 48 | -------------------------------------------------------------------------------- /plugins/linktop/mm-modem-helpers-linktop.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2016 Red Hat, Inc. 15 | * Copyright (C) 2016 Aleksander Morgado 16 | */ 17 | 18 | #include "mm-log.h" 19 | #include "mm-modem-helpers.h" 20 | #include "mm-modem-helpers-linktop.h" 21 | 22 | /*****************************************************************************/ 23 | 24 | gboolean 25 | mm_linktop_parse_cfun_query_current_modes (const gchar *response, 26 | MMModemMode *allowed, 27 | GError **error) 28 | { 29 | guint state; 30 | 31 | g_assert (allowed); 32 | 33 | if (!mm_3gpp_parse_cfun_query_response (response, &state, error)) 34 | return FALSE; 35 | 36 | switch (state) { 37 | case LINKTOP_MODE_OFFLINE: 38 | case LINKTOP_MODE_LOW_POWER: 39 | *allowed = MM_MODEM_MODE_NONE; 40 | return TRUE; 41 | case LINKTOP_MODE_2G: 42 | *allowed = MM_MODEM_MODE_2G; 43 | return TRUE; 44 | case LINKTOP_MODE_3G: 45 | *allowed = MM_MODEM_MODE_3G; 46 | return TRUE; 47 | case LINKTOP_MODE_ANY: 48 | *allowed = (MM_MODEM_MODE_2G | MM_MODEM_MODE_3G); 49 | return TRUE; 50 | default: 51 | g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, 52 | "Unknown linktop +CFUN current mode: %u", state); 53 | return FALSE; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /plugins/linktop/mm-modem-helpers-linktop.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2016 Red Hat, Inc. 15 | * Copyright (C) 2016 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_MODEM_HELPERS_LINKTOP_H 19 | #define MM_MODEM_HELPERS_LINKTOP_H 20 | 21 | #include 22 | 23 | #include 24 | #define _LIBMM_INSIDE_MM 25 | #include 26 | 27 | typedef enum { 28 | LINKTOP_MODE_OFFLINE = 0, 29 | LINKTOP_MODE_ANY = 1, 30 | LINKTOP_MODE_LOW_POWER = 4, 31 | LINKTOP_MODE_2G = 5, 32 | LINKTOP_MODE_3G = 6, 33 | } MMLinktopMode; 34 | 35 | /* AT+CFUN? response parsers */ 36 | gboolean mm_linktop_parse_cfun_query_current_modes (const gchar *response, 37 | MMModemMode *allowed, 38 | GError **error); 39 | 40 | #endif /* MM_MODEM_HELPERS_LINKTOP_H */ 41 | -------------------------------------------------------------------------------- /plugins/linktop/mm-plugin-linktop.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_LINKTOP_H 19 | #define MM_PLUGIN_LINKTOP_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_LINKTOP (mm_plugin_linktop_get_type ()) 24 | #define MM_PLUGIN_LINKTOP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktop)) 25 | #define MM_PLUGIN_LINKTOP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktopClass)) 26 | #define MM_IS_PLUGIN_LINKTOP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_LINKTOP)) 27 | #define MM_IS_PLUGIN_LINKTOP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_LINKTOP)) 28 | #define MM_PLUGIN_LINKTOP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_LINKTOP, MMPluginLinktopClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginLinktop; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginLinktopClass; 37 | 38 | GType mm_plugin_linktop_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_LINKTOP_H */ 43 | -------------------------------------------------------------------------------- /plugins/longcheer/mm-plugin-longcheer.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_LONGCHEER_H 19 | #define MM_PLUGIN_LONGCHEER_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_LONGCHEER (mm_plugin_longcheer_get_type ()) 24 | #define MM_PLUGIN_LONGCHEER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_LONGCHEER, MMPluginLongcheer)) 25 | #define MM_PLUGIN_LONGCHEER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_LONGCHEER, MMPluginLongcheerClass)) 26 | #define MM_IS_PLUGIN_LONGCHEER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_LONGCHEER)) 27 | #define MM_IS_PLUGIN_LONGCHEER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_LONGCHEER)) 28 | #define MM_PLUGIN_LONGCHEER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_LONGCHEER, MMPluginLongcheerClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginLongcheer; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginLongcheerClass; 37 | 38 | GType mm_plugin_longcheer_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_LONGCHEER_H */ 43 | -------------------------------------------------------------------------------- /plugins/mbm/mm-plugin-mbm.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 Ericsson AB 14 | * Copyright (C) 2012 Lanedo GmbH 15 | * 16 | * Author: Per Hallsmark 17 | */ 18 | 19 | #ifndef MM_PLUGIN_MBM_H 20 | #define MM_PLUGIN_MBM_H 21 | 22 | #include "mm-plugin.h" 23 | 24 | #define MM_TYPE_PLUGIN_MBM (mm_plugin_mbm_get_type ()) 25 | #define MM_PLUGIN_MBM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_MBM, MMPluginMbm)) 26 | #define MM_PLUGIN_MBM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_MBM, MMPluginMbmClass)) 27 | #define MM_IS_PLUGIN_MBM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_MBM)) 28 | #define MM_IS_PLUGIN_MBM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_MBM)) 29 | #define MM_PLUGIN_MBM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_MBM, MMPluginMbmClass)) 30 | 31 | typedef struct { 32 | MMPlugin parent; 33 | } MMPluginMbm; 34 | 35 | typedef struct { 36 | MMPluginClass parent; 37 | } MMPluginMbmClass; 38 | 39 | GType mm_plugin_mbm_get_type (void); 40 | 41 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 42 | 43 | #endif /* MM_PLUGIN_MBM_H */ 44 | -------------------------------------------------------------------------------- /plugins/mbm/mm-sim-mbm.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2013 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_SIM_MBM_H 17 | #define MM_SIM_MBM_H 18 | 19 | #include 20 | #include 21 | 22 | #include "mm-base-sim.h" 23 | 24 | #define MM_TYPE_SIM_MBM (mm_sim_mbm_get_type ()) 25 | #define MM_SIM_MBM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_MBM, MMSimMbm)) 26 | #define MM_SIM_MBM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SIM_MBM, MMSimMbmClass)) 27 | #define MM_IS_SIM_MBM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SIM_MBM)) 28 | #define MM_IS_SIM_MBM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SIM_MBM)) 29 | #define MM_SIM_MBM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SIM_MBM, MMSimMbmClass)) 30 | 31 | typedef struct _MMSimMbm MMSimMbm; 32 | typedef struct _MMSimMbmClass MMSimMbmClass; 33 | 34 | struct _MMSimMbm { 35 | MMBaseSim parent; 36 | }; 37 | 38 | struct _MMSimMbmClass { 39 | MMBaseSimClass parent; 40 | }; 41 | 42 | GType mm_sim_mbm_get_type (void); 43 | 44 | void mm_sim_mbm_new (MMBaseModem *modem, 45 | GCancellable *cancellable, 46 | GAsyncReadyCallback callback, 47 | gpointer user_data); 48 | MMBaseSim *mm_sim_mbm_new_finish (GAsyncResult *res, 49 | GError **error); 50 | 51 | #endif /* MM_SIM_MBM_H */ 52 | -------------------------------------------------------------------------------- /plugins/motorola/mm-plugin-motorola.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_MOTOROLA_H 19 | #define MM_PLUGIN_MOTOROLA_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_MOTOROLA (mm_plugin_motorola_get_type ()) 24 | #define MM_PLUGIN_MOTOROLA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorola)) 25 | #define MM_PLUGIN_MOTOROLA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorolaClass)) 26 | #define MM_IS_PLUGIN_MOTOROLA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_MOTOROLA)) 27 | #define MM_IS_PLUGIN_MOTOROLA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_MOTOROLA)) 28 | #define MM_PLUGIN_MOTOROLA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_MOTOROLA, MMPluginMotorolaClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginMotorola; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginMotorolaClass; 37 | 38 | GType mm_plugin_motorola_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_MOTOROLA_H */ 43 | -------------------------------------------------------------------------------- /plugins/mtk/mm-plugin-mtk.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_MTK_H 19 | #define MM_PLUGIN_MTK_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_MTK (mm_plugin_mtk_get_type ()) 24 | #define MM_PLUGIN_MTK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_MTK, MMPluginMtk)) 25 | #define MM_PLUGIN_MTK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_MTK, MMPluginMtkClass)) 26 | #define MM_IS_PLUGIN_MTK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_MTK)) 27 | #define MM_IS_PLUGIN_MTK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_MTK)) 28 | #define MM_PLUGIN_MTK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_MTK, MMPluginMtkClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginMtk; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginMtkClass; 37 | 38 | GType mm_plugin_mtk_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_MTK_H */ 43 | -------------------------------------------------------------------------------- /plugins/nokia/77-mm-nokia-port-types.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | 3 | ACTION!="add|change|move|bind", GOTO="mm_nokia_port_types_end" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="0421", GOTO="mm_nokia_port_types" 5 | GOTO="mm_nokia_port_types_end" 6 | 7 | LABEL="mm_nokia_port_types" 8 | SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" 9 | 10 | # For Nokia Internet Sticks (CS-xx) the modem/PPP port appears to always be USB interface 1 11 | 12 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="060D", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 13 | 14 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0611", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 15 | 16 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="061A", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 17 | 18 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="061B", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 19 | 20 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="061F", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 21 | 22 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0619", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 23 | 24 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0620", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 25 | 26 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0623", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 27 | 28 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0624", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 29 | 30 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="0625", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 31 | 32 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="062A", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 33 | 34 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="062E", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 35 | 36 | ATTRS{idVendor}=="0421", ATTRS{idProduct}=="062F", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 37 | 38 | LABEL="mm_nokia_port_types_end" 39 | -------------------------------------------------------------------------------- /plugins/nokia/mm-plugin-nokia-icera.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 14 | * Copyright (C) 2012 Aleksander Morgado 15 | */ 16 | 17 | #ifndef MM_PLUGIN_NOKIA_ICERA_H 18 | #define MM_PLUGIN_NOKIA_ICERA_H 19 | 20 | #include "mm-plugin.h" 21 | 22 | #define MM_TYPE_PLUGIN_NOKIA_ICERA (mm_plugin_nokia_icera_get_type ()) 23 | #define MM_PLUGIN_NOKIA_ICERA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOKIA_ICERA, MMPluginNokiaIcera)) 24 | #define MM_PLUGIN_NOKIA_ICERA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_NOKIA_ICERA, MMPluginNokiaIceraClass)) 25 | #define MM_IS_PLUGIN_NOKIA_ICERA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_NOKIA_ICERA)) 26 | #define MM_IS_PLUGIN_NOKIA_ICERA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_NOKIA_ICERA)) 27 | #define MM_PLUGIN_NOKIA_ICERA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOKIA_ICERA, MMPluginNokiaIceraClass)) 28 | 29 | typedef struct { 30 | MMPlugin parent; 31 | } MMPluginNokiaIcera; 32 | 33 | typedef struct { 34 | MMPluginClass parent; 35 | } MMPluginNokiaIceraClass; 36 | 37 | GType mm_plugin_nokia_icera_get_type (void); 38 | 39 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 40 | 41 | #endif /* MM_PLUGIN_NOKIA_ICERA_H */ 42 | -------------------------------------------------------------------------------- /plugins/nokia/mm-plugin-nokia.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 Red Hat, Inc. 15 | */ 16 | 17 | #ifndef MM_PLUGIN_NOKIA_H 18 | #define MM_PLUGIN_NOKIA_H 19 | 20 | #include "mm-plugin.h" 21 | 22 | #define MM_TYPE_PLUGIN_NOKIA (mm_plugin_nokia_get_type ()) 23 | #define MM_PLUGIN_NOKIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOKIA, MMPluginNokia)) 24 | #define MM_PLUGIN_NOKIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_NOKIA, MMPluginNokiaClass)) 25 | #define MM_IS_PLUGIN_NOKIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_NOKIA)) 26 | #define MM_IS_PLUGIN_NOKIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_NOKIA)) 27 | #define MM_PLUGIN_NOKIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOKIA, MMPluginNokiaClass)) 28 | 29 | typedef struct { 30 | MMPlugin parent; 31 | } MMPluginNokia; 32 | 33 | typedef struct { 34 | MMPluginClass parent; 35 | } MMPluginNokiaClass; 36 | 37 | GType mm_plugin_nokia_get_type (void); 38 | 39 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 40 | 41 | #endif /* MM_PLUGIN_NOKIA_H */ 42 | -------------------------------------------------------------------------------- /plugins/nokia/mm-sim-nokia.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2012 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_SIM_NOKIA_H 17 | #define MM_SIM_NOKIA_H 18 | 19 | #include 20 | #include 21 | 22 | #include "mm-base-sim.h" 23 | 24 | #define MM_TYPE_SIM_NOKIA (mm_sim_nokia_get_type ()) 25 | #define MM_SIM_NOKIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_NOKIA, MMSimNokia)) 26 | #define MM_SIM_NOKIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SIM_NOKIA, MMSimNokiaClass)) 27 | #define MM_IS_SIM_NOKIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SIM_NOKIA)) 28 | #define MM_IS_SIM_NOKIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SIM_NOKIA)) 29 | #define MM_SIM_NOKIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SIM_NOKIA, MMSimNokiaClass)) 30 | 31 | typedef struct _MMSimNokia MMSimNokia; 32 | typedef struct _MMSimNokiaClass MMSimNokiaClass; 33 | 34 | struct _MMSimNokia { 35 | MMBaseSim parent; 36 | }; 37 | 38 | struct _MMSimNokiaClass { 39 | MMBaseSimClass parent; 40 | }; 41 | 42 | GType mm_sim_nokia_get_type (void); 43 | 44 | void mm_sim_nokia_new (MMBaseModem *modem, 45 | GCancellable *cancellable, 46 | GAsyncReadyCallback callback, 47 | gpointer user_data); 48 | MMBaseSim *mm_sim_nokia_new_finish (GAsyncResult *res, 49 | GError **error); 50 | 51 | #endif /* MM_SIM_NOKIA_H */ 52 | -------------------------------------------------------------------------------- /plugins/novatel/mm-common-novatel.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2015 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_COMMON_NOVATEL_H 17 | #define MM_COMMON_NOVATEL_H 18 | 19 | #include "glib.h" 20 | #include "mm-plugin.h" 21 | 22 | void mm_common_novatel_custom_init (MMPortProbe *probe, 23 | MMPortSerialAt *port, 24 | GCancellable *cancellable, 25 | GAsyncReadyCallback callback, 26 | gpointer user_data); 27 | gboolean mm_common_novatel_custom_init_finish (MMPortProbe *probe, 28 | GAsyncResult *result, 29 | GError **error); 30 | 31 | #endif /* MM_COMMON_NOVATEL_H */ 32 | -------------------------------------------------------------------------------- /plugins/novatel/mm-plugin-novatel-lte.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2012 Google Inc. 20 | * Author: Nathan Williams 21 | */ 22 | 23 | #ifndef MM_PLUGIN_NOVATEL_LTE_H 24 | #define MM_PLUGIN_NOVATEL_LTE_H 25 | 26 | #include "mm-plugin.h" 27 | 28 | #define MM_TYPE_PLUGIN_NOVATEL_LTE (mm_plugin_novatel_lte_get_type ()) 29 | #define MM_PLUGIN_NOVATEL_LTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOVATEL_LTE, MMPluginNovatelLte)) 30 | #define MM_PLUGIN_NOVATEL_LTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_NOVATEL_LTE, MMPluginNovatelLteClass)) 31 | #define MM_IS_PLUGIN_NOVATEL_LTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_NOVATEL_LTE)) 32 | #define MM_IS_PLUGIN_NOVATEL_LTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_NOVATEL_LTE)) 33 | #define MM_PLUGIN_NOVATEL_LTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOVATEL_LTE, MMPluginNovatelLteClass)) 34 | 35 | typedef struct { 36 | MMPlugin parent; 37 | } MMPluginNovatelLte; 38 | 39 | typedef struct { 40 | MMPluginClass parent; 41 | } MMPluginNovatelLteClass; 42 | 43 | GType mm_plugin_novatel_lte_get_type (void); 44 | 45 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 46 | 47 | #endif /* MM_PLUGIN_NOVATEL_LTE_H */ 48 | -------------------------------------------------------------------------------- /plugins/novatel/mm-plugin-novatel.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2008 - 2009 Novell, Inc. 20 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 21 | * Copyright (C) 2012 Aleksander Morgado 22 | */ 23 | 24 | #ifndef MM_PLUGIN_NOVATEL_H 25 | #define MM_PLUGIN_NOVATEL_H 26 | 27 | #include "mm-plugin.h" 28 | 29 | #define MM_TYPE_PLUGIN_NOVATEL (mm_plugin_novatel_get_type ()) 30 | #define MM_PLUGIN_NOVATEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatel)) 31 | #define MM_PLUGIN_NOVATEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatelClass)) 32 | #define MM_IS_PLUGIN_NOVATEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_NOVATEL)) 33 | #define MM_IS_PLUGIN_NOVATEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_NOVATEL)) 34 | #define MM_PLUGIN_NOVATEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_NOVATEL, MMPluginNovatelClass)) 35 | 36 | typedef struct { 37 | MMPlugin parent; 38 | } MMPluginNovatel; 39 | 40 | typedef struct { 41 | MMPluginClass parent; 42 | } MMPluginNovatelClass; 43 | 44 | GType mm_plugin_novatel_get_type (void); 45 | 46 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 47 | 48 | #endif /* MM_PLUGIN_NOVATEL_H */ 49 | -------------------------------------------------------------------------------- /plugins/novatel/mm-shared.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #include "mm-shared.h" 17 | 18 | MM_SHARED_DEFINE_MAJOR_VERSION 19 | MM_SHARED_DEFINE_MINOR_VERSION 20 | MM_SHARED_DEFINE_NAME(Novatel) 21 | -------------------------------------------------------------------------------- /plugins/option/mm-plugin-hso.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your hso) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_HSO_H 19 | #define MM_PLUGIN_HSO_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_HSO (mm_plugin_hso_get_type ()) 24 | #define MM_PLUGIN_HSO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_HSO, MMPluginHso)) 25 | #define MM_PLUGIN_HSO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_HSO, MMPluginHsoClass)) 26 | #define MM_IS_PLUGIN_HSO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_HSO)) 27 | #define MM_IS_PLUGIN_HSO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_HSO)) 28 | #define MM_PLUGIN_HSO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_HSO, MMPluginHsoClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginHso; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginHsoClass; 37 | 38 | GType mm_plugin_hso_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_HSO_H */ 43 | -------------------------------------------------------------------------------- /plugins/option/mm-plugin-option.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_OPTION_H 19 | #define MM_PLUGIN_OPTION_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_OPTION (mm_plugin_option_get_type ()) 24 | #define MM_PLUGIN_OPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_OPTION, MMPluginOption)) 25 | #define MM_PLUGIN_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_OPTION, MMPluginOptionClass)) 26 | #define MM_IS_PLUGIN_OPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_OPTION)) 27 | #define MM_IS_PLUGIN_OPTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_OPTION)) 28 | #define MM_PLUGIN_OPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_OPTION, MMPluginOptionClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginOption; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginOptionClass; 37 | 38 | GType mm_plugin_option_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_OPTION_H */ 43 | -------------------------------------------------------------------------------- /plugins/option/mm-shared.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #include "mm-shared.h" 17 | 18 | MM_SHARED_DEFINE_MAJOR_VERSION 19 | MM_SHARED_DEFINE_MINOR_VERSION 20 | MM_SHARED_DEFINE_NAME(Option) 21 | -------------------------------------------------------------------------------- /plugins/pantech/mm-plugin-pantech.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2012 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_PLUGIN_PANTECH_H 17 | #define MM_PLUGIN_PANTECH_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_PANTECH (mm_plugin_pantech_get_type ()) 22 | #define MM_PLUGIN_PANTECH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_PANTECH, MMPluginPantech)) 23 | #define MM_PLUGIN_PANTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_PANTECH, MMPluginPantechClass)) 24 | #define MM_IS_PLUGIN_PANTECH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_PANTECH)) 25 | #define MM_IS_PLUGIN_PANTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_PANTECH)) 26 | #define MM_PLUGIN_PANTECH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_PANTECH, MMPluginPantechClass)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginPantech; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginPantechClass; 35 | 36 | GType mm_plugin_pantech_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_PANTECH_H */ 41 | -------------------------------------------------------------------------------- /plugins/pantech/mm-sim-pantech.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2012 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_SIM_PANTECH_H 17 | #define MM_SIM_PANTECH_H 18 | 19 | #include 20 | #include 21 | 22 | #include "mm-base-sim.h" 23 | 24 | #define MM_TYPE_SIM_PANTECH (mm_sim_pantech_get_type ()) 25 | #define MM_SIM_PANTECH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_PANTECH, MMSimPantech)) 26 | #define MM_SIM_PANTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SIM_PANTECH, MMSimPantechClass)) 27 | #define MM_IS_SIM_PANTECH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SIM_PANTECH)) 28 | #define MM_IS_SIM_PANTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SIM_PANTECH)) 29 | #define MM_SIM_PANTECH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SIM_PANTECH, MMSimPantechClass)) 30 | 31 | typedef struct _MMSimPantech MMSimPantech; 32 | typedef struct _MMSimPantechClass MMSimPantechClass; 33 | 34 | struct _MMSimPantech { 35 | MMBaseSim parent; 36 | }; 37 | 38 | struct _MMSimPantechClass { 39 | MMBaseSimClass parent; 40 | }; 41 | 42 | GType mm_sim_pantech_get_type (void); 43 | 44 | void mm_sim_pantech_new (MMBaseModem *modem, 45 | GCancellable *cancellable, 46 | GAsyncReadyCallback callback, 47 | gpointer user_data); 48 | MMBaseSim *mm_sim_pantech_new_finish (GAsyncResult *res, 49 | GError **error); 50 | 51 | #endif /* MM_SIM_PANTECH_H */ 52 | -------------------------------------------------------------------------------- /plugins/quectel/mm-plugin-quectel.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2017 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_PLUGIN_QUECTEL_H 17 | #define MM_PLUGIN_QUECTEL_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_QUECTEL (mm_plugin_quectel_get_type ()) 22 | #define MM_PLUGIN_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_QUECTEL, MMPluginQuectel)) 23 | #define MM_PLUGIN_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_QUECTEL, MMPluginQuectelClass)) 24 | #define MM_IS_PLUGIN_QUECTEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_QUECTEL)) 25 | #define MM_IS_PLUGIN_QUECTEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_QUECTEL)) 26 | #define MM_PLUGIN_QUECTEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_QUECTEL, MMPluginQuectelClass)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginQuectel; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginQuectelClass; 35 | 36 | GType mm_plugin_quectel_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_QUECTEL_H */ 41 | -------------------------------------------------------------------------------- /plugins/samsung/mm-plugin-samsung.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2011 Samsung Electronics, Inc. 20 | * Copyright (C) 2012 Google Inc. 21 | * Author: Nathan Williams 22 | */ 23 | 24 | #ifndef MM_PLUGIN_SAMSUNG_H 25 | #define MM_PLUGIN_SAMSUNG_H 26 | 27 | #include "mm-plugin.h" 28 | 29 | #define MM_TYPE_PLUGIN_SAMSUNG (mm_plugin_samsung_get_type ()) 30 | #define MM_PLUGIN_SAMSUNG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SAMSUNG, MMPluginSamsung)) 31 | #define MM_PLUGIN_SAMSUNG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_SAMSUNG, MMPluginSamsungClass)) 32 | #define MM_IS_PLUGIN_SAMSUNG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_SAMSUNG)) 33 | #define MM_IS_PLUGIN_SAMSUNG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_SAMSUNG)) 34 | #define MM_PLUGIN_SAMSUNG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SAMSUNG, MMPluginSamsungClass)) 35 | 36 | typedef struct { 37 | MMPlugin parent; 38 | } MMPluginSamsung; 39 | 40 | typedef struct { 41 | MMPluginClass parent; 42 | } MMPluginSamsungClass; 43 | 44 | GType mm_plugin_samsung_get_type (void); 45 | 46 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 47 | 48 | #endif /* MM_PLUGIN_SAMSUNG_H */ 49 | -------------------------------------------------------------------------------- /plugins/sierra/77-mm-sierra.rules: -------------------------------------------------------------------------------- 1 | 2 | # do not edit this file, it will be overwritten on update 3 | ACTION!="add|change|move|bind", GOTO="mm_sierra_end" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="1199", GOTO="mm_sierra" 5 | GOTO="mm_sierra_end" 6 | 7 | LABEL="mm_sierra" 8 | SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" 9 | 10 | # Netgear AC341U: enable connection status polling explicitly 11 | ATTRS{idVendor}=="1199", ATTRS{idProduct}=="9057", ENV{ID_MM_QMI_CONNECTION_STATUS_POLLING_ENABLE}="1" 12 | 13 | # MC74XX: Add port hints 14 | # if 03: primary port 15 | # if 02: raw NMEA port 16 | # if 00: diag/qcdm port 17 | ATTRS{idVendor}=="1199", ATTRS{idProduct}=="9071", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 18 | ATTRS{idVendor}=="1199", ATTRS{idProduct}=="9071", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_GPS}="1" 19 | ATTRS{idVendor}=="1199", ATTRS{idProduct}=="9071", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_QCDM}="1" 20 | 21 | # EM7565: Add port hints 22 | # if 03: primary port 23 | # if 02: raw NMEA port 24 | # if 00: diag/qcdm port 25 | ATTRS{idVendor}=="1199", ATTRS{idProduct}=="9091", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 26 | ATTRS{idVendor}=="1199", ATTRS{idProduct}=="9091", ENV{.MM_USBIFNUM}=="02", ENV{ID_MM_PORT_TYPE_GPS}="1" 27 | ATTRS{idVendor}=="1199", ATTRS{idProduct}=="9091", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_TYPE_QCDM}="1" 28 | 29 | LABEL="mm_sierra_end" 30 | -------------------------------------------------------------------------------- /plugins/sierra/mm-modem-helpers-sierra.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2018 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_MODEM_HELPERS_SIERRA_H 17 | #define MM_MODEM_HELPERS_SIERRA_H 18 | 19 | #include 20 | #include 21 | 22 | /* MM3gppPdpContextActive list */ 23 | GList *mm_sierra_parse_scact_read_response (const gchar *reply, 24 | GError **error); 25 | 26 | #endif /* MM_MODEM_HELPERS_SIERRA_H */ 27 | -------------------------------------------------------------------------------- /plugins/sierra/mm-plugin-sierra-legacy.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2015 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_PLUGIN_SIERRA_LEGACY_H 17 | #define MM_PLUGIN_SIERRA_LEGACY_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_SIERRA_LEGACY (mm_plugin_sierra_legacy_get_type ()) 22 | #define MM_PLUGIN_SIERRA_LEGACY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SIERRA_LEGACY, MMPluginSierraLegacy)) 23 | #define MM_PLUGIN_SIERRA_LEGACY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_SIERRA_LEGACY, MMPluginSierraLegacyClass)) 24 | #define MM_IS_PLUGIN_SIERRA_LEGACY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_SIERRA_LEGACY)) 25 | #define MM_IS_PLUGIN_SIERRA_LEGACY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_SIERRA_LEGACY)) 26 | #define MM_PLUGIN_SIERRA_LEGACY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SIERRA_LEGACY, MMPluginSierraLegacyClass)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginSierraLegacy; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginSierraLegacyClass; 35 | 36 | GType mm_plugin_sierra_legacy_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_SIERRA_LEGACY_H */ 41 | -------------------------------------------------------------------------------- /plugins/sierra/mm-plugin-sierra.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Lanedo GmbH 16 | */ 17 | 18 | #ifndef MM_PLUGIN_SIERRA_H 19 | #define MM_PLUGIN_SIERRA_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_SIERRA (mm_plugin_sierra_get_type ()) 24 | #define MM_PLUGIN_SIERRA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SIERRA, MMPluginSierra)) 25 | #define MM_PLUGIN_SIERRA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_SIERRA, MMPluginSierraClass)) 26 | #define MM_IS_PLUGIN_SIERRA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_SIERRA)) 27 | #define MM_IS_PLUGIN_SIERRA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_SIERRA)) 28 | #define MM_PLUGIN_SIERRA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SIERRA, MMPluginSierraClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginSierra; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginSierraClass; 37 | 38 | GType mm_plugin_sierra_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_SIERRA_H */ 43 | -------------------------------------------------------------------------------- /plugins/sierra/mm-shared.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #include "mm-shared.h" 17 | 18 | MM_SHARED_DEFINE_MAJOR_VERSION 19 | MM_SHARED_DEFINE_MINOR_VERSION 20 | MM_SHARED_DEFINE_NAME(Sierra) 21 | -------------------------------------------------------------------------------- /plugins/simtech/mm-plugin-simtech.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_SIMTECH_H 19 | #define MM_PLUGIN_SIMTECH_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_SIMTECH (mm_plugin_simtech_get_type ()) 24 | #define MM_PLUGIN_SIMTECH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtech)) 25 | #define MM_PLUGIN_SIMTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtechClass)) 26 | #define MM_IS_PLUGIN_SIMTECH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_SIMTECH)) 27 | #define MM_IS_PLUGIN_SIMTECH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_SIMTECH)) 28 | #define MM_PLUGIN_SIMTECH_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_SIMTECH, MMPluginSimtechClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginSimtech; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginSimtechClass; 37 | 38 | GType mm_plugin_simtech_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_SIMTECH_H */ 43 | -------------------------------------------------------------------------------- /plugins/telit/mm-common-telit.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2015 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_COMMON_TELIT_H 17 | #define MM_COMMON_TELIT_H 18 | 19 | #include "glib.h" 20 | #include "mm-plugin.h" 21 | 22 | gboolean 23 | telit_custom_init_finish (MMPortProbe *probe, 24 | GAsyncResult *result, 25 | GError **error); 26 | 27 | void 28 | telit_custom_init (MMPortProbe *probe, 29 | MMPortSerialAt *port, 30 | GCancellable *cancellable, 31 | GAsyncReadyCallback callback, 32 | gpointer user_data); 33 | 34 | gboolean 35 | telit_grab_port (MMPlugin *self, 36 | MMBaseModem *modem, 37 | MMPortProbe *probe, 38 | GError **error); 39 | 40 | #endif /* MM_COMMON_TELIT_H */ 41 | -------------------------------------------------------------------------------- /plugins/telit/mm-plugin-telit.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2013 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_TELIT_H 19 | #define MM_PLUGIN_TELIT_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_TELIT (mm_plugin_telit_get_type ()) 24 | #define MM_PLUGIN_TELIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_TELIT, MMPluginTelit)) 25 | #define MM_PLUGIN_TELIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_TELIT, MMPluginTelitClass)) 26 | #define MM_IS_PLUGIN_TELIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_TELIT)) 27 | #define MM_IS_PLUGIN_TELIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_TELIT)) 28 | #define MM_PLUGIN_TELIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_TELIT, MMPluginTelitClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginTelit; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginTelitClass; 37 | 38 | GType mm_plugin_telit_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_TELIT_H */ 43 | -------------------------------------------------------------------------------- /plugins/telit/mm-shared.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #include "mm-shared.h" 17 | 18 | MM_SHARED_DEFINE_MAJOR_VERSION 19 | MM_SHARED_DEFINE_MINOR_VERSION 20 | MM_SHARED_DEFINE_NAME(Telit) 21 | -------------------------------------------------------------------------------- /plugins/tests/test-fixture.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2013 Aleksander Morgado 14 | */ 15 | 16 | #ifndef TEST_FIXTURE_H 17 | #define TEST_FIXTURE_H 18 | 19 | #include 20 | #include 21 | #include "mm-gdbus-test.h" 22 | 23 | /*****************************************************************************/ 24 | /* Test fixture setup */ 25 | 26 | /* The fixture contains a GTestDBus object and 27 | * a proxy to the service we're going to be testing. 28 | */ 29 | typedef struct { 30 | GTestDBus *dbus; 31 | MmGdbusTest *test; 32 | GDBusConnection *connection; 33 | } TestFixture; 34 | 35 | void test_fixture_setup (TestFixture *fixture); 36 | void test_fixture_teardown (TestFixture *fixture); 37 | 38 | typedef void (*TCFunc) (TestFixture *, gconstpointer); 39 | #define TEST_ADD(path,method) \ 40 | g_test_add (path, \ 41 | TestFixture, \ 42 | NULL, \ 43 | (TCFunc)test_fixture_setup, \ 44 | (TCFunc)method, \ 45 | (TCFunc)test_fixture_teardown) 46 | 47 | void test_fixture_set_profile (TestFixture *fixture, 48 | const gchar *profile_name, 49 | const gchar *plugin, 50 | const gchar *const *ports); 51 | MMObject *test_fixture_get_modem (TestFixture *fixture); 52 | void test_fixture_no_modem (TestFixture *fixture); 53 | 54 | #endif /* TEST_FIXTURE_H */ 55 | -------------------------------------------------------------------------------- /plugins/tests/test-helpers.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #include 17 | #define _LIBMM_INSIDE_MM 18 | #include 19 | 20 | #include "mm-log.h" 21 | #include "mm-modem-helpers.h" 22 | 23 | #include "test-helpers.h" 24 | 25 | void 26 | mm_test_helpers_compare_bands (GArray *bands, 27 | const MMModemBand *expected_bands, 28 | guint n_expected_bands) 29 | { 30 | gchar *bands_str; 31 | GArray *expected_bands_array; 32 | gchar *expected_bands_str; 33 | 34 | if (!expected_bands || !n_expected_bands) { 35 | g_assert (!bands); 36 | return; 37 | } 38 | 39 | g_assert (bands); 40 | mm_common_bands_garray_sort (bands); 41 | bands_str = mm_common_build_bands_string ((MMModemBand *)(bands->data), bands->len); 42 | 43 | expected_bands_array = g_array_sized_new (FALSE, FALSE, sizeof (MMModemBand), n_expected_bands); 44 | g_array_append_vals (expected_bands_array, expected_bands, n_expected_bands); 45 | mm_common_bands_garray_sort (expected_bands_array); 46 | expected_bands_str = mm_common_build_bands_string ((MMModemBand *)(expected_bands_array->data), expected_bands_array->len); 47 | g_array_unref (expected_bands_array); 48 | 49 | g_assert_cmpstr (bands_str, ==, expected_bands_str); 50 | g_free (bands_str); 51 | g_free (expected_bands_str); 52 | } 53 | -------------------------------------------------------------------------------- /plugins/tests/test-helpers.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #ifndef TEST_HELPERS_H 17 | #define TEST_HELPERS_H 18 | 19 | #include 20 | #include 21 | 22 | void mm_test_helpers_compare_bands (GArray *bands, 23 | const MMModemBand *expected_bands, 24 | guint n_expected_bands); 25 | 26 | #endif /* TEST_HELPERS_H */ 27 | -------------------------------------------------------------------------------- /plugins/tests/test-port-context.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2013 Aleksander Morgado 14 | */ 15 | 16 | #ifndef TEST_PORT_CONTEXT_H 17 | #define TEST_PORT_CONTEXT_H 18 | 19 | #include 20 | #include 21 | 22 | typedef struct _TestPortContext TestPortContext; 23 | 24 | TestPortContext *test_port_context_new (const gchar *name); 25 | void test_port_context_start (TestPortContext *self); 26 | void test_port_context_stop (TestPortContext *self); 27 | void test_port_context_free (TestPortContext *self); 28 | 29 | void test_port_context_set_command (TestPortContext *self, 30 | const gchar *command, 31 | const gchar *response); 32 | void test_port_context_load_commands (TestPortContext *self, 33 | const gchar *commands_file); 34 | 35 | #endif /* TEST_PORT_CONTEXT_H */ 36 | -------------------------------------------------------------------------------- /plugins/thuraya/mm-modem-helpers-thuraya.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2016 Thomas Sailer 14 | * 15 | */ 16 | #ifndef MM_MODEM_HELPERS_THURAYA_H 17 | #define MM_MODEM_HELPERS_THURAYA_H 18 | 19 | #include 20 | 21 | /* AT+CPMS=? (Preferred SMS storage) response parser */ 22 | gboolean mm_thuraya_3gpp_parse_cpms_test_response (const gchar *reply, 23 | GArray **mem1, 24 | GArray **mem2, 25 | GArray **mem3); 26 | 27 | #endif /* MM_MODEM_HELPERS_THURAYA_H */ 28 | -------------------------------------------------------------------------------- /plugins/thuraya/mm-plugin-thuraya.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2011 - 2012 Ammonit Measurement GmbH 20 | * Author: Aleksander Morgado 21 | * Copyright (C) 2016 Thomas Sailer 22 | */ 23 | 24 | #ifndef MM_PLUGIN_THURAYA_H 25 | #define MM_PLUGIN_THURAYA_H 26 | 27 | #include "mm-plugin.h" 28 | 29 | #define MM_TYPE_PLUGIN_THURAYA (mm_plugin_thuraya_get_type ()) 30 | #define MM_PLUGIN_THURAYA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_THURAYA, MMPluginThuraya)) 31 | #define MM_PLUGIN_THURAYA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_THURAYA, MMPluginThurayaClass)) 32 | #define MM_IS_PLUGIN_THURAYA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_THURAYA)) 33 | #define MM_IS_PLUGIN_THURAYA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_THURAYA)) 34 | #define MM_PLUGIN_THURAYA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_THURAYA, MMPluginThurayaClass)) 35 | 36 | typedef struct { 37 | MMPlugin parent; 38 | } MMPluginThuraya; 39 | 40 | typedef struct { 41 | MMPluginClass parent; 42 | } MMPluginThurayaClass; 43 | 44 | GType mm_plugin_thuraya_get_type (void); 45 | 46 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 47 | 48 | #endif /* MM_PLUGIN_THURAYA_H */ 49 | -------------------------------------------------------------------------------- /plugins/tplink/77-mm-tplink-port-types.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | 3 | ACTION!="add|change|move|bind", GOTO="mm_tplink_port_types_end" 4 | SUBSYSTEMS=="usb", ATTRS{idVendor}=="2357", GOTO="mm_tplink_port_types" 5 | GOTO="mm_tplink_port_types_end" 6 | 7 | LABEL="mm_tplink_port_types" 8 | SUBSYSTEMS=="usb", ATTRS{bInterfaceNumber}=="?*", ENV{.MM_USBIFNUM}="$attr{bInterfaceNumber}" 9 | 10 | # D-Link DWM-222 11 | ATTRS{idVendor}=="2357", ATTRS{idProduct}=="9000", ENV{.MM_USBIFNUM}=="00", ENV{ID_MM_PORT_IGNORE}="1" 12 | ATTRS{idVendor}=="2357", ATTRS{idProduct}=="9000", ENV{.MM_USBIFNUM}=="01", ENV{ID_MM_PORT_IGNORE}="1" 13 | ATTRS{idVendor}=="2357", ATTRS{idProduct}=="9000", ENV{.MM_USBIFNUM}=="03", ENV{ID_MM_PORT_TYPE_AT_PRIMARY}="1" 14 | 15 | LABEL="mm_tplink_port_types_end" 16 | -------------------------------------------------------------------------------- /plugins/tplink/mm-plugin-tplink.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_PLUGIN_TPLINK_H 17 | #define MM_PLUGIN_TPLINK_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_TPLINK (mm_plugin_tplink_get_type ()) 22 | #define MM_PLUGIN_TPLINK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_TPLINK, MMPluginTplink)) 23 | #define MM_PLUGIN_TPLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_TPLINK, MMPluginTplinkClass)) 24 | #define MM_IS_PLUGIN_TPLINK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_TPLINK)) 25 | #define MM_IS_PLUGIN_TPLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_TPLINK)) 26 | #define MM_PLUGIN_TPLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_TPLINK, MMPluginTplinkClass)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginTplink; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginTplinkClass; 35 | 36 | GType mm_plugin_tplink_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_TPLINK_H */ 41 | -------------------------------------------------------------------------------- /plugins/ublox/mm-plugin-ublox.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2016 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_PLUGIN_UBLOX_H 17 | #define MM_PLUGIN_UBLOX_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_UBLOX (mm_plugin_ublox_get_type ()) 22 | #define MM_PLUGIN_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_UBLOX, MMPluginUblox)) 23 | #define MM_PLUGIN_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_UBLOX, MMPluginUbloxClass)) 24 | #define MM_IS_PLUGIN_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_UBLOX)) 25 | #define MM_IS_PLUGIN_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_UBLOX)) 26 | #define MM_PLUGIN_UBLOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_UBLOX, MMPluginUbloxClass)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginUblox; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginUbloxClass; 35 | 36 | GType mm_plugin_ublox_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_UBLOX_H */ 41 | -------------------------------------------------------------------------------- /plugins/ublox/mm-sim-ublox.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2018 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_SIM_UBLOX_H 17 | #define MM_SIM_UBLOX_H 18 | 19 | #include 20 | #include 21 | 22 | #include "mm-base-sim.h" 23 | 24 | #define MM_TYPE_SIM_UBLOX (mm_sim_ublox_get_type ()) 25 | #define MM_SIM_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_UBLOX, MMSimUblox)) 26 | #define MM_SIM_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SIM_UBLOX, MMSimUbloxClass)) 27 | #define MM_IS_SIM_UBLOX(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SIM_UBLOX)) 28 | #define MM_IS_SIM_UBLOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SIM_UBLOX)) 29 | #define MM_SIM_UBLOX_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SIM_UBLOX, MMSimUbloxClass)) 30 | 31 | typedef struct _MMSimUblox MMSimUblox; 32 | typedef struct _MMSimUbloxClass MMSimUbloxClass; 33 | 34 | struct _MMSimUblox { 35 | MMBaseSim parent; 36 | }; 37 | 38 | struct _MMSimUbloxClass { 39 | MMBaseSimClass parent; 40 | }; 41 | 42 | GType mm_sim_ublox_get_type (void); 43 | 44 | void mm_sim_ublox_new (MMBaseModem *modem, 45 | GCancellable *cancellable, 46 | GAsyncReadyCallback callback, 47 | gpointer user_data); 48 | MMBaseSim *mm_sim_ublox_new_finish (GAsyncResult *res, 49 | GError **error); 50 | 51 | #endif /* MM_SIM_UBLOX_H */ 52 | -------------------------------------------------------------------------------- /plugins/via/mm-plugin-via.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2012 Red Hat, Inc. 20 | */ 21 | 22 | #ifndef MM_PLUGIN_VIA_H 23 | #define MM_PLUGIN_VIA_H 24 | 25 | #include "mm-plugin.h" 26 | 27 | #define MM_TYPE_PLUGIN_VIA (mm_plugin_via_get_type ()) 28 | #define MM_PLUGIN_VIA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_VIA, MMPluginVia)) 29 | #define MM_PLUGIN_VIA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_VIA, MMPluginViaClass)) 30 | #define MM_IS_PLUGIN_VIA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_VIA)) 31 | #define MM_IS_PLUGIN_VIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_VIA)) 32 | #define MM_PLUGIN_VIA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_VIA, MMPluginViaClass)) 33 | 34 | typedef struct { 35 | MMPlugin parent; 36 | } MMPluginVia; 37 | 38 | typedef struct { 39 | MMPluginClass parent; 40 | } MMPluginViaClass; 41 | 42 | GType mm_plugin_via_get_type (void); 43 | 44 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 45 | 46 | #endif /* MM_PLUGIN_VIA_H */ 47 | -------------------------------------------------------------------------------- /plugins/wavecom/mm-plugin-wavecom.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | 3 | /* 4 | * This program is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU General Public License as 6 | * published by the Free Software Foundation; either version 2 of the 7 | * License, or (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public 15 | * License along with this program; if not, write to the 16 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 | * Boston, MA 02111-1307, USA. 18 | * 19 | * Copyright (C) 2011 Ammonit Measurement GmbH 20 | * Copyright (C) 2012 Aleksander Morgado 21 | * 22 | * Author: Aleksander Morgado 23 | */ 24 | 25 | #ifndef MM_PLUGIN_WAVECOM_H 26 | #define MM_PLUGIN_WAVECOM_H 27 | 28 | #include "mm-plugin.h" 29 | 30 | #define MM_TYPE_PLUGIN_WAVECOM (mm_plugin_wavecom_get_type ()) 31 | #define MM_PLUGIN_WAVECOM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecom)) 32 | #define MM_PLUGIN_WAVECOM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecomClass)) 33 | #define MM_IS_PLUGIN_WAVECOM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_WAVECOM)) 34 | #define MM_IS_PLUGIN_WAVECOM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_WAVECOM)) 35 | #define MM_PLUGIN_WAVECOM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_WAVECOM, MMPluginWavecomClass)) 36 | 37 | typedef struct { 38 | MMPlugin parent; 39 | } MMPluginWavecom; 40 | 41 | typedef struct { 42 | MMPluginClass parent; 43 | } MMPluginWavecomClass; 44 | 45 | GType mm_plugin_wavecom_get_type (void); 46 | 47 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 48 | 49 | #endif /* MM_PLUGIN_WAVECOM_H */ 50 | -------------------------------------------------------------------------------- /plugins/x22x/mm-plugin-x22x.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_X22X_H 19 | #define MM_PLUGIN_X22X_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_X22X (mm_plugin_x22x_get_type ()) 24 | #define MM_PLUGIN_X22X(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_X22X, MMPluginX22x)) 25 | #define MM_PLUGIN_X22X_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_X22X, MMPluginX22xClass)) 26 | #define MM_IS_PLUGIN_X22X(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_X22X)) 27 | #define MM_IS_PLUGIN_X22X_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_X22X)) 28 | #define MM_PLUGIN_X22X_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_X22X, MMPluginX22xClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginX22x; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginX22xClass; 37 | 38 | GType mm_plugin_x22x_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_X22X_H */ 43 | -------------------------------------------------------------------------------- /plugins/xmm/mm-shared.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #include "mm-shared.h" 17 | 18 | MM_SHARED_DEFINE_MAJOR_VERSION 19 | MM_SHARED_DEFINE_MINOR_VERSION 20 | MM_SHARED_DEFINE_NAME(Xmm) 21 | -------------------------------------------------------------------------------- /plugins/xmm7360/README.md: -------------------------------------------------------------------------------- 1 | ## XMM7360 Support for ModemManager 2 | 3 | ### Prerequisites: 4 | - `xmm7360` PCI driver loaded from [0]. This can be done e. g. by executing `sudo make load` in the checked out repository folder. One might be using some mechanism to automatically load the kernel module. 5 | - This ModemManager fork checked out. 6 | ### Installation 7 | - Checkout this repository 8 | - run `./autogen.sh --prefix=/usr --with-dbus-sys-dir=/usr/share/dbus-1/system.d --without-mbim --without-qmi 'CFLAGS=-O0 -g'` I excluded `mbim` and `qmi` support to avoid the need for installing other packages. However, it might still be necessary to install several packages (like `libmm-glib`) to fulfill the dependency requirements of ModemManager. I added flags to the C compiler for better debugging here and on my Arch system, it was neccessary to change the D-Bus systemd directory otherwise ModemManager wouldn't register at D-Bus. Feel free to adapt the parameters to your needs. 9 | - run `make && sudo make install` 10 | 11 | ### Running 12 | Just make sure the `xmm7360` kernel module is loaded and then run ModemManager (for example `sudo ModemManager --debug`) 13 | A running NetworkManager instance should automatically detect the Modem and you should be able to create a mobile broadband connection with the specified APN for your provider. Other than the APN, I have not tried setting any other connection parameters. Afterwards, you should be able to connect with your modem. 14 | 15 | ### Limitations 16 | - Disconnection is not implemented 17 | - No signal strength is shown 18 | - Many other bugs which are just unknown at the moment 19 | 20 | 21 | 22 | 23 | [0] https://github.com/xmm7360/xmm7360-pci/ 24 | -------------------------------------------------------------------------------- /plugins/xmm7360/mm-plugin-xmm7360.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2020 Marinus Enzinger 14 | */ 15 | 16 | #ifndef MM_PLUGIN_XMM7360_H 17 | #define MM_PLUGIN_XMM7360_H 18 | 19 | #include "mm-plugin.h" 20 | 21 | #define MM_TYPE_PLUGIN_XMM7360 (mm_plugin_xmm7360_get_type ()) 22 | #define MM_PLUGIN_XMM7360(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_XMM7360, MMPluginXmm7360)) 23 | #define MM_PLUGIN_XMM7360_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_XMM7360, MMPluginXmm7360Class)) 24 | #define MM_IS_PLUGIN_XMM7360(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_XMM7360)) 25 | #define MM_IS_PLUGIN_XMM7360_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_XMM7360)) 26 | #define MM_PLUGIN_XMM7360_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_XMM7360, MMPluginXmm7360Class)) 27 | 28 | typedef struct { 29 | MMPlugin parent; 30 | } MMPluginXmm7360; 31 | 32 | typedef struct { 33 | MMPluginClass parent; 34 | } MMPluginXmm7360Class; 35 | 36 | GType mm_plugin_xmm7360_get_type (void); 37 | 38 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 39 | 40 | #endif /* MM_PLUGIN_XMM7360_H */ 41 | -------------------------------------------------------------------------------- /plugins/zte/mm-common-zte.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_COMMON_ZTE_H 19 | #define MM_COMMON_ZTE_H 20 | 21 | #include "mm-broadband-modem.h" 22 | 23 | typedef struct _MMCommonZteUnsolicitedSetup MMCommonZteUnsolicitedSetup; 24 | MMCommonZteUnsolicitedSetup *mm_common_zte_unsolicited_setup_new (void); 25 | void mm_common_zte_unsolicited_setup_free (MMCommonZteUnsolicitedSetup *setup); 26 | 27 | void mm_common_zte_set_unsolicited_events_handlers (MMBroadbandModem *self, 28 | MMCommonZteUnsolicitedSetup *setup, 29 | gboolean enable); 30 | 31 | #endif /* MM_COMMON_ZTE_H */ 32 | -------------------------------------------------------------------------------- /plugins/zte/mm-plugin-zte.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2012 Aleksander Morgado 16 | */ 17 | 18 | #ifndef MM_PLUGIN_ZTE_H 19 | #define MM_PLUGIN_ZTE_H 20 | 21 | #include "mm-plugin.h" 22 | 23 | #define MM_TYPE_PLUGIN_ZTE (mm_plugin_zte_get_type ()) 24 | #define MM_PLUGIN_ZTE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_PLUGIN_ZTE, MMPluginZte)) 25 | #define MM_PLUGIN_ZTE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_PLUGIN_ZTE, MMPluginZteClass)) 26 | #define MM_IS_PLUGIN_ZTE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_PLUGIN_ZTE)) 27 | #define MM_IS_PLUGIN_ZTE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_PLUGIN_ZTE)) 28 | #define MM_PLUGIN_ZTE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_PLUGIN_ZTE, MMPluginZteClass)) 29 | 30 | typedef struct { 31 | MMPlugin parent; 32 | } MMPluginZte; 33 | 34 | typedef struct { 35 | MMPluginClass parent; 36 | } MMPluginZteClass; 37 | 38 | GType mm_plugin_zte_get_type (void); 39 | 40 | G_MODULE_EXPORT MMPlugin *mm_plugin_create (void); 41 | 42 | #endif /* MM_PLUGIN_ZTE_H */ 43 | -------------------------------------------------------------------------------- /po/LINGUAS: -------------------------------------------------------------------------------- 1 | cs 2 | da 3 | de 4 | fr 5 | fur 6 | hu 7 | id 8 | it 9 | lt 10 | pl 11 | pt_BR 12 | sk 13 | sv 14 | tr 15 | uk 16 | zh_CN 17 | -------------------------------------------------------------------------------- /po/POTFILES.in: -------------------------------------------------------------------------------- 1 | # List of source files containing translatable strings. 2 | # Please keep this file sorted alphabetically. 3 | data/org.freedesktop.ModemManager1.policy.in.in 4 | src/mm-sleep-monitor.c 5 | -------------------------------------------------------------------------------- /po/POTFILES.skip: -------------------------------------------------------------------------------- 1 | data/org.freedesktop.ModemManager1.policy.in 2 | data/tests/org.freedesktop.ModemManager1.service.in 3 | -------------------------------------------------------------------------------- /src/77-mm-pcmcia-device-blacklist.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | 3 | ACTION!="add|change|move|bind", GOTO="mm_pcmcia_device_blacklist_end" 4 | SUBSYSTEM!="pcmcia", GOTO="mm_pcmcia_device_blacklist_end" 5 | 6 | # Gemplus Serial Port smartcard adapter 7 | ATTRS{prod_id1}=="Gemplus", ATTRS{prod_id2}=="SerialPort", ATTRS{prod_id3}=="GemPC Card", ENV{ID_MM_TTY_BLACKLIST}="1" 8 | 9 | LABEL="mm_pcmcia_device_blacklist_end" 10 | -------------------------------------------------------------------------------- /src/80-mm-candidate.rules: -------------------------------------------------------------------------------- 1 | # do not edit this file, it will be overwritten on update 2 | 3 | # Tag any devices that MM might be interested in; if ModemManager is started 4 | # up right after udev, when MM explicitly requests devices on startup it may 5 | # get devices that haven't had all rules run yet. Thus, we tag devices we're 6 | # interested in and when handling devices during MM startup we ignore any 7 | # that don't have this tag. MM will still get the udev 'add' event for the 8 | # device a short while later and then process it as normal. 9 | 10 | ACTION!="add|change|move|bind", GOTO="mm_candidate_end" 11 | 12 | # Opening bound but disconnected Bluetooth RFCOMM ttys would initiate the 13 | # connection. Don't do that. 14 | KERNEL=="rfcomm*", DEVPATH=="*/virtual/*", GOTO="mm_candidate_end" 15 | 16 | SUBSYSTEM=="tty", ENV{ID_MM_CANDIDATE}="1" 17 | SUBSYSTEM=="net", ENV{ID_MM_CANDIDATE}="1" 18 | KERNEL=="cdc-wdm*", SUBSYSTEM=="usb", ENV{ID_MM_CANDIDATE}="1" 19 | KERNEL=="cdc-wdm*", SUBSYSTEM=="usbmisc", ENV{ID_MM_CANDIDATE}="1" 20 | 21 | LABEL="mm_candidate_end" 22 | -------------------------------------------------------------------------------- /src/kerneldevice/mm-kernel-device-generic-rules.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2016 Aleksander Morgado 14 | */ 15 | 16 | #include 17 | 18 | G_BEGIN_DECLS 19 | 20 | typedef enum { 21 | MM_UDEV_RULE_MATCH_TYPE_UNKNOWN, 22 | MM_UDEV_RULE_MATCH_TYPE_EQUAL, 23 | MM_UDEV_RULE_MATCH_TYPE_NOT_EQUAL, 24 | } MMUdevRuleMatchType; 25 | 26 | typedef struct { 27 | MMUdevRuleMatchType type; 28 | gchar *parameter; 29 | gchar *value; 30 | } MMUdevRuleMatch; 31 | 32 | typedef enum { 33 | MM_UDEV_RULE_RESULT_TYPE_UNKNOWN, 34 | MM_UDEV_RULE_RESULT_TYPE_PROPERTY, 35 | MM_UDEV_RULE_RESULT_TYPE_LABEL, 36 | MM_UDEV_RULE_RESULT_TYPE_GOTO_INDEX, 37 | MM_UDEV_RULE_RESULT_TYPE_GOTO_TAG, /* internal use only */ 38 | } MMUdevRuleResultType; 39 | 40 | typedef struct { 41 | gchar *name; 42 | gchar *value; 43 | } MMUdevRuleResultProperty; 44 | 45 | typedef struct { 46 | MMUdevRuleResultType type; 47 | union { 48 | MMUdevRuleResultProperty property; 49 | gchar *tag; 50 | guint index; 51 | } content; 52 | } MMUdevRuleResult; 53 | 54 | typedef struct { 55 | GArray *conditions; 56 | MMUdevRuleResult result; 57 | } MMUdevRule; 58 | 59 | GArray *mm_kernel_device_generic_rules_load (const gchar *rules_dir, 60 | GError **error); 61 | 62 | G_END_DECLS 63 | -------------------------------------------------------------------------------- /src/mm-context.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2012 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_CONTEXT_H 17 | #define MM_CONTEXT_H 18 | 19 | #include 20 | #include 21 | 22 | #include "mm-filter.h" 23 | 24 | #if !defined(MM_DIST_VERSION) 25 | # define MM_DIST_VERSION VERSION 26 | #endif 27 | 28 | void mm_context_init (gint argc, 29 | gchar **argv); 30 | 31 | gboolean mm_context_get_debug (void); 32 | const gchar *mm_context_get_initial_kernel_events (void); 33 | gboolean mm_context_get_no_auto_scan (void); 34 | 35 | /* Filter support */ 36 | MMFilterRule mm_context_get_filter_policy (void); 37 | 38 | /* Logging support */ 39 | const gchar *mm_context_get_log_level (void); 40 | const gchar *mm_context_get_log_file (void); 41 | gboolean mm_context_get_log_journal (void); 42 | gboolean mm_context_get_log_timestamps (void); 43 | gboolean mm_context_get_log_relative_timestamps (void); 44 | 45 | /* Testing support */ 46 | gboolean mm_context_get_test_session (void); 47 | gboolean mm_context_get_test_enable (void); 48 | const gchar *mm_context_get_test_plugin_dir (void); 49 | 50 | #endif /* MM_CONTEXT_H */ 51 | -------------------------------------------------------------------------------- /src/mm-error-helpers.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 Novell, Inc. 14 | * Copyright (C) 2009 - 2012 Red Hat, Inc. 15 | * Copyright (C) 2011 - 2012 Google, Inc. 16 | */ 17 | 18 | #ifndef MM_ERROR_HELPERS_H 19 | #define MM_ERROR_HELPERS_H 20 | 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | GError *mm_connection_error_for_code (MMConnectionError code); 27 | GError *mm_mobile_equipment_error_for_code (MMMobileEquipmentError code); 28 | GError *mm_mobile_equipment_error_for_string (const gchar *str); 29 | GError *mm_message_error_for_code (MMMessageError code); 30 | GError *mm_message_error_for_string (const gchar *str); 31 | 32 | #endif /* MM_ERROR_HELPERS_H */ 33 | -------------------------------------------------------------------------------- /src/mm-iface-modem-simple.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2011 Google, Inc. 14 | */ 15 | 16 | #ifndef MM_IFACE_MODEM_SIMPLE_H 17 | #define MM_IFACE_MODEM_SIMPLE_H 18 | 19 | #include 20 | #include 21 | 22 | #define MM_TYPE_IFACE_MODEM_SIMPLE (mm_iface_modem_simple_get_type ()) 23 | #define MM_IFACE_MODEM_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_IFACE_MODEM_SIMPLE, MMIfaceModemSimple)) 24 | #define MM_IS_IFACE_MODEM_SIMPLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_IFACE_MODEM_SIMPLE)) 25 | #define MM_IFACE_MODEM_SIMPLE_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), MM_TYPE_IFACE_MODEM_SIMPLE, MMIfaceModemSimple)) 26 | 27 | #define MM_IFACE_MODEM_SIMPLE_DBUS_SKELETON "iface-modem-simple-dbus-skeleton" 28 | #define MM_IFACE_MODEM_SIMPLE_STATUS "iface-modem-simple-status" 29 | 30 | typedef struct _MMIfaceModemSimple MMIfaceModemSimple; 31 | 32 | struct _MMIfaceModemSimple { 33 | GTypeInterface g_iface; 34 | }; 35 | 36 | GType mm_iface_modem_simple_get_type (void); 37 | 38 | /* Initialize Modem Simple interface */ 39 | void mm_iface_modem_simple_initialize (MMIfaceModemSimple *self); 40 | 41 | /* Shutdown Modem Simple interface */ 42 | void mm_iface_modem_simple_shutdown (MMIfaceModemSimple *self); 43 | 44 | #endif /* MM_IFACE_MODEM_SIMPLE_H */ 45 | -------------------------------------------------------------------------------- /src/mm-log.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2011 Red Hat, Inc. 14 | */ 15 | 16 | #ifndef MM_LOG_H 17 | #define MM_LOG_H 18 | 19 | #include 20 | 21 | /* Log levels */ 22 | typedef enum { 23 | MM_LOG_LEVEL_ERR = 0x00000001, 24 | MM_LOG_LEVEL_WARN = 0x00000002, 25 | MM_LOG_LEVEL_INFO = 0x00000004, 26 | MM_LOG_LEVEL_DEBUG = 0x00000008 27 | } MMLogLevel; 28 | 29 | #define mm_err(...) \ 30 | _mm_log (G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_ERR, ## __VA_ARGS__ ) 31 | 32 | #define mm_warn(...) \ 33 | _mm_log (G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_WARN, ## __VA_ARGS__ ) 34 | 35 | #define mm_info(...) \ 36 | _mm_log (G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_INFO, ## __VA_ARGS__ ) 37 | 38 | #define mm_dbg(...) \ 39 | _mm_log (G_STRLOC, G_STRFUNC, MM_LOG_LEVEL_DEBUG, ## __VA_ARGS__ ) 40 | 41 | #define mm_log(level, ...) \ 42 | _mm_log (G_STRLOC, G_STRFUNC, level, ## __VA_ARGS__ ) 43 | 44 | void _mm_log (const char *loc, 45 | const char *func, 46 | MMLogLevel level, 47 | const char *fmt, 48 | ...) __attribute__((__format__ (__printf__, 4, 5))); 49 | 50 | gboolean mm_log_set_level (const char *level, GError **error); 51 | 52 | gboolean mm_log_setup (const char *level, 53 | const char *log_file, 54 | gboolean log_journal, 55 | gboolean show_ts, 56 | gboolean rel_ts, 57 | GError **error); 58 | 59 | void mm_log_shutdown (void); 60 | 61 | #endif /* MM_LOG_H */ 62 | -------------------------------------------------------------------------------- /src/mm-private-boxed-types.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2012 - Google, Inc. 14 | */ 15 | 16 | #ifndef __MM_PRIVATE_BOXED_TYPES_H__ 17 | #define __MM_PRIVATE_BOXED_TYPES_H__ 18 | 19 | #include 20 | 21 | G_BEGIN_DECLS 22 | 23 | GType mm_uint16_array_get_type (void) G_GNUC_CONST; 24 | #define MM_TYPE_UINT16_ARRAY (mm_uint16_array_get_type ()) 25 | 26 | typedef struct { guint16 l; guint16 r; } mm_uint16_pair; 27 | GType mm_uint16_pair_array_get_type (void) G_GNUC_CONST; 28 | #define MM_TYPE_UINT16_PAIR_ARRAY (mm_uint16_pair_array_get_type ()) 29 | 30 | typedef struct { gchar *l; gchar *r; } mm_str_pair; 31 | GType mm_str_pair_array_get_type (void) G_GNUC_CONST; 32 | #define MM_TYPE_STR_PAIR_ARRAY (mm_str_pair_array_get_type ()) 33 | 34 | GType mm_pointer_array_get_type (void) G_GNUC_CONST; 35 | #define MM_TYPE_POINTER_ARRAY (mm_pointer_array_get_type ()) 36 | 37 | typedef struct { 38 | GCallback async; 39 | GCallback finish; 40 | } MMAsyncMethod; 41 | GType mm_async_method_get_type (void) G_GNUC_CONST; 42 | #define MM_TYPE_ASYNC_METHOD (mm_async_method_get_type ()) 43 | 44 | G_END_DECLS 45 | 46 | #endif /* __MM_PRIVATE_BOXED_TYPES_H__ */ 47 | -------------------------------------------------------------------------------- /src/mm-serial-parsers.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2008 - 2009 Novell, Inc. 14 | */ 15 | 16 | #ifndef MM_SERIAL_PARSERS_H 17 | #define MM_SERIAL_PARSERS_H 18 | 19 | #include 20 | 21 | gpointer mm_serial_parser_v1_new (void); 22 | void mm_serial_parser_v1_set_custom_regex (gpointer data, 23 | GRegex *successful, 24 | GRegex *error); 25 | gboolean mm_serial_parser_v1_parse (gpointer parser, 26 | GString *response, 27 | GError **error); 28 | void mm_serial_parser_v1_destroy (gpointer parser); 29 | gboolean mm_serial_parser_v1_is_known_error (const GError *error); 30 | 31 | /* Parser filter: when FALSE returned, error should be set. This error will be 32 | * reported to the response listener right away. */ 33 | typedef gboolean (* mm_serial_parser_v1_filter_fn) (gpointer data, 34 | gpointer user_data, 35 | GString *response, 36 | GError **error); 37 | void mm_serial_parser_v1_add_filter (gpointer data, 38 | mm_serial_parser_v1_filter_fn callback, 39 | gpointer user_data); 40 | 41 | #endif /* MM_SERIAL_PARSERS_H */ 42 | -------------------------------------------------------------------------------- /src/mm-shared.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2019 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_SHARED_H 17 | #define MM_SHARED_H 18 | 19 | #include 20 | #include 21 | 22 | #define MM_SHARED_MAJOR_VERSION 1 23 | #define MM_SHARED_MINOR_VERSION 0 24 | 25 | #if defined (G_HAVE_GNUC_VISIBILITY) 26 | #define VISIBILITY __attribute__((visibility("protected"))) 27 | #else 28 | #define VISIBILITY 29 | #endif 30 | 31 | #define MM_SHARED_DEFINE_MAJOR_VERSION VISIBILITY int mm_shared_major_version = MM_SHARED_MAJOR_VERSION; 32 | #define MM_SHARED_DEFINE_MINOR_VERSION VISIBILITY int mm_shared_minor_version = MM_SHARED_MINOR_VERSION; 33 | #define MM_SHARED_DEFINE_NAME(NAME) VISIBILITY const char *mm_shared_name = #NAME; 34 | 35 | #endif /* MM_SHARED_H */ 36 | -------------------------------------------------------------------------------- /src/mm-sim-mbim.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2013 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_SIM_MBIM_H 17 | #define MM_SIM_MBIM_H 18 | 19 | #include 20 | #include 21 | 22 | #include "mm-base-sim.h" 23 | 24 | #define MM_TYPE_SIM_MBIM (mm_sim_mbim_get_type ()) 25 | #define MM_SIM_MBIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SIM_MBIM, MMSimMbim)) 26 | #define MM_SIM_MBIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SIM_MBIM, MMSimMbimClass)) 27 | #define MM_IS_SIM_MBIM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SIM_MBIM)) 28 | #define MM_IS_SIM_MBIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SIM_MBIM)) 29 | #define MM_SIM_MBIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SIM_MBIM, MMSimMbimClass)) 30 | 31 | typedef struct _MMSimMbim MMSimMbim; 32 | typedef struct _MMSimMbimClass MMSimMbimClass; 33 | 34 | struct _MMSimMbim { 35 | MMBaseSim parent; 36 | }; 37 | 38 | struct _MMSimMbimClass { 39 | MMBaseSimClass parent; 40 | }; 41 | 42 | GType mm_sim_mbim_get_type (void); 43 | 44 | void mm_sim_mbim_new (MMBaseModem *modem, 45 | GCancellable *cancellable, 46 | GAsyncReadyCallback callback, 47 | gpointer user_data); 48 | MMBaseSim *mm_sim_mbim_new_finish (GAsyncResult *res, 49 | GError **error); 50 | 51 | #endif /* MM_SIM_MBIM_H */ 52 | -------------------------------------------------------------------------------- /src/mm-sleep-monitor.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * (C) Copyright 2012 Red Hat, Inc. 14 | * Author: Matthias Clasen 15 | * Original code imported from NetworkManager. 16 | */ 17 | 18 | #ifndef __MM_SLEEP_MONITOR_H__ 19 | #define __MM_SLEEP_MONITOR_H__ 20 | 21 | #include 22 | 23 | G_BEGIN_DECLS 24 | 25 | #define MM_TYPE_SLEEP_MONITOR (mm_sleep_monitor_get_type ()) 26 | #define MM_SLEEP_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MM_TYPE_SLEEP_MONITOR, MMSleepMonitor)) 27 | #define MM_SLEEP_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), MM_TYPE_SLEEP_MONITOR, MMSleepMonitorClass)) 28 | #define MM_SLEEP_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), MM_TYPE_SLEEP_MONITOR, MMSleepMonitorClass)) 29 | #define MM_IS_SLEEP_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MM_TYPE_SLEEP_MONITOR)) 30 | #define MM_IS_SLEEP_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MM_TYPE_SLEEP_MONITOR)) 31 | 32 | #define MM_SLEEP_MONITOR_SLEEPING "sleeping" 33 | #define MM_SLEEP_MONITOR_RESUMING "resuming" 34 | 35 | typedef struct _MMSleepMonitor MMSleepMonitor; 36 | typedef struct _MMSleepMonitorClass MMSleepMonitorClass; 37 | 38 | GType mm_sleep_monitor_get_type (void) G_GNUC_CONST; 39 | MMSleepMonitor *mm_sleep_monitor_get (void); 40 | 41 | G_END_DECLS 42 | 43 | #endif /* __MM_SLEEP_MONITOR_H__ */ 44 | -------------------------------------------------------------------------------- /src/mm-sms-mbim.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2013 Aleksander Morgado 14 | */ 15 | 16 | #ifndef MM_SMS_MBIM_H 17 | #define MM_SMS_MBIM_H 18 | 19 | #include 20 | #include 21 | 22 | #define _LIBMM_INSIDE_MM 23 | #include 24 | 25 | #include "mm-base-sms.h" 26 | 27 | #define MM_TYPE_SMS_MBIM (mm_sms_mbim_get_type ()) 28 | #define MM_SMS_MBIM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SMS_MBIM, MMSmsMbim)) 29 | #define MM_SMS_MBIM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SMS_MBIM, MMSmsMbimClass)) 30 | #define MM_IS_SMS_MBIM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SMS_MBIM)) 31 | #define MM_IS_SMS_MBIM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SMS_MBIM)) 32 | #define MM_SMS_MBIM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SMS_MBIM, MMSmsMbimClass)) 33 | 34 | typedef struct _MMSmsMbim MMSmsMbim; 35 | typedef struct _MMSmsMbimClass MMSmsMbimClass; 36 | 37 | struct _MMSmsMbim { 38 | MMBaseSms parent; 39 | }; 40 | 41 | struct _MMSmsMbimClass { 42 | MMBaseSmsClass parent; 43 | }; 44 | 45 | GType mm_sms_mbim_get_type (void); 46 | 47 | MMBaseSms *mm_sms_mbim_new (MMBaseModem *modem); 48 | 49 | #endif /* MM_SMS_MBIM_H */ 50 | -------------------------------------------------------------------------------- /src/mm-sms-part-cdma.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2013 Google, Inc. 14 | */ 15 | 16 | #ifndef MM_SMS_PART_CDMA_H 17 | #define MM_SMS_PART_CDMA_H 18 | 19 | #include 20 | #include 21 | 22 | #include "mm-sms-part.h" 23 | 24 | MMSmsPart *mm_sms_part_cdma_new_from_pdu (guint index, 25 | const gchar *hexpdu, 26 | GError **error); 27 | 28 | MMSmsPart *mm_sms_part_cdma_new_from_binary_pdu (guint index, 29 | const guint8 *pdu, 30 | gsize pdu_len, 31 | GError **error); 32 | 33 | guint8 *mm_sms_part_cdma_get_submit_pdu (MMSmsPart *part, 34 | guint *out_pdulen, 35 | GError **error); 36 | 37 | #endif /* MM_SMS_PART_CDMA_H */ 38 | -------------------------------------------------------------------------------- /src/mm-sms-qmi.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Author: Aleksander Morgado 14 | * 15 | * Copyright (C) 2012 Google, Inc. 16 | */ 17 | 18 | #ifndef MM_SMS_QMI_H 19 | #define MM_SMS_QMI_H 20 | 21 | #include 22 | #include 23 | 24 | #define _LIBMM_INSIDE_MM 25 | #include 26 | 27 | #include "mm-base-sms.h" 28 | 29 | #define MM_TYPE_SMS_QMI (mm_sms_qmi_get_type ()) 30 | #define MM_SMS_QMI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MM_TYPE_SMS_QMI, MMSmsQmi)) 31 | #define MM_SMS_QMI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MM_TYPE_SMS_QMI, MMSmsQmiClass)) 32 | #define MM_IS_SMS_QMI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MM_TYPE_SMS_QMI)) 33 | #define MM_IS_SMS_QMI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MM_TYPE_SMS_QMI)) 34 | #define MM_SMS_QMI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MM_TYPE_SMS_QMI, MMSmsQmiClass)) 35 | 36 | typedef struct _MMSmsQmi MMSmsQmi; 37 | typedef struct _MMSmsQmiClass MMSmsQmiClass; 38 | 39 | struct _MMSmsQmi { 40 | MMBaseSms parent; 41 | }; 42 | 43 | struct _MMSmsQmiClass { 44 | MMBaseSmsClass parent; 45 | }; 46 | 47 | GType mm_sms_qmi_get_type (void); 48 | 49 | MMBaseSms *mm_sms_qmi_new (MMBaseModem *modem); 50 | 51 | #endif /* MM_SMS_QMI_H */ 52 | -------------------------------------------------------------------------------- /src/tests/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | include $(top_srcdir)/gtester.make 3 | 4 | ################################################################################ 5 | # common 6 | ################################################################################ 7 | 8 | AM_CFLAGS = \ 9 | $(WARN_CFLAGS) \ 10 | $(MM_CFLAGS) \ 11 | $(CODE_COVERAGE_CFLAGS) \ 12 | -I$(top_srcdir) \ 13 | -I$(top_srcdir)/include \ 14 | -I$(top_builddir)/include \ 15 | -I$(top_srcdir)/libqcdm/src \ 16 | -I$(top_srcdir)/libmm-glib \ 17 | -I${top_builddir}/libmm-glib/generated \ 18 | -I${top_srcdir}/src/ \ 19 | -I${top_builddir}/src/ \ 20 | -I${top_srcdir}/src/kerneldevice \ 21 | -DTESTUDEVRULESDIR=\"${top_srcdir}/src/\" \ 22 | $(NULL) 23 | 24 | LDADD = \ 25 | $(top_builddir)/src/libhelpers.la \ 26 | $(top_builddir)/src/libport.la \ 27 | $(top_builddir)/src/libkerneldevice.la \ 28 | $(NULL) 29 | 30 | AM_LDFLAGS = \ 31 | $(WARN_LDFLAGS) \ 32 | $(MM_LIBS) \ 33 | $(CODE_COVERAGE_LDFLAGS) \ 34 | -lutil \ 35 | $(NULL) 36 | 37 | if WITH_QMI 38 | AM_CFLAGS += $(QMI_CFLAGS) 39 | AM_LDFLAGS += $(QMI_LIBS) 40 | endif 41 | 42 | if WITH_MBIM 43 | AM_CFLAGS += $(MBIM_CFLAGS) 44 | AM_LDFLAGS += $(MBIM_LIBS) 45 | endif 46 | 47 | ################################################################################ 48 | # tests 49 | # note: we abuse AM_LDFLAGS to include the libraries being tested 50 | ################################################################################ 51 | 52 | noinst_PROGRAMS = \ 53 | test-modem-helpers \ 54 | test-charsets \ 55 | test-qcdm-serial-port \ 56 | test-at-serial-port \ 57 | test-sms-part-3gpp \ 58 | test-sms-part-cdma \ 59 | test-udev-rules \ 60 | test-error-helpers \ 61 | $(NULL) 62 | 63 | if WITH_QMI 64 | noinst_PROGRAMS += test-modem-helpers-qmi 65 | endif 66 | 67 | TEST_PROGS += $(noinst_PROGRAMS) 68 | -------------------------------------------------------------------------------- /src/tests/test-udev-rules.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 2 | /* 3 | * This program is free software; you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation; either version 2 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details: 12 | * 13 | * Copyright (C) 2016 Aleksander Morgado 14 | */ 15 | 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | 22 | #define _LIBMM_INSIDE_MM 23 | #include 24 | 25 | #include "mm-kernel-device-generic-rules.h" 26 | #include "mm-log.h" 27 | 28 | /************************************************************/ 29 | 30 | static void 31 | test_load_cleanup_core (void) 32 | { 33 | GArray *rules; 34 | GError *error = NULL; 35 | 36 | rules = mm_kernel_device_generic_rules_load (TESTUDEVRULESDIR, &error); 37 | g_assert_no_error (error); 38 | g_assert (rules); 39 | g_assert (rules->len > 0); 40 | 41 | g_array_unref (rules); 42 | } 43 | 44 | /************************************************************/ 45 | 46 | void 47 | _mm_log (const char *loc, 48 | const char *func, 49 | guint32 level, 50 | const char *fmt, 51 | ...) 52 | { 53 | va_list args; 54 | gchar *msg; 55 | 56 | if (!g_test_verbose ()) 57 | return; 58 | 59 | va_start (args, fmt); 60 | msg = g_strdup_vprintf (fmt, args); 61 | va_end (args); 62 | g_print ("%s\n", msg); 63 | g_free (msg); 64 | } 65 | 66 | int main (int argc, char **argv) 67 | { 68 | setlocale (LC_ALL, ""); 69 | 70 | g_test_init (&argc, &argv, NULL); 71 | 72 | g_test_add_func ("/MM/test-udev-rules/load-cleanup-core", test_load_cleanup_core); 73 | 74 | return g_test_run (); 75 | } 76 | -------------------------------------------------------------------------------- /vapi/Makefile.am: -------------------------------------------------------------------------------- 1 | VAPIGEN_VAPIS = libmm-glib.vapi 2 | 3 | if ENABLE_VAPIGEN 4 | include $(VAPIGEN_MAKEFILE) 5 | 6 | libmm-glib.vapi: $(top_builddir)/libmm-glib/ModemManager-1.0.gir libmm-glib.deps ModemManager-1.0.metadata 7 | 8 | libmm_glib_vapi_METADATADIRS = $(srcdir) 9 | libmm_glib_vapi_FILES = $(top_builddir)/libmm-glib/ModemManager-1.0.gir 10 | libmm_glib_vapi_VAPIDIRS = $(builddir) 11 | libmm_glib_vapi_DEPS = gio-2.0 12 | 13 | vapidir = $(datadir)/vala/vapi 14 | vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps) 15 | 16 | endif 17 | 18 | CLEANFILES = $(VAPIGEN_VAPIS) 19 | 20 | EXTRA_DIST = \ 21 | ModemManager-1.0.metadata \ 22 | libmm-glib.deps 23 | -------------------------------------------------------------------------------- /vapi/ModemManager-1.0.metadata: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/enzingerm/ModemManager/0fdfb398349c97f0c470072963de97a78602c7a5/vapi/ModemManager-1.0.metadata -------------------------------------------------------------------------------- /vapi/libmm-glib.deps: -------------------------------------------------------------------------------- 1 | gio-2.0 2 | --------------------------------------------------------------------------------