package openwrt import ( "fmt" "strings" ) // WifiCell reprensents wifi network Cell type WifiCell struct { // The SSID Ssid string // The cell mac adress MacAdress string } // NewWifiCell returns a new WifiCell object func NewWifiCell(ssid string, mac string) *WifiCell { return &WifiCell{ Ssid: ssid, MacAdress: mac, } } // GetWifiCells retrieves all availabe wifi cells for a card ! func GetWifiCells(iface string) { res := run("iwinfo", iface, "scan") for _, line := range strings.Split(strings.TrimSuffix(res.Stdout, "\n"), "\n") { fmt.Println(line) } }