spine

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 16 Imported by: 19

Documentation

Index

Constants

View Source
const DeviceInformationEntityId uint = 0
View Source
const NodeManagementFeatureId uint = 0

Variables

View Source
var Events events
View Source
var SpecificationVersion model.SpecificationVersionType = "1.3.0"

Functions

func CreateFunctionData

func CreateFunctionData[F any](featureType model.FeatureTypeType) []F

func EntityAddressType

func EntityAddressType(deviceAddress *model.AddressDeviceType, entityAddress []model.AddressEntityType) *model.EntityAddressType

func LocalFeatureDataCopyOfType

func LocalFeatureDataCopyOfType[T any](feature api.FeatureLocalInterface, function model.FunctionType) (T, error)

Note: the type has to be a pointer!

func NewAddressEntityType

func NewAddressEntityType(entityIds []uint) []model.AddressEntityType

func NewEntityAddressType

func NewEntityAddressType(deviceName string, entityIds []uint) *model.EntityAddressType

func NewNodeManagementBindingDeleteCallType

func NewNodeManagementBindingDeleteCallType(clientAddress *model.FeatureAddressType, serverAddress *model.FeatureAddressType) *model.NodeManagementBindingDeleteCallType

func NewNodeManagementBindingRequestCallType

func NewNodeManagementBindingRequestCallType(clientAddress *model.FeatureAddressType, serverAddress *model.FeatureAddressType, featureType model.FeatureTypeType) *model.NodeManagementBindingRequestCallType

func NewNodeManagementSubscriptionDeleteCallType

func NewNodeManagementSubscriptionDeleteCallType(clientAddress *model.FeatureAddressType, serverAddress *model.FeatureAddressType) *model.NodeManagementSubscriptionDeleteCallType

func NewNodeManagementSubscriptionRequestCallType

func NewNodeManagementSubscriptionRequestCallType(clientAddress *model.FeatureAddressType, serverAddress *model.FeatureAddressType, featureType model.FeatureTypeType) *model.NodeManagementSubscriptionRequestCallType

func NodeManagementAddress

func NodeManagementAddress(deviceAddress *model.AddressDeviceType) *model.FeatureAddressType

func RemoteFeatureDataCopyOfType

func RemoteFeatureDataCopyOfType[T any](remote api.FeatureRemoteInterface, function model.FunctionType) (T, error)

Note: the type has to be a pointer!

Types

type BindingManager

type BindingManager struct {
	// contains filtered or unexported fields
}

func NewBindingManager

func NewBindingManager(localDevice api.DeviceLocalInterface) *BindingManager

func (*BindingManager) AddBinding

is sent from the client (remote device) to the server (local device)

func (*BindingManager) Bindings

func (c *BindingManager) Bindings(remoteDevice api.DeviceRemoteInterface) []*api.BindingEntry

func (*BindingManager) BindingsOnFeature

func (c *BindingManager) BindingsOnFeature(featureAddress model.FeatureAddressType) []*api.BindingEntry

func (*BindingManager) HasLocalFeatureRemoteBinding

func (c *BindingManager) HasLocalFeatureRemoteBinding(localAddress, remoteAddress *model.FeatureAddressType) bool

checks if a remote address has a binding on the local feature

func (*BindingManager) RemoveBinding

func (*BindingManager) RemoveBindingsForDevice

func (c *BindingManager) RemoveBindingsForDevice(remoteDevice api.DeviceRemoteInterface)

Remove all existing bindings for a given remote device

func (*BindingManager) RemoveBindingsForEntity

func (c *BindingManager) RemoveBindingsForEntity(remoteEntity api.EntityRemoteInterface)

Remove all existing bindings for a given remote device entity

type Device

type Device struct {
	// contains filtered or unexported fields
}

func NewDevice

Initialize a new device Both values are required for a local device but provided as empty strings for a remote device as the address is only provided via detailed discovery response

func (*Device) Address

func (r *Device) Address() *model.AddressDeviceType

func (*Device) DestinationData

func (r *Device) DestinationData() model.NodeManagementDestinationDataType

func (*Device) DeviceType

func (r *Device) DeviceType() *model.DeviceTypeType

func (*Device) FeatureSet

