### Install ONVIF Library with Go Source: https://github.com/use-go/onvif/blob/master/README.md Installs the ONVIF library using the Go package manager. This command fetches and installs the specified Go module. ```go go get github.com/use-go/onvif ``` -------------------------------- ### Connect to ONVIF Device Source: https://github.com/use-go/onvif/blob/master/README.md Establishes a connection to an ONVIF device using its IP address and port. Requires specifying the device's network address. ```go dev, err := onvif.NewDevice(onvif.DeviceParams{Xaddr: "192.168.13.42:1234"}) ``` -------------------------------- ### Call ONVIF Service Method Source: https://github.com/use-go/onvif/blob/master/README.md Executes an ONVIF service method on a connected device. Requires the device object, authentication, and the defined data type for the method. ```go createUsers := device.CreateUsers{User: onvif.User{Username:"admin", Password:"qwerty", UserLevel:"User"}} device := onvif.NewDevice(onvif.DeviceParams{Xaddr: "192.168.13.42:1234", Username: "username", Password: password}) device.Authenticate("username", "password") resp, err := dev.CallMethod(createUsers) ``` -------------------------------- ### Authenticate ONVIF Device Connection Source: https://github.com/use-go/onvif/blob/master/README.md Connects to an ONVIF device with authentication credentials. This is necessary for services requiring user login. ```go device := onvif.NewDevice(onvif.DeviceParams{Xaddr: "192.168.13.42:1234", Username: "username", Password: password}) ``` -------------------------------- ### Define CreateUsers Data Type Source: https://github.com/use-go/onvif/blob/master/README.md Defines the data structure for the CreateUsers function in the ONVIF Device Management service. It requires a User object with username, password, and user level. ```go createUsers := device.CreateUsers{User: onvif.User{Username:"admin", Password:"qwerty", UserLevel:"User"}} ``` -------------------------------- ### Define GetCapabilities Data Type Source: https://github.com/use-go/onvif/blob/master/README.md Defines the data structure for the GetCapabilities function of the ONVIF Device service. The 'Category' parameter filters the capabilities returned. ```go capabilities := device.GetCapabilities{Category:"All"} ``` -------------------------------- ### Define GetServiceCapabilities Data Type Source: https://github.com/use-go/onvif/blob/master/README.md Defines the data structure for the GetServiceCapabilities function of the ONVIF PTZ service. This function does not accept any arguments. ```go ptzCapabilities := ptz.GetServiceCapabilities{} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.