From 82f1f670d1ae2e844c294c806cc30e95be89bdf3 Mon Sep 17 00:00:00 2001 From: "Ycarus (Yannick Chabanois)" Date: Mon, 9 Nov 2020 15:18:59 +0100 Subject: [PATCH] Fix device in wizard for qmi, ncm and modemmanager --- .../luasrc/controller/openmptcprouter.lua | 12 +++++++++--- .../luasrc/view/openmptcprouter/wizard.htm | 12 ++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index 6d2ef238b..d6d4001ad 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -218,7 +218,9 @@ function wizard_add() local typeintf = luci.http.formvalue("cbid.network.%s.type" % intf) or "" local masterintf = luci.http.formvalue("cbid.network.%s.masterintf" % intf) or "" local ifname = luci.http.formvalue("cbid.network.%s.intf" % intf) or "" - local device = luci.http.formvalue("cbid.network.%s.device" % intf) or "" + local device_ncm = luci.http.formvalue("cbid.network.%s.device.ncm" % intf) or "" + local device_qmi = luci.http.formvalue("cbid.network.%s.device.qmi" % intf) or "" + local device_modemmanager = luci.http.formvalue("cbid.network.%s.device.modemmanager" % intf) or "" local ipaddr = luci.http.formvalue("cbid.network.%s.ipaddr" % intf) or "" local netmask = luci.http.formvalue("cbid.network.%s.netmask" % intf) or "" local gateway = luci.http.formvalue("cbid.network.%s.gateway" % intf) or "" @@ -243,8 +245,12 @@ function wizard_add() ucic:set("network",intf,"masterintf",masterintf) elseif typeintf == "" and ifname ~= "" and (proto == "static" or proto == "dhcp" ) then ucic:set("network",intf,"ifname",ifname) - elseif typeintf == "" and device ~= "" and (proto == "ncm" or proto == "qmi" or proto == "modemmanager") then - ucic:set("network",intf,"device",device) + elseif typeintf == "" and device ~= "" and proto == "ncm" then + ucic:set("network",intf,"device",device_ncm) + elseif typeintf == "" and device ~= "" and proto == "qmi" then + ucic:set("network",intf,"device",device_qmi) + elseif typeintf == "" and device ~= "" and proto == "modemmanager" then + ucic:set("network",intf,"device",device_manager) end if proto ~= "other" then ucic:set("network",intf,"proto",proto) diff --git a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm index c0a380416..0ee9ad9a2 100644 --- a/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm +++ b/luci-app-openmptcprouter/luasrc/view/openmptcprouter/wizard.htm @@ -572,10 +572,10 @@ -
+
- <% iffind=0 iftty = nixio.fs.glob("/dev/ttyUSB*") @@ -599,10 +599,10 @@
-
+
- <% iffind=0 iftty = nixio.fs.glob("/dev/cdc-wdm*") @@ -620,10 +620,10 @@
-
+
- <% iffind=0 iftty = luci.sys.exec("/usr/bin/mmcli -L")