func (r *Device) FeatureSet() *model.NetworkManagementFeatureSetType

type DeviceLocal

type DeviceLocal struct {
	*Device
	// contains filtered or unexported fields
}

func NewDeviceLocal

func NewDeviceLocal(
	brandName, deviceModel, serialNumber, deviceCode, deviceAddress string,
	deviceType model.DeviceTypeType,
	featureSet model.NetworkManagementFeatureSetType,
	heartbeatTimeout time.Duration) *DeviceLocal

BrandName is the brand DeviceModel is the model SerialNumber is the serial number DeviceCode is the SHIP id (accessMethods.id) DeviceAddress is the SPINE device address

func (*DeviceLocal) AddEntity

func (r *DeviceLocal) AddEntity(entity api.EntityLocalInterface)

func (*DeviceLocal) AddRemoteDeviceForSki

func (r *DeviceLocal) AddRemoteDeviceForSki(ski string, rDevice api.DeviceRemoteInterface)

Helper method used by tests and AddRemoteDevice

func (*DeviceLocal) BindingManager

func (r *DeviceLocal) BindingManager() api.BindingManagerInterface

func (*DeviceLocal) Entities

func (r *DeviceLocal) Entities() []api.EntityLocalInterface

func (*DeviceLocal) Entity

func (*DeviceLocal) EntityForType

func (r *DeviceLocal) EntityForType(entityType model.EntityTypeType) api.EntityLocalInterface

func (*DeviceLocal) FeatureByAddress

func (r *DeviceLocal) FeatureByAddress(address *model.FeatureAddressType) api.FeatureLocalInterface

func (*DeviceLocal) HandleEvent

func (r *DeviceLocal) HandleEvent(payload api.EventPayload)

React to some specific events

func (*DeviceLocal) HeartbeatManager

func (r *DeviceLocal) HeartbeatManager() api.HeartbeatManagerInterface

func (*DeviceLocal) NodeManagement

func (r *DeviceLocal) NodeManagement() api.NodeManagementInterface

func (*DeviceLocal) NotifySubscribers

func (r *DeviceLocal) NotifySubscribers(featureAddress *model.FeatureAddressType, cmd model.CmdType)

func (*DeviceLocal) ProcessCmd

func (r *DeviceLocal) ProcessCmd(datagram model.DatagramType, remoteDevice api.DeviceRemoteInterface) error

func (*DeviceLocal) RemoteDeviceForAddress

func (r *DeviceLocal) RemoteDeviceForAddress(address model.AddressDeviceType) api.DeviceRemoteInterface

func (*DeviceLocal) RemoteDeviceForSki

func (r *DeviceLocal) RemoteDeviceForSki(ski string) api.DeviceRemoteInterface

func (*DeviceLocal) RemoteDevices

func (r *DeviceLocal) RemoteDevices() []api.DeviceRemoteInterface

func (*DeviceLocal) RemoveEntity

func (r *DeviceLocal) RemoveEntity(entity api.EntityLocalInterface)

func (*DeviceLocal) RemoveRemoteDevice

func (r *DeviceLocal) RemoveRemoteDevice(ski string)

func (*DeviceLocal) RemoveRemoteDeviceConnection

func (r *DeviceLocal) RemoveRemoteDeviceConnection(ski string)

func (*DeviceLocal) RequestRemoteDetailedDiscoveryData

func (r *DeviceLocal) RequestRemoteDetailedDiscoveryData(rDevice api.DeviceRemoteInterface) (*model.MsgCounterType, *model.ErrorType)

func (*DeviceLocal) SetupRemoteDevice

Setup a new remote device with a given SKI and triggers SPINE requesting device details

func (*DeviceLocal) SubscriptionManager

func (r *DeviceLocal) SubscriptionManager() api.SubscriptionManagerInterface

type DeviceRemote

type DeviceRemote struct {
	*Device
	// contains filtered or unexported fields
}

func NewDeviceRemote

func NewDeviceRemote(localDevice api.DeviceLocalInterface, ski string, sender api.SenderInterface) *DeviceRemote

func (*DeviceRemote) AddEntity

func (d *DeviceRemote) AddEntity(entity api.EntityRemoteInterface)

func (*DeviceRemote) AddEntityAndFeatures

