mirror of
				https://github.com/kerberos-io/onvif.git
				synced 2025-10-31 10:56:38 +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. | //You should use Authenticate method to call authorized requests. | ||||||
| func (dev Device) CallMethod(method interface{}) (*http.Response, error) { | func (dev Device) CallMethod(method interface{}) (*http.Response, error) { | ||||||
| 	pkgPath := strings.Split(reflect.TypeOf(method).PkgPath(), "/") | 	pkgPath := strings.Split(reflect.TypeOf(method).PkgPath(), "/") | ||||||
| 	pkg := pkgPath[len(pkgPath)-1] | 	pkg := strings.ToLower(pkgPath[len(pkgPath)-1]) | ||||||
|  |  | ||||||
| 	var endpoint string | 	var endpoint string | ||||||
| 	switch pkg { | 	switch pkg { | ||||||
| 	case "Device": | 	case "device": | ||||||
| 		endpoint = dev.endpoints["Device"] | 		endpoint = dev.endpoints["Device"] | ||||||
| 	case "Event": | 	case "event": | ||||||
| 		endpoint = dev.endpoints["Event"] | 		endpoint = dev.endpoints["Event"] | ||||||
| 	case "Imaging": | 	case "imaging": | ||||||
| 		endpoint = dev.endpoints["Imaging"] | 		endpoint = dev.endpoints["Imaging"] | ||||||
| 	case "Media": | 	case "media": | ||||||
| 		endpoint = dev.endpoints["Media"] | 		endpoint = dev.endpoints["Media"] | ||||||
| 	case "PTZ": | 	case "ptz": | ||||||
| 		endpoint = dev.endpoints["PTZ"] | 		endpoint = dev.endpoints["PTZ"] | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Eamon
					Eamon