23 lines
412 B
Go
23 lines
412 B
Go
package onvif
|
|
|
|
import (
|
|
"github.com/IOTechSystems/onvif"
|
|
)
|
|
|
|
type Connection struct {
|
|
Device *onvif.Device `json:"device"`
|
|
}
|
|
|
|
func NewConnection(xaddr string, username string, password string) (*Connection, error) {
|
|
dev, err := onvif.NewDevice(onvif.DeviceParams{
|
|
Xaddr: xaddr,
|
|
Username: username,
|
|
Password: password,
|
|
})
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &Connection{Device: dev}, nil
|
|
}
|