This commit is contained in:
parent
7fdaac3240
commit
a3ecb2d8ae
21
unms.go
21
unms.go
@ -62,7 +62,7 @@ func processUNMSAPI() ([]node, []link) {
|
||||
// check if remote mac address is part of our published network
|
||||
for i := range airmaxes {
|
||||
if isRemoteMACpublished(airmaxes[i].DeviceIdentification.MAC, d.Devices) {
|
||||
//links = UnmsAddLink(dev, airmaxes[i], links)
|
||||
links = UnmsAddLink(dev, airmaxes[i], links)
|
||||
}
|
||||
}
|
||||
// END OF API CALL 3
|
||||
@ -321,3 +321,22 @@ func UnmsGetAddresses(ip string) []string {
|
||||
adresses = append(adresses, strings.Split(ip, "/")[0])
|
||||
return adresses
|
||||
}
|
||||
|
||||
func UnmsAddLink(dev unifiAPIResponse, airmaxes unifiAPIAirmax, links []link) []link {
|
||||
for i := range links {
|
||||
if links[i].SourceAddr == airmaxes.DeviceIdentification.MAC {
|
||||
// link already exists
|
||||
return links
|
||||
}
|
||||
}
|
||||
links = append(links, link{
|
||||
Type: "wifi",
|
||||
Source: strings.ReplaceAll(dev.Identification.MAC, ":", ""),
|
||||
Target: strings.ReplaceAll(airmaxes.DeviceIdentification.MAC, ":", ""),
|
||||
SourceTQ: airmaxes.Statistics.LinkScore,
|
||||
TargetTQ: airmaxes.Statistics.LinkScore,
|
||||
SourceAddr: dev.Identification.MAC,
|
||||
TargetAddr: airmaxes.DeviceIdentification.MAC,
|
||||
})
|
||||
return links
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user