mirror of
https://github.com/kerberos-io/onvif.git
synced 2025-10-29 18:21:55 +08:00
update string comparison in callmethod
This commit is contained in:
12
Device.go
12
Device.go
@@ -225,19 +225,19 @@ func buildMethodSOAP(msg string) (gosoap.SoapMessage, error) {
|
||||
//You should use Authenticate method to call authorized requests.
|
||||
func (dev Device) CallMethod(method interface{}) (*http.Response, error) {
|
||||
pkgPath := strings.Split(reflect.TypeOf(method).PkgPath(), "/")
|
||||
pkg := pkgPath[len(pkgPath)-1]
|
||||
pkg := strings.ToLower(pkgPath[len(pkgPath)-1])
|
||||
|
||||
var endpoint string
|
||||
switch pkg {
|
||||
case "Device":
|
||||
case "device":
|
||||
endpoint = dev.endpoints["Device"]
|
||||
case "Event":
|
||||
case "event":
|
||||
endpoint = dev.endpoints["Event"]
|
||||
case "Imaging":
|
||||
case "imaging":
|
||||
endpoint = dev.endpoints["Imaging"]
|
||||
case "Media":
|
||||
case "media":
|
||||
endpoint = dev.endpoints["Media"]
|
||||
case "PTZ":
|
||||
case "ptz":
|
||||
endpoint = dev.endpoints["PTZ"]
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user