Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
2b9dd54f
Unverified
Commit
2b9dd54f
authored
7 years ago
by
Matthias Schiffer
Browse files
Options
Downloads
Patches
Plain Diff
gluon-client-bridge: fix 320-gluon-client-bridge-wireless coding style
parent
51a3e8e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
package/gluon-client-bridge/luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless
+33
-35
33 additions, 35 deletions
...luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless
with
33 additions
and
35 deletions
package/gluon-client-bridge/luasrc/lib/gluon/upgrade/320-gluon-client-bridge-wireless
+
33
−
35
View file @
2b9dd54f
...
...
@@ -7,48 +7,46 @@ local uci = require('simple-uci').cursor()
local
function
is_disabled
(
config
,
name
)
local
disabled
if
uci
:
get
(
'wireless'
,
name
)
then
disabled
=
uci
:
get_bool
(
'wireless'
,
name
,
'disabled'
)
else
disabled
=
config
and
config
.
disabled
end
return
disabled
local
disabled
if
uci
:
get
(
'wireless'
,
name
)
then
disabled
=
uci
:
get_bool
(
'wireless'
,
name
,
'disabled'
)
else
disabled
=
config
and
config
.
disabled
end
return
disabled
end
local
function
configure_client
(
config
,
radio
,
index
,
suffix
)
local
name
=
'client_'
..
radio
local
disabled
=
is_disabled
(
config
,
name
)
uci
:
delete
(
'wireless'
,
name
)
if
not
config
then
return
end
local
macaddr
=
util
.
get_wlan_mac
(
uci
,
radio
,
index
,
1
)
if
not
macaddr
then
return
end
uci
:
section
(
'wireless'
,
'wifi-iface'
,
name
,
{
device
=
radio
,
network
=
'client'
,
mode
=
'ap'
,
ssid
=
config
.
ssid
,
macaddr
=
macaddr
,
ifname
=
suffix
and
'client'
..
suffix
,
disabled
=
disabled
or
false
,
}
)
local
name
=
'client_'
..
radio
local
disabled
=
is_disabled
(
config
,
name
)
uci
:
delete
(
'wireless'
,
name
)
if
not
config
then
return
end
local
macaddr
=
util
.
get_wlan_mac
(
uci
,
radio
,
index
,
1
)
if
not
macaddr
then
return
end
uci
:
section
(
'wireless'
,
'wifi-iface'
,
name
,
{
device
=
radio
,
network
=
'client'
,
mode
=
'ap'
,
ssid
=
config
.
ssid
,
macaddr
=
macaddr
,
ifname
=
suffix
and
'client'
..
suffix
,
disabled
=
disabled
or
false
,
})
end
local
function
configure_radio
(
radio
,
index
,
config
)
local
suffix
=
radio
:
match
(
'^radio(%d+)$'
)
local
suffix
=
radio
:
match
(
'^radio(%d+)$'
)
configure_client
(
config
.
ap
,
radio
,
index
,
suffix
)
configure_client
(
config
.
ap
,
radio
,
index
,
suffix
)
end
util
.
iterate_radios
(
uci
,
configure_radio
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment