HTTP client for ConnectBox routers used by Ziggo internet provider in the Netherlands.
import "github.com/tetafro/connectbox"
client, err := connectbox.NewClient("http://192.168.178.1", "NULL", "password")
if err != nil {
log.Fatalf("Failed to init ConnectBox client: %v", err)
}
if err := client.Login(ctx); err != nil {
log.Fatalf("Failed to login: %v", err)
}
var data CMSystemInfo
err := client.Get(ctx, FnCMSystemInfo, &data)
if err != nil {
log.Fatalf("Failed to get CMSystemInfo: %v", err)
}
log.Printf("System uptime: %s", data.SystemUptime)
if err := client.Logout(ctx); err != nil {
log.Fatalf("Failed to logout: %v", err)
}