Add SOAP action support.

This commit is contained in:
John Beisley
2013-09-29 11:23:10 +01:00
parent 489c180de9
commit 1b8d66b887
3 changed files with 119 additions and 3 deletions

View File

@ -19,7 +19,16 @@ func (i indentLevel) String() string {
func displayDevice(indent indentLevel, device *goupnp.Device) {
fmt.Println(indent.String(), device)
for _, srv := range device.Services {
fmt.Println((indent + 1).String(), srv)
fmt.Println((indent + 1).String(), srv, srv.SCPDURL.URL.String(), srv.ControlURL.URL.String())
fmt.Println(goupnp.ServiceTypeWANPPPConnection, srv.ServiceType)
if srv.ServiceType == goupnp.ServiceTypeWANPPPConnection {
results, err := goupnp.PerformSoapAction(goupnp.ServiceTypeWANPPPConnection, "GetExternalIPAddress", &srv.ControlURL.URL, nil)
if err != nil {
fmt.Println(err)
} else {
fmt.Println(results)
}
}
}
for _, subdev := range device.Devices {
displayDevice(indent+1, subdev)