Merge pull request #1989 from hanipouspilot/ncm

luci-proto-ncm: suggest both tty and wdm devices
This commit is contained in:
Jo-Philipp Wich 2018-08-13 15:23:02 +02:00 committed by GitHub
commit 73f2c37a01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,17 +19,14 @@ local ipv6, delay, defaultroute, metric, peerdns, dns
device = section:taboption("general", Value, "device", translate("Modem device"))
device.rmempty = false
local device_suggestions = nixio.fs.glob("/dev/cdc-wdm*")
or nixio.fs.glob("/dev/ttyUSB*")
if device_suggestions then
local node
for node in device_suggestions do
device:value(node)
local dev
for dev in nixio.fs.glob("/dev/ttyUSB*") do
device:value(dev)
end
for dev in nixio.fs.glob("/dev/cdc-wdm*") do
device:value(dev)
end
mode = section:taboption("general", Value, "mode", translate("Service Type"))
mode:value("", translate("Modem default"))
mode:value("preferlte", translate("Prefer LTE"))