Fix for ONVIF preset (json)

This commit is contained in:
Cedric Verstraeten
2023-08-24 12:36:15 +02:00
parent 23e1c0b1bc
commit c037b63bad
2 changed files with 45 additions and 45 deletions

View File

@@ -1,10 +1,10 @@
# onvif protocol
# ONVIF protocol
Simple management of onvif IP-devices cameras. onvif is an implementation of ONVIF protocol for managing onvif IP devices. The purpose of this library is convenient and easy management of IP cameras and other devices that support ONVIF standard.
Simple management of onvif IP-devices cameras. onvif is an implementation of ONVIF protocol for managing onvif IP devices. The purpose of this library is convenient and easy management of IP cameras and other devices that support ONVIF standard.
## Installation
To install the library, use **go get**:
To install the library, use **go get**:
```go
go get github.com/kerberos-io/onvif
@@ -28,20 +28,20 @@ The following services are implemented:
### General concept
1) Connecting to the device
2) Authentication (if necessary)
3) Defining Data Types
4) Carrying out the required method
1. Connecting to the device
2. Authentication (if necessary)
3. Defining Data Types
4. Carrying out the required method
#### Connecting to the device
If there is a device on the network at the address *192.168.13.42*, and its ONVIF services use the *1234* port, then you can connect to the device in the following way:
If there is a device on the network at the address _192.168.13.42_, and its ONVIF services use the _1234_ port, then you can connect to the device in the following way:
```go
dev, err := onvif.NewDevice(onvif.DeviceParams{Xaddr: "192.168.13.42:1234"})
```
*The ONVIF port may differ depending on the device , to find out which port to use, you can go to the web interface of the device. **Usually this is 80 port.***
\*The ONVIF port may differ depending on the device , to find out which port to use, you can go to the web interface of the device. **Usually this is 80 port.\***
#### Authentication
@@ -75,7 +75,7 @@ The figure below shows that `GetServiceCapabilities` does not accept any argumen
![PTZ GetServiceCapabilities](docs/img/GetServiceCapabilities.png)
*Common data types are in the xsd/onvif package. The types of data (structures) that can be shared by all services are defined in the onvif package.*
_Common data types are in the xsd/onvif package. The types of data (structures) that can be shared by all services are defined in the onvif package._
An example of how to define the data type of the CreateUsers function in [Devicemgmt](https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl):

View File

@@ -468,10 +468,10 @@ type IPAddress struct {
type IPType xsd.String
//IPv4 address
// IPv4 address
type IPv4Address xsd.Token
//IPv6 address
// IPv6 address
type IPv6Address xsd.Token
type AudioEncoderConfiguration struct {
@@ -825,7 +825,7 @@ type Transport struct {
Tunnel *Transport `xml:"onvif:Tunnel"`
}
//enum
// enum
type TransportProtocol xsd.String
type MediaUri struct {
@@ -952,7 +952,7 @@ type PTZSpaces struct {
type PTZSpacesExtension xsd.AnyType
//TODO: restriction
// TODO: restriction
type AuxiliaryData xsd.String
type PTZNodeExtension struct {
@@ -1019,15 +1019,15 @@ type PTZPreset struct {
}
type PTZVector struct {
PanTilt Vector2D `xml:"onvif:PanTilt,omitempty"`
Zoom Vector1D `xml:"onvif:Zoom,omitempty"`
PanTilt Vector2D `xml:"PanTilt,omitempty"`
Zoom Vector1D `xml:"Zoom,omitempty"`
}
type PTZStatus struct {
Position PTZVector
MoveStatus PTZMoveStatus
Error string
UtcTime xsd.DateTime
Position PTZVector `xml:"Position"`
MoveStatus PTZMoveStatus `xml:"MoveStatus"`
Error string `xml:"Error"`
UtcTime xsd.DateTime `xml:"UtcTime"`
}
type PTZMoveStatus struct {
@@ -1219,7 +1219,7 @@ type UserExtension xsd.String
type CapabilityCategory xsd.String
//Capabilities of device
// Capabilities of device
type Capabilities struct {
Analytics AnalyticsCapabilities
Device DeviceCapabilities
@@ -1230,14 +1230,14 @@ type Capabilities struct {
Extension CapabilitiesExtension
}
//AnalyticsCapabilities Check
// AnalyticsCapabilities Check
type AnalyticsCapabilities struct {
XAddr xsd.AnyURI
RuleSupport xsd.Boolean
AnalyticsModuleSupport xsd.Boolean
}
//DeviceCapabilities Check
// DeviceCapabilities Check
type DeviceCapabilities struct {
XAddr xsd.AnyURI
Network NetworkCapabilities
@@ -1247,7 +1247,7 @@ type DeviceCapabilities struct {
Extension DeviceCapabilitiesExtension
}
//NetworkCapabilities Check
// NetworkCapabilities Check
type NetworkCapabilities struct {
IPFilter xsd.Boolean
ZeroConfiguration xsd.Boolean
@@ -1256,16 +1256,16 @@ type NetworkCapabilities struct {
Extension NetworkCapabilitiesExtension
}
//NetworkCapabilitiesExtension Check
// NetworkCapabilitiesExtension Check
type NetworkCapabilitiesExtension struct {
Dot11Configuration xsd.Boolean
Extension NetworkCapabilitiesExtension2
}
//NetworkCapabilitiesExtension2 Extension2
// NetworkCapabilitiesExtension2 Extension2
type NetworkCapabilitiesExtension2 xsd.AnyType
//SystemCapabilities check
// SystemCapabilities check
type SystemCapabilities struct {
DiscoveryResolve xsd.Boolean
DiscoveryBye xsd.Boolean
@@ -1460,7 +1460,7 @@ type DynamicDNSInformation struct {
Extension DynamicDNSInformationExtension
}
//TODO: enumeration
// TODO: enumeration
type DynamicDNSType xsd.String
type DynamicDNSInformationExtension xsd.AnyType
@@ -1497,7 +1497,7 @@ type NetworkInterfaceConnectionSetting struct {
Duplex Duplex `xml:"onvif:Duplex"`
}
//TODO: enum
// TODO: enum
type Duplex xsd.String
type NetworkInterfaceExtension struct {
@@ -1539,19 +1539,19 @@ type Dot11PSKPassphrase xsd.String
type Dot11PSK xsd.HexBinary
//TODO: enumeration
// TODO: enumeration
type Dot11Cipher xsd.String
//TODO: enumeration
// TODO: enumeration
type Dot11SecurityMode xsd.String
//TODO: restrictions
// TODO: restrictions
type NetworkInterfaceConfigPriority xsd.Integer
//TODO: enumeration
// TODO: enumeration
type Dot11StationMode xsd.String
//TODO: restrictions
// TODO: restrictions
type Dot11SSIDType xsd.HexBinary
type Dot3Configuration xsd.String
@@ -1578,7 +1578,7 @@ type PrefixedIPv6Address struct {
PrefixLength xsd.Int `xml:"onvif:PrefixLength"`
}
//TODO: enumeration
// TODO: enumeration
type IPv6DHCPConfiguration xsd.String
type IPv4NetworkInterface struct {
@@ -1593,7 +1593,7 @@ type IPv4Configuration struct {
DHCP xsd.Boolean
}
//optional, unbounded
// optional, unbounded
type PrefixedIPv4Address struct {
Address IPv4Address `xml:"onvif:Address"`
PrefixLength xsd.Int `xml:"onvif:PrefixLength"`
@@ -1638,7 +1638,7 @@ type NetworkProtocol struct {
type NetworkProtocolExtension xsd.AnyType
//TODO: enumeration
// TODO: enumeration
type NetworkProtocolType xsd.String
type NetworkGateway struct {
@@ -1669,11 +1669,11 @@ type IPAddressFilter struct {
type IPAddressFilterExtension xsd.AnyType
//enum { 'Allow', 'Deny' }
//TODO: enumeration
// enum { 'Allow', 'Deny' }
// TODO: enumeration
type IPAddressFilterType xsd.String
//TODO: attribite <xs:attribute ref="xmime:contentType" use="optional"/>
// TODO: attribite <xs:attribute ref="xmime:contentType" use="optional"/>
type BinaryData struct {
X ContentType `xml:"xmime:contentType,attr"`
Data xsd.Base64Binary `xml:"onvif:Data"`
@@ -1700,13 +1700,13 @@ type RelayOutputSettings struct {
IdleState RelayIdleState `xml:"onvif:IdleState"`
}
//TODO:enumeration
// TODO:enumeration
type RelayIdleState xsd.String
//TODO: enumeration
// TODO: enumeration
type RelayMode xsd.String
//TODO: enumeration
// TODO: enumeration
type RelayLogicalState xsd.String
type CertificateWithPrivateKey struct {
@@ -1782,7 +1782,7 @@ type Dot11Status struct {
ActiveConfigAlias ReferenceToken
}
//TODO: enumeration
// TODO: enumeration
type Dot11SignalStrength xsd.String
type Dot11AvailableNetworks struct {
@@ -1797,7 +1797,7 @@ type Dot11AvailableNetworks struct {
type Dot11AvailableNetworksExtension xsd.AnyType
//TODO: enumeration
// TODO: enumeration
type Dot11AuthAndMangementSuite xsd.String
type SystemLogUriList struct {