func (d *DeviceRemote) AddEntityAndFeatures(initialData bool, data *model.NodeManagementDetailedDiscoveryDataType) ([]api.EntityRemoteInterface, error)

func (*DeviceRemote) CheckEntityInformation

func (d *DeviceRemote) CheckEntityInformation(initialData bool, entity model.NodeManagementDetailedDiscoveryEntityInformationType) error

check if the provided entity information is correct provide initialData to check if the entity is new and not an update

func (*DeviceRemote) Entities

func (d *DeviceRemote) Entities() []api.EntityRemoteInterface

Return all entities of this device

func (*DeviceRemote) Entity

Return an entity with a given address

func (*DeviceRemote) FeatureByAddress

func (d *DeviceRemote) FeatureByAddress(address *model.FeatureAddressType) api.FeatureRemoteInterface

Return the feature for a given address

func (*DeviceRemote) FeatureByEntityTypeAndRole

func (r *DeviceRemote) FeatureByEntityTypeAndRole(entity api.EntityRemoteInterface, featureType model.FeatureTypeType, role model.RoleType) api.FeatureRemoteInterface

Get the feature for a given entity, feature type and feature role

func (*DeviceRemote) HandleShipPayloadMessage

func (d *DeviceRemote) HandleShipPayloadMessage(message []byte)

processing incoming SPINE message from the associated SHIP connection

func (*DeviceRemote) HandleSpineMesssage

func (d *DeviceRemote) HandleSpineMesssage(message []byte) (*model.MsgCounterType, error)

func (*DeviceRemote) RemoveEntityByAddress

func (d *DeviceRemote) RemoveEntityByAddress(addr []model.AddressEntityType) api.EntityRemoteInterface

Remove an entity with a given address from this device

func (*DeviceRemote) Sender

func (d *DeviceRemote) Sender() api.SenderInterface

func (*DeviceRemote) Ski

func (d *DeviceRemote) Ski() string

return the device SKI

func (*DeviceRemote) UpdateDevice

func (d *DeviceRemote) UpdateDevice(description *model.NetworkManagementDeviceDescriptionDataType)

func (*DeviceRemote) UseCases

func (*DeviceRemote) VerifyUseCaseScenariosAndFeaturesSupport

func (d *DeviceRemote) VerifyUseCaseScenariosAndFeaturesSupport(
	usecaseActor model.UseCaseActorType,
	usecaseName model.UseCaseNameType,
	scenarios []model.UseCaseScenarioSupportType,
	serverFeatures []model.FeatureTypeType,
) bool

Checks if the given actor, usecasename and provided server features are available Note: the server features are expected to be in a single entity and entity 0 is not checked!

type Entity

type Entity struct {
	// contains filtered or unexported fields
}

func NewEntity

func NewEntity(eType model.EntityTypeType, deviceAddress *model.AddressDeviceType, entityAddress []model.AddressEntityType) *Entity

func (*Entity) Address

func (r *Entity) Address() *model.EntityAddressType

func (*Entity) Description

func (r *Entity) Description() *model.DescriptionType

func (*Entity) EntityType

func (r *Entity) EntityType() model.EntityTypeType

func (*Entity) NextFeatureId

func (r *Entity) NextFeatureId() uint

func (*Entity) SetDescription

func (r *Entity) SetDescription(d *model.DescriptionType)

type EntityLocal

type EntityLocal struct {
	*Entity
	// contains filtered or unexported fields
}

func NewEntityLocal

func NewEntityLocal(device api.DeviceLocalInterface, eType model.EntityTypeType, entityAddress []model.AddressEntityType) *EntityLocal

func (*EntityLocal) AddFeature

func (r *EntityLocal) AddFeature(f api.FeatureLocalInterface)

Add a feature to the entity if it is not already added

func (*EntityLocal) AddUseCaseSupport

func (r *EntityLocal) AddUseCaseSupport(
	actor model.UseCaseActorType,
	useCaseName model.UseCaseNameType,
	useCaseVersion model.SpecificationVersionType,
	useCaseDocumemtSubRevision string,
	useCaseAvailable bool,
	scenarios []model.UseCaseScenarioSupportType,
)

add a new usecase

func (*EntityLocal) Device

