Add correct spelling for RequestSCPD, mentioned in issue #23.

This commit is contained in:
John Beisley 2018-03-04 21:55:55 +00:00
parent dceda08e70
commit 71cfb6bbcb
2 changed files with 9 additions and 3 deletions

View File

@ -23,7 +23,7 @@ func main() {
dev := &c.ServiceClient.RootDevice.Device
srv := c.ServiceClient.Service
fmt.Println(dev.FriendlyName, " :: ", srv.String())
scpd, err := srv.RequestSCDP()
scpd, err := srv.RequestSCPD()
if err != nil {
fmt.Printf(" Error requesting service SCPD: %v\n", err)
} else {

View File

@ -147,9 +147,9 @@ func (srv *Service) String() string {
return fmt.Sprintf("Service ID %s : %s", srv.ServiceId, srv.ServiceType)
}
// RequestSCDP requests the SCPD (soap actions and state variables description)
// RequestSCPD requests the SCPD (soap actions and state variables description)
// for the service.
func (srv *Service) RequestSCDP() (*scpd.SCPD, error) {
func (srv *Service) RequestSCPD() (*scpd.SCPD, error) {
if !srv.SCPDURL.Ok {
return nil, errors.New("bad/missing SCPD URL, or no URLBase has been set")
}
@ -160,6 +160,12 @@ func (srv *Service) RequestSCDP() (*scpd.SCPD, error) {
return s, nil
}
// RequestSCDP is for compatibility only, prefer RequestSCPD. This was a
// misspelling of RequestSCDP.
func (srv *Service) RequestSCDP() (*scpd.SCPD, error) {
return srv.RequestSCPD()
}
func (srv *Service) NewSOAPClient() *soap.SOAPClient {
return soap.NewSOAPClient(srv.ControlURL.URL)
}