From 61577bd15bd8e230faf333e050b44257cb78c894 Mon Sep 17 00:00:00 2001 From: John Beisley Date: Sun, 29 Sep 2013 16:15:35 +0100 Subject: [PATCH] Seems that searching for a service also works. --- cmd/discoverigd/discoverigd.go | 2 +- goupnp.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/discoverigd/discoverigd.go b/cmd/discoverigd/discoverigd.go index 392aa80..4bcd98c 100644 --- a/cmd/discoverigd/discoverigd.go +++ b/cmd/discoverigd/discoverigd.go @@ -36,7 +36,7 @@ func displayDevice(indent indentLevel, device *goupnp.Device) { } func main() { - if results, err := goupnp.DiscoverDevices(goupnp.DeviceTypeInternetGatewayDevice); err != nil { + if results, err := goupnp.DiscoverDevices(goupnp.ServiceTypeWANPPPConnection); err != nil { fmt.Println("Error discovering InternetGatewayDevice with UPnP: ", err) } else { fmt.Printf("Discovered %d InternetGatewayDevices:\n", len(results)) diff --git a/goupnp.go b/goupnp.go index 57fa359..afa6fdb 100644 --- a/goupnp.go +++ b/goupnp.go @@ -40,9 +40,9 @@ type MaybeRootDevice struct { } // DiscoverDevices attempts to find targets of the given type. searchTarget is -// typically a value from a DeviceType* constant. An error is returned for -// errors while attempting to send the query. An error or RootDevice is -// returned for each discovered service. +// typically a value from a DeviceType* or ServiceType* constant. An error is +// returned for errors while attempting to send the query. An error or +// RootDevice is returned for each discovered service. func DiscoverDevices(searchTarget string) ([]MaybeRootDevice, error) { httpu, err := NewHTTPUClient() if err != nil {