app-mobilephone/pinephone-modem-scripts: add package

scripts for the modem

Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Marco Scardovi <marco@scardovi.com>
This commit is contained in:
Marco Scardovi
2021-06-25 19:40:35 +02:00
parent e869241d43
commit c8dfe3dac8
5 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
SUBSYSTEMS=="usb", ENV{.LOCAL_ifNum}="$attr{bInterfaceNumber}"
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{.LOCAL_ifNum}=="01", SYMLINK+="EG25.NMEA", MODE="0660"
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{.LOCAL_ifNum}=="02", SYMLINK+="EG25.AT", MODE="0660"
SUBSYSTEMS=="usb", KERNEL=="ttyUSB[0-9]*", ATTRS{idVendor}=="2c7c", ATTRS{idProduct}=="0125", ENV{.LOCAL_ifNum}=="03", SYMLINK+="EG25.MODEM", MODE="0660"

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Setup modem
[Service]
Type=simple
ExecStart=/usr/sbin/pinephone-modem-setup.sh
[Install]
WantedBy=graphical.target

View File

@@ -0,0 +1,25 @@
#!/bin/sh
log() {
echo "$@" | logger -t "manjaro:modem-setup"
}
QMBNCFG_CONFIG="1"
# Read current config
QMBNCFG_ACTUAL_CONFIG=$(echo 'AT+QMBNCFG="AutoSel"' | atinout - $DEV -)
if echo $QMBNCFG_ACTUAL_CONFIG | grep -q $QMBNCFG_CONFIG
then
log "Modem already configured"
exit 0
fi
# Configure VoLTE auto selecting profile
RET=$(echo "AT+QMBNCFG=\"AutoSel\",$QMBNCFG_CONFIG" | atinout - $DEV -)
if ! echo $RET | grep -q OK
then
log "Failed to enable VoLTE profile auto selecting: $RET"
exit 1
fi