Documentation
¶
Index ¶
- Constants
- Variables
- func IsAlarm(data string) bool
- func IsBeat(data string) bool
- func ParseDatetime(d string) (time.Time, error)
- func UnmarshalEventMessage(data []byte, r *EventMessage) error
- type Alarm
- type AlarmStatusInfo
- type Beat
- type BodyXML
- type Config
- type DeviceInfo
- type EventMessage
- type HeaderXML
- type NotifyXML
- type Onvifcam
Constants ¶
View Source
const ( TopicMotionAlarm = "tns1:VideoSource/MotionAlarm" V18 = "18" // ONVIF v18 V23 = "23" // ONVIF v23 )
Variables ¶
View Source
var ( ErrAlarm error = errors.New("error unmarshaling alarm") ErrBeat error = errors.New("error unmarshaling beat") )
View Source
var ( ErrFailedNew = errors.New("failed to set new device") ErrNoURIFrame = errors.New("failed to get URI for snapshot") ErrNoURIStream = errors.New("failed to get URI for stream") ErrSubscribe = errors.New("failed to subscribe") ErrUnmarshalEventMessage = errors.New("failed to unmarshal event message") ErrVersion = errors.New("method does not exist in ONVIF version") )
View Source
var ( EventChanged = "Changed" EventInitialized = "Initialized" )
Functions ¶
func UnmarshalEventMessage ¶
func UnmarshalEventMessage(data []byte, r *EventMessage) error
UnmarshalEventMessage is normally used by the handler of the http server listening for events.
Types ¶
type Alarm ¶ added in v0.3.0
type Alarm struct {
AlarmStatus AlarmStatusInfo `xml:"alarmStatusInfo"`
Datatime string `xml:"dataTime"`
DeviceInfo DeviceInfo `xml:"deviceInfo"`
}
func AlarmUnmarshal ¶ added in v0.3.0
type AlarmStatusInfo ¶ added in v0.3.0
type AlarmStatusInfo struct {
MotionAlarm bool `xml:"motionAlarm"`
PerimeterAlarm bool `xml:"perimeterAlarm"`
TripwireAlarm bool `xml:"tripwireAlarm"`
OscAlarm bool `xml:"oscAlarm"`
SceneChange bool `xml:"sceneChange"`
ClarityAbnormal bool `xml:"clarityAbnormal"`
ColorAbnormal bool `xml:"colorAbnormal"`
}
type Beat ¶ added in v0.3.0
type Beat struct {
Datatime string `xml:"dataTime"`
DeviceInfo DeviceInfo `xml:"deviceInfo"`
}
func BeatUnmarshal ¶ added in v0.3.0
type DeviceInfo ¶ added in v0.3.0
type EventMessage ¶
type NotifyXML ¶
type NotifyXML struct {
NotificationMessage event.NotificationMessage
}
type Onvifcam ¶
type Onvifcam struct {
// contains filtered or unexported fields
}
func New ¶
New returns a new bare ONVIF device using basic authentication. httpClient is used also by the ONVIF device implementation. It is set to a default client if not provided.
func (*Onvifcam) GetSnapshot ¶
GetSnapshot returns an image frame (jpeg) from the camera.
func (*Onvifcam) GetStreamURI ¶
GetStreamURI returns an rstp URI. For a rtsp client see https://pkg.go.dev/github.com/aler9/gortsplib#section-readme.
Click to show internal directories.
Click to hide internal directories.