Forked from parrotmac/dbus-send-modem-command.sh
Last active
September 18, 2021 23:13
-
-
Save hericah/9c185552965676d909b2b0b678b3b691 to your computer and use it in GitHub Desktop.
Send serial command to modem using ModemManager via DBus
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Sends command 'ATI' to modem #3 | |
# Get a list of modems by running `mmcli -L` | |
# Timeout is (probably) 2 seconds | |
# Also see https://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.html#gdbus-method-org-freedesktop-ModemManager1-Modem.Command | |
dbus-send --system --dest=org.freedesktop.ModemManager1 --print-reply /org/freedesktop/ModemManager1/Modem/3 org.freedesktop.ModemManager1.Modem.Command string:'ATI' uint32:2000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Example caller, dbus-send-modem-command 3 'ATI' | |
# mean, sends command 'ATI' to modem #3 | |
# Get a list of modems by running `mmcli -L` | |
# Timeout is (probably) 2 seconds | |
# Also see https://www.freedesktop.org/software/ModemManager/api/latest/gdbus-org.freedesktop.ModemManager1.Modem.html#gdbus-method-org-freedesktop-ModemManager1-Modem.Command | |
dbus-send --system --dest=org.freedesktop.ModemManager1 --print-reply /org/freedesktop/ModemManager1/Modem/{$1} org.freedesktop.ModemManager1.Modem.Command string:'{$2}' uint32:2000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment