Developing lightweight computation at the DSG edge

Commit 292bfdb9 authored by Roger Pueyo Centelles's avatar Roger Pueyo Centelles
Browse files

Rename wireless modes in wireless settings (e.g.: HW_mode (IFACE)). Add "Access point (LAN)" mode"

parent 3447ef3e
......@@ -86,7 +86,7 @@ qmp_get_virtual_iface() {
[ -n "$viface" ] && { echo $viface; return; }
# id is the first and char and the numbers of the device [e]th[0] [w]lan[1]
# id is the first char and the numbers of the device [e]th[0] [w]lan[1]
local id_num=$(echo $device | tr -d "[A-z]" | tr - _ | tr . _)
local id_char=$(echo $device | cut -c 1)
......@@ -765,7 +765,7 @@ qmp_configure_bmx6() {
for no_vlan_int in $(qmp_uci_get interfaces.no_vlan_devices); do
[ "$no_vlan_int" == "$dev" ] && use_vlan=0
done
# Check if the protocol has VLAN tag configured
local vid="$(echo $protocol_vid | awk -F':' '{print $2}')"
[ -z "$vid" -o $vid -lt 1 ] && use_vlan=0
......
......@@ -34,7 +34,7 @@ qmp_prepare_wireless_iface() {
###################################
# First parameter: device
# Second parameter: channel
# Third parameter: mode (adhoc, ap, adhoc_ap)
# Third parameter: mode (adhoc, ap, adhoc_ap, aplan, client, clientwan, none)
# It returns the same channel if it is right, and the new one fixet if not
qmp_check_channel() {
......@@ -219,6 +219,9 @@ qmp_configure_wifi_device() {
qmp_prepare_wireless_iface $device
echo "Mode is $mode"
echo "Network is $network"
cat $iface_template | grep -v ^# | sed \
-e s/"#QMP_RADIO"/"$radio"/ \
-e s/"#QMP_DEVICE"/"$device"/ \
......@@ -287,15 +290,15 @@ qmp_configure_wifi() {
# This function returns the default values
# - first parameter: is always what are you asking for (mode, channel, name,...)
# - second parameter: is device name, only needed by mode and channel
# - third parameter: is configured mode, only needed by chanel
# - third parameter: is configured mode, only needed by channel
qmp_wifi_get_default() {
local what="$1"
local device="$2"
# MODE
# default mode depens on several things:
# if only 1 device = adhoc
# default mode depends on several things:
# if only 1 device = adhoc_ap
# if only 1 bg device = ap
# else depending on index
......
wireless.#QMP_DEVICE.device=#QMP_RADIO
wireless.#QMP_DEVICE.mode=ap
wireless.#QMP_DEVICE.ssid=#QMP_SSID
wireless.#QMP_DEVICE.network=lan
wireless.#QMP_DEVICE.encryption=#QMP_ENC
wireless.#QMP_DEVICE.key=#QMP_KEY
wireless.#QMP_DEVICE.ifname=#QMP_IFNAME
......@@ -2,7 +2,6 @@ wireless.#QMP_DEVICE.device=#QMP_RADIO
wireless.#QMP_DEVICE.mode=sta
wireless.#QMP_DEVICE.ssid=#QMP_SSID
wireless.#QMP_DEVICE.network=#QMP_NETWORK
wireless.#QMP_DEVICE.encryption=#QMP_ENC
wireless.#QMP_DEVICE.key=#QMP_KEY
wireless.#QMP_DEVICE.ifname=#QMP_IFNAME
wireless.#QMP_DEVICE.encryption=#QMP_ENC
wireless.#QMP_DEVICE.key=#QMP_KEY
wireless.#QMP_DEVICE.ifname=#QMP_IFNAME
\ No newline at end of file
wireless.#QMP_DEVICE.device=#QMP_RADIO
wireless.#QMP_DEVICE.mode=sta
wireless.#QMP_DEVICE.ssid=#QMP_SSID
wireless.#QMP_DEVICE.network=#QMP_NETWORK
wireless.#QMP_DEVICE.encryption=#QMP_ENC
wireless.#QMP_DEVICE.key=#QMP_KEY
wireless.#QMP_DEVICE.ifname=#QMP_IFNAME
\ No newline at end of file
driver mac80211
country UZ
country US
bssid 02:CA:FF:EE:BA:BE
name qMp
txpower 17
......
......@@ -56,8 +56,8 @@ cc = s_wireless_main:option(ListValue, "country", translate("Country Code"), tra
cc.default = tostring(iw and iw.country or "00")
for _, s in ipairs(cl) do
cc:value(s.alpha2, "%s - %s" %{ s.alpha2, s.name })
end
end
-- else
-- s_wireless_main:option(Value, "country", translate("Country Code"), translate("Use ISO/IEC 3166 alpha2 country codes2."))
end
......@@ -90,10 +90,12 @@ for _,wdev in ipairs(wdevs) do
-- Mode
mode = s_wireless:option(ListValue,"mode","Mode")
mode:value("adhoc_ap","AdHoc (mesh) + Acess point (LAN)")
mode:value("adhoc","AdHoc (mesh)")
mode:value("ap","Master (mesh, no DHCP)")
mode:value("client","Client")
mode:value("adhoc_ap","Ad hoc (mesh) + access point (LAN)")
mode:value("adhoc","Ad hoc (mesh)")
mode:value("ap","Access point (mesh)")
mode:value("aplan","Access point (LAN)")
mode:value("client","Client (mesh)")
-- mode:value("clientwan","Client (WAN)")
mode:value("none","Disabled")
-- Name
......@@ -117,11 +119,14 @@ for _,wdev in ipairs(wdevs) do
end
-- WPA key
local key=s_wireless:option(Value,"key","WPA2 key",
translate("WPA2 key for AP (8 chars or more).<br/>Leave blank for make it OPEN (recomended)"))
local key=s_wireless:option(Value,"key","WPA2 key",
translate("WPA2 key for AP mode. The minimum lenght is 8 characters.<br/>Leave blank to make it OPEN (recommended)"))
key.default = ""
key:depends("mode","ap")
key:depends("mode","ap")
key:depends("mode","aplan")
key:depends("mode","adhoc_ap")
key:depends("mode","client")
--key:depends("mode","clientwan")
-- Txpower
txpower = s_wireless:option(ListValue,"txpower",translate("Transmission power (dBm)"),translate("Radio power in dBm. Each 3 dB increment doubles the power."))
......
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