diff --git a/scripts/experiment/setupKit.go b/scripts/experiment/setupKit.go new file mode 100644 index 0000000..b67441e --- /dev/null +++ b/scripts/experiment/setupKit.go @@ -0,0 +1,38 @@ +package main + +import ( + "bytes" + "fmt" + "log" + "os/exec" +) + +func scanWifi(iface string) string { + command := "iwinfo" + opt := "scan" + var out bytes.Buffer + var stderr bytes.Buffer + + fmt.Printf("Running %s command\n", command) + exe := exec.Command(command, iface, opt) + exe.Stdout = &out + exe.Stderr = &stderr + + err := exe.Run() + if err != nil { + fmt.Println(fmt.Sprint(err) + ": " + stderr.String()) + log.Fatal(err) + } + + return out.String() +} + +func getCellInfo(iface string, ssidPrefix string) { + cells := scanWifi(iface) + fmt.Printf("%s\n", cells) + +} + +func main() { + getCellInfo("wlan1", "Base1") +}