func (r *EntityLocal) Device() api.DeviceLocalInterface

func (*EntityLocal) FeatureOfAddress

func (r *EntityLocal) FeatureOfAddress(addressFeature *model.AddressFeatureType) api.FeatureLocalInterface

func (*EntityLocal) FeatureOfTypeAndRole

func (r *EntityLocal) FeatureOfTypeAndRole(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocalInterface

func (*EntityLocal) Features

func (r *EntityLocal) Features() []api.FeatureLocalInterface

func (*EntityLocal) GetOrAddFeature

func (r *EntityLocal) GetOrAddFeature(featureType model.FeatureTypeType, role model.RoleType) api.FeatureLocalInterface

either returns an existing feature or creates a new one for a given entity, featuretype and role

func (*EntityLocal) HasUseCaseSupport

func (r *EntityLocal) HasUseCaseSupport(actor model.UseCaseActorType, useCaseName model.UseCaseNameType) bool

Check if a use case is already added

func (*EntityLocal) RemoveAllBindings

func (r *EntityLocal) RemoveAllBindings()

Remove all bindings

func (*EntityLocal) RemoveAllSubscriptions

func (r *EntityLocal) RemoveAllSubscriptions()

Remove all subscriptions

func (*EntityLocal) RemoveAllUseCaseSupports

func (r *EntityLocal) RemoveAllUseCaseSupports()

Remove all usecases

func (*EntityLocal) RemoveUseCaseSupport

func (r *EntityLocal) RemoveUseCaseSupport(
	actor model.UseCaseActorType,
	useCaseName model.UseCaseNameType,
)

Remove a usecase with a given actor ans usecase name

func (*EntityLocal) SetUseCaseAvailability

func (r *EntityLocal) SetUseCaseAvailability(
	actor model.UseCaseActorType,
	useCaseName model.UseCaseNameType,
	available bool)

Set the availability of a usecase. This may only be used for usescases that act as a client within the usecase!

type EntityRemote

type EntityRemote struct {
	*Entity
	// contains filtered or unexported fields
}

func NewEntityRemote

func NewEntityRemote(device api.DeviceRemoteInterface, eType model.EntityTypeType, entityAddress []model.AddressEntityType) *EntityRemote

func (*EntityRemote) AddFeature

func (r *EntityRemote) AddFeature(f api.FeatureRemoteInterface)

func (*EntityRemote) Device

func (*EntityRemote) FeatureOfAddress

func (r *EntityRemote) FeatureOfAddress(addressFeature *model.AddressFeatureType) api.FeatureRemoteInterface

func (*EntityRemote) FeatureOfTypeAndRole

func (r *EntityRemote) FeatureOfTypeAndRole(featureType model.FeatureTypeType, role model.RoleType) api.FeatureRemoteInterface

func (*EntityRemote) Features

func (r *EntityRemote) Features() []api.FeatureRemoteInterface

func (*EntityRemote) RemoveAllFeatures

func (r *EntityRemote) RemoveAllFeatures()

func (*EntityRemote) UpdateDeviceAddress

func (r *EntityRemote) UpdateDeviceAddress(address model.AddressDeviceType)

type Feature

type Feature struct {
	// contains filtered or unexported fields
}

func NewFeature

func NewFeature(address *model.FeatureAddressType, ftype model.FeatureTypeType, role model.RoleType) *Feature

func (*Feature) Address

func (r *Feature) Address() *model.FeatureAddressType

func (*Feature) Description

func (r *Feature) Description() *model.DescriptionType

func (*Feature) Operations

func (r *Feature) Operations() map[model.FunctionType]api.OperationsInterface

func (*Feature) Role

func (r *Feature) Role() model.RoleType

func (*Feature) SetDescription

func (r *Feature) SetDescription(d *model.DescriptionType)

func (*Feature) SetDescriptionString

func (r *Feature) SetDescriptionString(s string)

func (*Feature) String

func (r *Feature) String() string

func (*Feature) Type

func (r *Feature) Type() model.FeatureTypeType

type FeatureLocal

type FeatureLocal struct {
	*Feature
	// contains filtered or unexported fields
}

func NewFeatureLocal

func NewFeatureLocal(id uint, entity api.EntityLocalInterface, ftype model.FeatureTypeType, role model.RoleType) *FeatureLocal

func (*FeatureLocal) AddFunctionType

func (r *FeatureLocal) AddFunctionType(function model.FunctionType, read, write bool)

Add supported function to the feature if its role is Server or Special

func (*FeatureLocal) AddResponseCallback

func (r *FeatureLocal) AddResponseCallback(msgCounterReference model.MsgCounterType, function func(msg api.ResponseMessage)) error

Add a callback function to be invoked when SPINE message comes in with a given msgCounterReference value

Returns an error if there is already a callback for the msgCounter set

func (*FeatureLocal) AddResultCallback

func (r *FeatureLocal) AddResultCallback(function func(msg api.ResponseMessage))

Add a callback function to be invoked when a result message comes in for this feature

func (*FeatureLocal) AddWriteApprovalCallback

func (r *FeatureLocal) AddWriteApprovalCallback(function api.WriteApprovalCallbackFunc) error

func (*FeatureLocal) ApproveOrDenyWrite

func (r *FeatureLocal) ApproveOrDenyWrite(msg *api.Message, err model.ErrorType)

func (*FeatureLocal) BindToRemote

func (r *FeatureLocal) BindToRemote(remoteAddress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)

BindToRemote to a remote feature

func (*FeatureLocal) DataCopy

func (r *FeatureLocal) DataCopy(function model.FunctionType) any

func (*FeatureLocal) Device

func (*FeatureLocal) Entity

func (*FeatureLocal) Functions

func (r *FeatureLocal) Functions() []model.FunctionType

func (*FeatureLocal) HandleMessage

func (r *FeatureLocal) HandleMessage(message *api.Message) *model.ErrorType

func (*FeatureLocal) HasBindingToRemote

func (r *FeatureLocal) HasBindingToRemote(remoteAddress *model.FeatureAddressType) bool

check if there already is a binding to a remote feature

func (*FeatureLocal) HasSubscriptionToRemote

func (r *FeatureLocal) HasSubscriptionToRemote(remoteAddress *model.FeatureAddressType) bool

check if there already is a subscription to a remote feature

func (*FeatureLocal) RemoveAllRemoteBindings

func (r *FeatureLocal) RemoveAllRemoteBindings()

Remove all subscriptions to remote features

func (*FeatureLocal) RemoveAllRemoteSubscriptions

func (r *FeatureLocal) RemoveAllRemoteSubscriptions()

Remove all subscriptions to remote features

func (*FeatureLocal) RemoveRemoteBinding

func (r *FeatureLocal) RemoveRemoteBinding(remoteAddress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)

Remove a binding to a remote feature

func (*FeatureLocal) RemoveRemoteSubscription

func (r *FeatureLocal) RemoveRemoteSubscription(remoteAddress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)

Remove a subscriptions to a remote feature

func (*FeatureLocal) RequestRemoteData

func (r *FeatureLocal) RequestRemoteData(
	function model.FunctionType,
	selector any,
	elements any,
	destination api.FeatureRemoteInterface) (*model.MsgCounterType, *model.ErrorType)

func (*FeatureLocal) RequestRemoteDataBySenderAddress

func (r *FeatureLocal) RequestRemoteDataBySenderAddress(
	cmd model.CmdType,
	sender api.SenderInterface,
	deviceSki string,
	destinationAddress *model.FeatureAddressType,
	maxDelay time.Duration) (*model.MsgCounterType, *model.ErrorType)

func (*FeatureLocal) SetData

func (r *FeatureLocal) SetData(function model.FunctionType, data any)

func (*FeatureLocal) SetWriteApprovalTimeout

func (r *FeatureLocal) SetWriteApprovalTimeout(duration time.Duration)

func (*FeatureLocal) SubscribeToRemote

func (r *FeatureLocal) SubscribeToRemote(remoteAddress *model.FeatureAddressType) (*model.MsgCounterType, *model.ErrorType)

SubscribeToRemote to a remote feature

type FeatureRemote

type FeatureRemote struct {
	*Feature
	// contains filtered or unexported fields
}

func NewFeatureRemote

func NewFeatureRemote(id uint, entity api.EntityRemoteInterface, ftype model.FeatureTypeType, role model.RoleType) *FeatureRemote

func (*FeatureRemote) DataCopy

func (r *FeatureRemote) DataCopy(function model.FunctionType) any

func (*FeatureRemote) Device

func (*FeatureRemote) Entity

func (*FeatureRemote) MaxResponseDelayDuration

func (r *FeatureRemote) MaxResponseDelayDuration() time.Duration

func (*FeatureRemote) SetMaxResponseDelay

func (r *FeatureRemote) SetMaxResponseDelay(delay *model.MaxResponseDelayType)

func (*FeatureRemote) SetOperations

func (r *FeatureRemote) SetOperations(functions []model.FunctionPropertyType)

func (*FeatureRemote) UpdateData

func (r *FeatureRemote) UpdateData(function model.FunctionType, data any, filterPartial *model.FilterType, filterDelete *model.FilterType) *model.ErrorType

type FunctionData

type FunctionData[T any] struct {
	// contains filtered or unexported fields
}

func NewFunctionData

func NewFunctionData[T any](function model.FunctionType) *FunctionData[T]

func (*FunctionData[T]) DataCopy

func (r *FunctionData[T]) DataCopy() *T

func (*FunctionData[T]) DataCopyAny

func (r *FunctionData[T]) DataCopyAny() any

func (*FunctionData[T]) FunctionType

func (r *FunctionData[T]) FunctionType() model.FunctionType

func (*FunctionData[T]) UpdateData

func (r *FunctionData[T]) UpdateData(remoteWrite bool, newData *T, filterPartial *model.FilterType, filterDelete *model.FilterType) *model.ErrorType

func (*FunctionData[T]) UpdateDataAny

func (r *FunctionData[T]) UpdateDataAny(remoteWrite bool, newData any, filterPartial *model.FilterType, filterDelete *model.FilterType) *model.ErrorType

type FunctionDataCmd

type FunctionDataCmd[T any] struct {
	*FunctionData[T]
}

func NewFunctionDataCmd

func NewFunctionDataCmd[T any](function model.FunctionType) *FunctionDataCmd[T]

func (*FunctionDataCmd[T]) NotifyOrWriteCmdType

func (r *FunctionDataCmd[T]) NotifyOrWriteCmdType(deleteSelector, partialSelector any, partialWithoutSelector bool, deleteElements any) model.CmdType

func (*FunctionDataCmd[T]) ReadCmdType

func (r *FunctionDataCmd[T]) ReadCmdType(partialSelector any, elements any) model.CmdType

func (*FunctionDataCmd[T]) ReplyCmdType

func (r *FunctionDataCmd[T]) ReplyCmdType(partial bool) model.CmdType

type HeartbeatManager

type HeartbeatManager struct {
	// contains filtered or unexported fields
}

func NewHeartbeatManager

func NewHeartbeatManager(localDevice api.DeviceLocalInterface, subscriptionManager api.SubscriptionManagerInterface, timeout time.Duration) *HeartbeatManager

Create a new Heartbeat Manager which handles sending of heartbeats

func (*HeartbeatManager) IsHeartbeatRunning

func (c *HeartbeatManager) IsHeartbeatRunning() bool

func (*HeartbeatManager) SetLocalFeature

func (c *HeartbeatManager) SetLocalFeature(entity api.EntityLocalInterface, feature api.FeatureLocalInterface)

func (*HeartbeatManager) StartHeartbeat

func (c *HeartbeatManager) StartHeartbeat() error

Start setting heartbeat data Make sure the a required FeatureTypeTypeDeviceDiagnosis with the role server is present otherwise this will end with an error Note: Remote features need to have a subscription to get notifications

func (*HeartbeatManager) StopHeartbeat

func (c *HeartbeatManager) StopHeartbeat()

Stop updating heartbeat data Note: No active subscribers will get any further notifications!

type NodeManagement

type NodeManagement struct {
	*FeatureLocal
	// contains filtered or unexported fields
}

func NewNodeManagement

func NewNodeManagement(id uint, entity api.EntityLocalInterface) *NodeManagement

func (*NodeManagement) Device

func (*NodeManagement) HandleMessage

func (r *NodeManagement) HandleMessage(message *api.Message) *model.ErrorType

func (*NodeManagement) RequestDestinationListData

func (r *NodeManagement) RequestDestinationListData(remoteDeviceAddress *model.AddressDeviceType, sender api.SenderInterface) (*model.MsgCounterType, *model.ErrorType)

func (*NodeManagement) RequestDetailedDiscovery

func (r *NodeManagement) RequestDetailedDiscovery(remoteDeviceSki string, remoteDeviceAddress *model.AddressDeviceType, sender api.SenderInterface) (*model.MsgCounterType, *model.ErrorType)

request detailed discovery data from a remote device

func (*NodeManagement) RequestUseCaseData

func (r *NodeManagement) RequestUseCaseData(remoteDeviceSki string, remoteDeviceAddress *model.AddressDeviceType, sender api.SenderInterface) (*model.MsgCounterType, *model.ErrorType)

type Operations

type Operations struct {
	// contains filtered or unexported fields
}

func NewOperations

func NewOperations(read, write bool) *Operations

func (*Operations) Information

func (r *Operations) Information() *model.PossibleOperationsType

func (*Operations) Read

func (r *Operations) Read() bool

func (*Operations) String

func (r *Operations) String() string

func (*Operations) Write

func (r *Operations) Write() bool

type Sender

type Sender struct {
	// contains filtered or unexported fields
}

func (*Sender) Bind

func (c *Sender) Bind(senderAddress, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error)

Send a binding request to a remote server feature

func (*Sender) DatagramForMsgCounter

func (c *Sender) DatagramForMsgCounter(msgCounter model.MsgCounterType) (model.DatagramType, error)

return the datagram for a given msgCounter (only availbe for Notify messasges!), error if not found

func (*Sender) Notify

func (c *Sender) Notify(senderAddress, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error)

Notify sends notification to destination

func (*Sender) Reply

func (c *Sender) Reply(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, cmd model.CmdType) error

Reply sends reply to original sender

func (*Sender) Request

func (c *Sender) Request(cmdClassifier model.CmdClassifierType, senderAddress, destinationAddress *model.FeatureAddressType, ackRequest bool, cmd []model.CmdType) (*model.MsgCounterType, error)

Sends request

func (*Sender) ResultError

func (c *Sender) ResultError(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType) error

func (*Sender) ResultSuccess

func (c *Sender) ResultSuccess(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType) error

func (*Sender) Subscribe

func (c *Sender) Subscribe(senderAddress, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error)

Send a subscription request to a remote server feature

func (*Sender) Unbind

func (c *Sender) Unbind(senderAddress, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error)

Send a binding request to a remote server feature

func (*Sender) Unsubscribe

func (c *Sender) Unsubscribe(senderAddress, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error)

Send a subscription deletion request to a remote server feature

func (*Sender) Write

func (c *Sender) Write(senderAddress, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error)

Write sends notification to destination

type SubscriptionManager

type SubscriptionManager struct {
	// contains filtered or unexported fields
}

func NewSubscriptionManager

func NewSubscriptionManager(localDevice api.DeviceLocalInterface) *SubscriptionManager

func (*SubscriptionManager) AddSubscription

is sent from the client (remote device) to the server (local device)

func (*SubscriptionManager) RemoveSubscription

Remove a specific subscription that is provided by a delete message from a remote device

func (*SubscriptionManager) RemoveSubscriptionsForDevice

func (c *SubscriptionManager) RemoveSubscriptionsForDevice(remoteDevice api.DeviceRemoteInterface)

Remove all existing subscriptions for a given remote device

func (*SubscriptionManager) RemoveSubscriptionsForEntity

func (c *SubscriptionManager) RemoveSubscriptionsForEntity(remoteEntity api.EntityRemoteInterface)

Remove all existing subscriptions for a given remote device entity

func (*SubscriptionManager) Subscriptions

func (c *SubscriptionManager) Subscriptions(remoteDevice api.DeviceRemoteInterface) []*api.SubscriptionEntry

func (*SubscriptionManager) SubscriptionsOnFeature

func (c *SubscriptionManager) SubscriptionsOnFeature(featureAddress model.FeatureAddressType) []*api.SubscriptionEntry

Jump to

Keyboard shortcuts

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