diff --git a/network/wifi_station.go b/network/wifi_station.go index b0659da0..4fb0f06b 100644 --- a/network/wifi_station.go +++ b/network/wifi_station.go @@ -1,5 +1,10 @@ package network +import ( + "fmt" + "strconv" +) + type Station struct { *Endpoint Frequency int `json:"frequency"` @@ -9,6 +14,19 @@ type Station struct { Encryption string `json:"encryption"` } +func cleanESSID(essid string) string { + res := "" + + for _, c := range essid { + if strconv.IsPrint(c) { + res += string(c) + } else { + res += fmt.Sprintf("{0x%02x}", c) + } + } + return res +} + func NewStation(essid, bssid string, frequency int, rssi int8) *Station { return &Station{ Endpoint: NewEndpointNoResolve(MonitorModeAddress, bssid, essid, 0),