add micro controller for clients - right interface
This commit is contained in:
parent
a683b6b1ac
commit
37cf186d32
|
@ -14,7 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
maxDB = 80
|
maxDB = -75
|
||||||
)
|
)
|
||||||
|
|
||||||
type Controller struct {
|
type Controller struct {
|
||||||
|
@ -49,7 +49,7 @@ func (c *Controller) Close() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Controller) tick() {
|
func (c *Controller) tick() {
|
||||||
c.sshMgmt.RunEverywhere("if [ \"$(uci get wireless.radio0.hwmode | grep -c a)\" -ne 0 ]; then echo \"radio0\"; elif [ \"$(uci get wireless.radio1.hwmode | grep -c a)\" -ne 0 ]; then echo \"radio1\"; fi", ssh.SSHResultToStringHandler(func(ip string, iface string, err error) {
|
c.sshMgmt.RunEverywhere("if [ \"$(uci get wireless.radio0.hwmode | grep -c a)\" -ne 0 ]; then echo \"client0\"; elif [ \"$(uci get wireless.radio1.hwmode | grep -c a)\" -ne 0 ]; then echo \"client1\"; fi", ssh.SSHResultToStringHandler(func(ip string, iface string, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ func (c *Controller) tick() {
|
||||||
|
|
||||||
c.no24Ghz[mac] = true
|
c.no24Ghz[mac] = true
|
||||||
|
|
||||||
if db > maxDB {
|
if db < maxDB {
|
||||||
|
|
||||||
node, ok := c.node[ip]
|
node, ok := c.node[ip]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
@ -91,7 +91,7 @@ func (c *Controller) tick() {
|
||||||
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
c.sshMgmt.RunEverywhere("if [ \"$(uci get wireless.radio0.hwmode | grep -c g)\" -ne 0 ]; then echo \"radio0\"; elif [ \"$(uci get wireless.radio1.hwmode | grep -c g)\" -ne 0 ]; then echo \"radio1\"; fi", ssh.SSHResultToStringHandler(func(ip string, iface string, err error) {
|
c.sshMgmt.RunEverywhere("if [ \"$(uci get wireless.radio0.hwmode | grep -c g)\" -ne 0 ]; then echo \"client0\"; elif [ \"$(uci get wireless.radio1.hwmode | grep -c g)\" -ne 0 ]; then echo \"client1\"; fi", ssh.SSHResultToStringHandler(func(ip string, iface string, err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ func (c *Controller) tick() {
|
||||||
c.sshMgmt.ExecuteOn(addr, cmd)
|
c.sshMgmt.ExecuteOn(addr, cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
if db > maxDB {
|
if db < maxDB {
|
||||||
|
|
||||||
node, ok := c.node[ip]
|
node, ok := c.node[ip]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|
Loading…
Reference in New Issue