Commit ea90b486 authored by Alexander Couzens's avatar Alexander Couzens
Browse files

qmiconnect: add configuration for username, password and auth

parent 9614d039
......@@ -3,6 +3,9 @@
DEVICE=$(uci -q get qmi.global.device)
PIN1CODE=$(uci -q get qmi.global.pin)
APN=$(uci -q get qmi.global.apn)
USERNAME=$(uci -q get qmi.global.username)
PASSWORD=$(uci -q get qmi.global.password)
APN_AUTH=$(uci -q get qmi.global.auth)
_log() {
echo "$@"
......@@ -63,6 +66,7 @@ unlock_sim() {
enable_internet() {
# need to change interface format?
local connect=""
linuxtype=$(_qmicli --get-expected-data-format)
qmitype=$(_qmicli --wda-get-data-format |grep 'Link layer protocol:' | awk -F"'" '{ print $2 }')
if [ "$linuxtype" != "$qmitype" ] ; then
......@@ -84,7 +88,11 @@ enable_internet() {
fi
# The connect might return error with NoEffect, which is still ok
_qmicli "--wds-start-network=apn=$APN" || true
connect="apn=$APN"
[ -n "$USERNAME" ] && connect="$connect,username=$USERNAME"
[ -n "$PASSWORD" ] && connect="$connect,password=$PASSWORD"
[ -n "$APN_AUTH" ] && connect="$connect,auth=$APN_AUTH"
_qmicli "--wds-start-network=apn=$connect" || true
}
wait_for_device() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment