axevent

package
v1.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package axeventwrapper provides a Go wrapper around the axevent C library, facilitating the integration and manipulation of event systems within Axis devices.

Important:

This package relies on CGo for integration with the axevent C library and the GLib library, necessitating a running GMainLoop for proper operation.

Index

Constants

This section is empty.

Variables

View Source
var (
	OnfivNameSpaceTns1    string = "tns1"
	OnfivNameSpaceTnsAxis string = "tnsaxis"
	OnfivTagOnKeyValue    string = "tag-on-key-value"
)

Functions

func GoDeclarationCompleteCallback

func GoDeclarationCompleteCallback(declaration C.guint, user_data unsafe.Pointer)

func GoSubscriptionCallback

func GoSubscriptionCallback(subscription C.guint, event *C.AXEvent, user_data unsafe.Pointer)

Types

type AXEventHandler

type AXEventHandler struct {
	Ptr *C.AXEventHandler
	// contains filtered or unexported fields
}

https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axevent/html/ax__event__handler_8h.html#ae40c17762e9ed663356e34c5a9ea05fe

func (*AXEventHandler) Free

func (eh *AXEventHandler) Free()

Destroys an AXEventHandler an deallocates all associated declarations and subscriptions. Any pending callbacks associated with the AXEventHandler will be cancelled.

https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axevent/html/ax__event__handler_8h.html#ac8fa0ee5cba77fffffad4153833b040d

func (*AXEventHandler) OnEvent

func (eh *AXEventHandler) OnEvent(kvs *AXEventKeyValueSet, callback func(*Event)) (subscription int, err error)

OnEvent creates a subscription callback for the given event key value set.

func (*AXEventHandler) Undeclare

func (evt *AXEventHandler) Undeclare(declaration int) error

Undeclares an event. Any pending callbacks associated with the declaration will be cancelled.

https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axevent/html/ax__event__handler_8h.html#a61d4484571aacc5547f9e5bf524fd01d

type AXEventKeyValueSet

type AXEventKeyValueSet struct {
	Ptr *C.AXEventKeyValueSet
}

https://axiscommunications.github.io/acap-documentation/3.5/api/axevent/html/ax__event__key__value__set_8h.html

func AutofocusEventKvs

func AutofocusEventKvs(videoSourceConfigurationToken *int) (*AXEventKeyValueSet, error)

func CameraApplicationPlatformVmdCamera1ProfileANYEventKvs

func CameraApplicationPlatformVmdCamera1ProfileANYEventKvs(active *bool) (*AXEventKeyValueSet, error)

func DayNightEventKvs

func DayNightEventKvs(videoSourceConfigurationToken *int, day *bool) (*AXEventKeyValueSet, error)

func DigitalInputEventKvs

func DigitalInputEventKvs(inputToken *int, logicalState *bool) (*AXEventKeyValueSet, error)

func GlobalSceneChangeEventKvs

func GlobalSceneChangeEventKvs(source *string, state *bool) (*AXEventKeyValueSet, error)

func HeaterStatusEventKvs

func HeaterStatusEventKvs(heater *int, running *bool) (*AXEventKeyValueSet, error)

func LiveStreamAccessedEventKvs

func LiveStreamAccessedEventKvs() (*AXEventKeyValueSet, error)

func MotionAlarmEventKvs

func MotionAlarmEventKvs(source *string, state *bool) (*AXEventKeyValueSet, error)

func NewAXEventKeyValueSet

func NewAXEventKeyValueSet() *AXEventKeyValueSet

Creates a new AXEventKeyValueSet

func NewAXEventKeyValueSetFromEntries

func NewAXEventKeyValueSetFromEntries(entries []KeyValueEntrie) *AXEventKeyValueSet

Creates a new AXEventKeyValueSet from a list of KeyValueEntries

func NewTns1AxisEvent

func NewTns1AxisEvent(topic0 string, topic1 string, topic2 *string, topic3 *string, keyvalues []*KeyValueEntrie) (*AXEventKeyValueSet, error)

NewTns1AxisEvent creates a new AXEventKeyValueSet with the given topics and key-value pairs.

func NewTnsAxisEvent

func NewTnsAxisEvent(topic0 string, topic1 string, topic2 *string, topic3 *string, keyvalues []*KeyValueEntrie) (*AXEventKeyValueSet, error)

TnsAxisEvent creates a new AXEventKeyValueSet with the given topics and key-value pairs.

func StorageAlertEventKvs

func StorageAlertEventKvs(wear *int, overall_health *int, temperature *int, alert *bool) (*AXEventKeyValueSet, error)

func StorageDisruptionEventKvs

func StorageDisruptionEventKvs(disk_id *string, disruption *bool) (*AXEventKeyValueSet, error)

func StorageFailureEventKvs

func StorageFailureEventKvs(disk_id *string, disruption *bool) (*AXEventKeyValueSet, error)

func StorageRecordingEventKvs

func StorageRecordingEventKvs(recording *bool) (*AXEventKeyValueSet, error)

func SupervisedPortEventKvs

func SupervisedPortEventKvs(port *int, tampered *bool) (*AXEventKeyValueSet, error)

func SystemReadyStatusEventKvs

func SystemReadyStatusEventKvs(ready *bool) (*AXEventKeyValueSet, error)

func TamperingEventKvs

func TamperingEventKvs(channel *int, tampering *int) (*AXEventKeyValueSet, error)

func TriggerRelayEventKvs

func TriggerRelayEventKvs(relayToken *int, logicalState *string) (*AXEventKeyValueSet, error)

func VirtualInputEventKvs

func VirtualInputEventKvs(port *int, active *bool) (*AXEventKeyValueSet, error)

func (*AXEventKeyValueSet) AddKeyValue

func (axEventKeyValueSet *AXEventKeyValueSet) AddKeyValue(key string, namespace *string, value interface{}, value_type AXEventValueType) error

Adds an key value to the event set

func (*AXEventKeyValueSet) AddNiceNames

func (axEventKeyValueSet *AXEventKeyValueSet) AddNiceNames(key string, namespace *string, keyNiceName *string, valueNiceName *string) error

AddNiceNames sets human-readable names for a key/value pair in an AXEventKeyValueSet.

func (*AXEventKeyValueSet) Free

func (axEventKeyValueSet *AXEventKeyValueSet) Free()

Frees an AXEventKeyValueSet.

func (*AXEventKeyValueSet) GetBoolean

func (axEventKeyValueSet *AXEventKeyValueSet) GetBoolean(key string, namespace *string) (bool, error)

Retrieve the boolean value associated with a key.

func (*AXEventKeyValueSet) GetDouble

func (axEventKeyValueSet *AXEventKeyValueSet) GetDouble(key string, namespace *string) (float64, error)

Retrieve the double value associated with a key.

func (*AXEventKeyValueSet) GetInteger

func (axEventKeyValueSet *AXEventKeyValueSet) GetInteger(key string, namespace *string) (int, error)

Retrieve the integer value associated with a key.

func (*AXEventKeyValueSet) GetString

func (axEventKeyValueSet *AXEventKeyValueSet) GetString(key string, namespace *string) (string, error)

Retrieve the value type of the value associated with a key.

func (*AXEventKeyValueSet) GetValueType

func (axEventKeyValueSet *AXEventKeyValueSet) GetValueType(key string, namespace *string) (AXEventValueType, error)

Retrieve the value type of the value associated with a key.

func (*AXEventKeyValueSet) MarkAsData

func (axEventKeyValueSet *AXEventKeyValueSet) MarkAsData(key string, namespace *string) error

Mark a key in the AXEventKeyValueSet as data. A data key is a key that represents the state of what the event represents. E.g. an event declaration that represents an I/O port should have a key marked as data which represents the state, high or low, of the port. Please note that although it is possible to mark more than one key as data, only events with one and only one data key can be used to trigger actions.

func (*AXEventKeyValueSet) MarkAsSource

func (axEventKeyValueSet *AXEventKeyValueSet) MarkAsSource(key string, namespace *string) error

Mark a key in the AXEventKeyValueSet as a source. A source key is an identifier used to distinguish between multiple instances of the same event declaration. E.g. if a device has multiple I/O ports then event declarations that represent the state of each port will have the same keys but different values. The key that represents which port the event represents should be marked as source and the key which represents the state should be marked as data. Please note that although it is possible to mark more than one key as a source, only events with zero or one source keys can be used to trigger actions.

func (*AXEventKeyValueSet) MarkAsUserDefined

func (axEventKeyValueSet *AXEventKeyValueSet) MarkAsUserDefined(key string, namespace *string, userTag *string) error

Mark a key in AXEventKeyValueSet with an user defined tag.

func (*AXEventKeyValueSet) RemoveKey

func (axEventKeyValueSet *AXEventKeyValueSet) RemoveKey(key string, namespace *string) error

Removes a key and its associated value from an AXEventKeyValueSet.

type AutofocusEvent

type AutofocusEvent struct {
	VideoSourceConfigurationToken int     `eventKey:"VideoSourceConfigurationToken"`
	Focus                         float64 `eventKey:"focus"`
}

type AxEventKeyValueSetDataMark

type AxEventKeyValueSetDataMark struct {
	Key       string
	Namespace *string
}

Mark a key in the AXEventKeyValueSet as data. A data key is a key that represents the state of what the event represents. E.g. an event declaration that represents an I/O port should have a key marked as data which represents the state, high or low, of the port. Please note that although it is possible to mark more than one key as data, only events with one and only one data key can be used to trigger actions.

type AxEventKeyValueSetNiceNames

type AxEventKeyValueSetNiceNames struct {
	Key           string
	Namespace     *string
	KeyNiceName   *string
	ValueNiceName *string
}

Set the nice names of a key/value pair in the AXEventKeyValueSet. Nice names can be used to display human-readable information about the key/value pair.

type AxEventKeyValueSetSourceMark

type AxEventKeyValueSetSourceMark struct {
	Key       string
	Namespace *string
}

Mark a key in the AXEventKeyValueSet as a source. A source key is an identifier used to distinguish between multiple instances of the same event declaration. E.g. if a device has multiple I/O ports then event declarations that represent the state of each port will have the same keys but different values. The key that represents which port the event represents should be marked as source and the key which represents the state should be marked as data. Please note that although it is possible to mark more than one key as a source, only events with zero or one source keys can be used to trigger actions.

type AxEventKeyValueSetUserDefineMark

type AxEventKeyValueSetUserDefineMark struct {
	Key       string
	Namespace *string
	Tag       *string
}

Mark a key in AXEventKeyValueSet with an user defined tag.

type CameraApplicationPlatformVmdCamera1ProfileANYEvent

type CameraApplicationPlatformVmdCamera1ProfileANYEvent struct {
	Active bool `eventKey:"active"`
}

type DayNightEvent

type DayNightEvent struct {
	VideoSourceConfigurationToken int  `eventKey:"VideoSourceConfigurationToken"`
	Day                           bool `eventKey:"day"`
}

type DeclarationCompleteCallback

type DeclarationCompleteCallback func(subscription int, userdata any)

This is the prototype of the callback function called when a declaration has registered with the event system. https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axevent/html/ax__event__handler_8h.html#a16d563cbc9c8974b72f296f8dfbdff3a

type DigitalInputEvent

type DigitalInputEvent struct {
	InputToken   int  `eventKey:"InputToken"`
	LogicalState bool `eventKey:"LogicalState"`
}

type Event

type Event struct {
	Kvs       *AXEventKeyValueSet
	Timestamp time.Time
}

type EventError

type EventError struct {
	Ptr      *C.GError
	Code     AXEventErrorCode
	Message  string
	Expected bool
}

func (*EventError) Error

func (e *EventError) Error() string

type GlobalSceneChangeEvent

type GlobalSceneChangeEvent struct {
	Source string `eventKey:"Source"`
	State  bool   `eventKey:"State"`
}

type HeaterStatusEvent

type HeaterStatusEvent struct {
	Heater  int  `eventKey:"heater"`
	Running bool `eventKey:"running"`
}

type KeyValueEntrie

type KeyValueEntrie struct {
	Key       string
	Namespace *string
	Value     interface{}
	ValueType AXEventValueType
}

KeyValueEntrie is a key-value pair for an AXEventKeyValueSet.

type LiveStreamAccessedEvent

type LiveStreamAccessedEvent struct {
	Accessed bool `eventKey:"accessed"`
}

type MotionAlarmEvent

type MotionAlarmEvent struct {
	Source string `eventKey:"Source"`
	State  bool   `eventKey:"State"`
}

type StorageAlertEvent

type StorageAlertEvent struct {
	Wear          int `eventKey:"wear"`
	OverallHealth int `eventKey:"overall_health"`

	Tampered bool `eventKey:"alert"`
	// contains filtered or unexported fields
}

type StorageDisruptionEvent

type StorageDisruptionEvent struct {
	DiskId     string `eventKey:"disk_id"`
	Disruption bool   `eventKey:"disruption"`
}

type StorageFailureEvent

type StorageFailureEvent struct {
	DiskId     string `eventKey:"disk_id"`
	Disruption bool   `eventKey:"disruption"`
}

type StorageRecordingEvent

type StorageRecordingEvent struct {
	Recording bool `eventKey:"recording"`
}

type Subcription

type Subcription uint

type SubscriptionCallback

type SubscriptionCallback func(subscription int, event *AXEvent, userdata any)

This is the prototype of the callback function called whenever an event matching a subscription is received. https://axiscommunications.github.io/acap-documentation/docs/acap-sdk-version-3/api/src/api/axevent/html/ax__event__handler_8h.html#ad1bb63bc12366aefb50139ea6a8b3904

type SupervisedPortEvent

type SupervisedPortEvent struct {
	Port     int  `eventKey:"port"`
	Tampered bool `eventKey:"tampered"`
}

type SystemReadyStatusEvent

type SystemReadyStatusEvent struct {
	Ready int `eventKey:"ready"`
}

type TamperingEvent

type TamperingEvent struct {
	Channel   int `eventKey:"channel"`
	Tampering int `eventKey:"tampering"`
}

type TriggerRelayEvent

type TriggerRelayEvent struct {
	RelayToken   int    `eventKey:"RelayToken"`
	LogicalState string `eventKey:"LogicalState"`
}

type VirtualInputEvent

type VirtualInputEvent struct {
	Port   int  `eventKey:"port"`
	Active bool `eventKey:"active"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL