Skip to content
Snippets Groups Projects
Commit c22956ca authored by David Bauer's avatar David Bauer
Browse files

gluon-web-cellular: add package


This adds a new package which allows configuration of Gluons cellular
WWAN capabilities using the configuration mode. This way, a user can
enter APN information as well as the SIM PIN and enable / disable the
functionality.

Signed-off-by: default avatarDavid Bauer <mail@david-bauer.net>
parent 55096d55
No related branches found
No related tags found
No related merge requests found
include $(TOPDIR)/rules.mk
PKG_NAME:=gluon-web-cellular
include ../gluon.mk
define Package/gluon-web-cellular
DEPENDS:=+gluon-web-admin
TITLE:=UI for activating cellular WAN
endef
$(eval $(call BuildPackageGluon,gluon-web-cellular))
msgid ""
msgstr "Content-Type: text/plain; charset=UTF-8"
msgid "APN"
msgstr ""
msgid "Cellular"
msgstr ""
msgid "Enabled"
msgstr ""
msgid "IPv4"
msgstr ""
msgid "IPv4/IPv6"
msgstr ""
msgid "IPv6"
msgstr ""
msgid "Password"
msgstr ""
msgid "SIM PIN"
msgstr ""
msgid "Type"
msgstr ""
msgid "Username"
msgstr ""
msgid ""
"You can enable uplink via cellular service. If you decide so, the VPN "
"connection is established using the integrated WWAN modem."
msgstr ""
local platform = require 'gluon.platform'
package 'gluon-web-cellular'
if platform.is_cellular_device() then
entry({"admin", "cellular"}, model("admin/cellular"), _("Cellular"), 30)
end
local uci = require("simple-uci").cursor()
local f = Form(translate("Cellular"))
local s = f:section(Section, nil, translate(
'You can enable uplink via cellular service. If you decide so, the VPN connection is established '
.. 'using the integrated WWAN modem.'
))
local enabled = s:option(Flag, "enabled", translate("Enabled"))
enabled.default = uci:get('gluon', 'cellular') and uci:get_bool('gluon', 'cellular', 'enabled')
local pin = s:option(Value, "pin", translate("SIM PIN"))
pin:depends(enabled, true)
pin.default = uci:get('gluon', 'cellular', 'pin')
local apn = s:option(Value, "apn", translate("APN"))
apn:depends(enabled, true)
apn.default = uci:get('gluon', 'cellular', 'apn')
local pdptype = s:option(ListValue, "type", translate("Type"))
pdptype:depends(enabled, true)
pdptype:value("IP", translate("IPv4"))
pdptype:value("IPV6", translate("IPv6"))
pdptype:value("IPV4V6", translate("IPv4/IPv6"))
pdptype.default = uci:get('gluon', 'cellular', 'pdptype') or "IP"
local username = s:option(Value, "username", translate("Username"))
username:depends(enabled, true)
username.default = uci:get('gluon', 'cellular', 'username')
local password = s:option(Value, "password", translate("Password"))
password:depends(enabled, true)
password.default = uci:get('gluon', 'cellular', 'password')
function f:write()
local cellular_enabled = false
if enabled.data then
cellular_enabled = true
end
uci:section('gluon', 'cellular', 'cellular', {
enabled = cellular_enabled,
apn = apn.data,
pdptype = pdptype.data,
pin = pin.data,
username = username.data,
password = password.data,
})
uci:commit('gluon')
end
return f
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment