Some improvements at Device.go. Adding WS security

This commit is contained in:
yakovlevdmv
2018-04-04 22:42:40 +03:00
parent a72fd9bcf5
commit 25ec776ded
2 changed files with 99 additions and 0 deletions

View File

@@ -15,8 +15,34 @@ import (
"github.com/yakovlevdmv/goonvif/Media"
"github.com/yakovlevdmv/goonvif/PTZ"
"errors"
"strconv"
)
type DeviceType int
const (
NVD DeviceType = iota
NVS
NVA
NVT
)
func (devType DeviceType) String() string {
stringRepresentation := []string {
"NetworkVideoDisplay",
"NetworkVideoStorage",
"NetworkVideoAnalytics",
"NetworkVideoTransmitter",
}
i := uint8(devType)
switch {
case i <= uint8(NVT):
return stringRepresentation[i]
default:
return strconv.Itoa(int(i))
}
}
//deviceInfo struct contains general information about ONVIF device
type deviceInfo struct {
Manufacturer string
@@ -42,6 +68,10 @@ type device struct {
}
func getAvailableDevicesAtEthernet(interfaceName string) {
}
//NewDevice function construct a ONVIF Device entity
func NewDevice() *device {
return &device{}