knxnetip

package
v0.0.0-...-2d02f19 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteArrayToKnxAddress

func ByteArrayToKnxAddress(ctxForModel context.Context, data []byte) driverModel.KnxAddress

func ByteArrayToString

func ByteArrayToString(data []byte, separator string) string

func CustomMessageHandling

func CustomMessageHandling(localLog zerolog.Logger) _default.CustomMessageHandler

func GroupAddressToString

func GroupAddressToString(groupAddress driverModel.KnxGroupAddress) (string, error)

func KnxAddressToByteArray

func KnxAddressToByteArray(knxAddress driverModel.KnxAddress) []byte

func KnxAddressToString

func KnxAddressToString(knxAddress driverModel.KnxAddress) string

func NumericGroupAddressToString

func NumericGroupAddressToString(numericAddress uint16, groupAddress GroupAddressTag) (string, error)

func Uint16ToKnxAddress

func Uint16ToKnxAddress(data uint16) driverModel.KnxAddress

func Uint16ToKnxGroupAddress

func Uint16ToKnxGroupAddress(ctxForModel context.Context, data uint16, numLevels uint8) driverModel.KnxGroupAddress

Types

type Browser

type Browser struct {
	_default.DefaultBrowser
	// contains filtered or unexported fields
}

func NewBrowser

func NewBrowser(connection *Connection, messageCodec spi.MessageCodec, _options ...options.WithOption) *Browser

func (Browser) BrowseQuery

func (m Browser) BrowseQuery(ctx context.Context, interceptor func(result apiModel.PlcBrowseItem) bool, _ string, query apiModel.PlcQuery) (apiModel.PlcResponseCode, []apiModel.PlcBrowseItem)

type CommunicationObjectQuery

type CommunicationObjectQuery struct {
	apiModel.PlcQuery

	MainGroup   uint8 // 5 Bits: Values 0-31
	MiddleGroup uint8 // 3 Bits: values 0-7
	SubGroup    uint8 // 8 Bits
	DeviceTag
}

func NewCommunicationObjectQuery

func NewCommunicationObjectQuery(mainGroup uint8, middleGroup uint8, subGroup uint8) CommunicationObjectQuery

func (CommunicationObjectQuery) GetAddressString

func (k CommunicationObjectQuery) GetAddressString() string

func (CommunicationObjectQuery) GetArrayInfo

func (k CommunicationObjectQuery) GetArrayInfo() []apiModel.ArrayInfo

func (CommunicationObjectQuery) GetQueryString

func (k CommunicationObjectQuery) GetQueryString() string

func (CommunicationObjectQuery) GetValueType

func (k CommunicationObjectQuery) GetValueType() values.PlcValueType

type Connection

type Connection struct {
	GatewayKnxAddress             driverModel.KnxAddress
	ClientKnxAddress              driverModel.KnxAddress
	CommunicationChannelId        uint8
	SequenceCounter               int32
	TunnelingRequestExpectationId int32
	DeviceConnections             map[driverModel.KnxAddress]*KnxDeviceConnection

	sync.Mutex
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(transportInstance transports.TransportInstance, connectionOptions map[string][]string, tagHandler spi.PlcTagHandler, _options ...options.WithOption) *Connection

func (*Connection) BlockingClose

func (m *Connection) BlockingClose()

func (*Connection) BrowseRequestBuilder

func (m *Connection) BrowseRequestBuilder() apiModel.PlcBrowseRequestBuilder

func (*Connection) Close

func (m *Connection) Close() <-chan plc4go.PlcConnectionCloseResult

func (*Connection) Connect

func (m *Connection) Connect() <-chan plc4go.PlcConnectionConnectResult

func (*Connection) ConnectWithContext

func (m *Connection) ConnectWithContext(ctx context.Context) <-chan plc4go.PlcConnectionConnectResult

func (*Connection) DeviceAuthenticate

func (m *Connection) DeviceAuthenticate(ctx context.Context, targetAddress driverModel.KnxAddress, buildingKey []byte) <-chan KnxDeviceAuthenticateResult

func (*Connection) DeviceConnect

func (m *Connection) DeviceConnect(ctx context.Context, targetAddress driverModel.KnxAddress) <-chan KnxDeviceConnectResult

func (*Connection) DeviceDisconnect

func (m *Connection) DeviceDisconnect(ctx context.Context, targetAddress driverModel.KnxAddress) <-chan KnxDeviceDisconnectResult

func (*Connection) DeviceReadMemory

func (m *Connection) DeviceReadMemory(ctx context.Context, targetAddress driverModel.KnxAddress, address uint16, numElements uint8, datapointType *driverModel.KnxDatapointType) <-chan KnxReadResult

func (*Connection) DeviceReadProperty

func (m *Connection) DeviceReadProperty(ctx context.Context, targetAddress driverModel.KnxAddress, objectId uint8, propertyId uint8, propertyIndex uint16, numElements uint8) <-chan KnxReadResult

func (*Connection) DeviceReadPropertyDescriptor

func (m *Connection) DeviceReadPropertyDescriptor(ctx context.Context, targetAddress driverModel.KnxAddress, objectId uint8, propertyId uint8) <-chan KnxReadResult

func (*Connection) GetConnectionId

func (m *Connection) GetConnectionId() string

func (*Connection) GetMetadata

func (m *Connection) GetMetadata() apiModel.PlcConnectionMetadata

func (*Connection) GetPlcTagHandler

func (m *Connection) GetPlcTagHandler() spi.PlcTagHandler

func (*Connection) GetPlcValueHandler

func (m *Connection) GetPlcValueHandler() spi.PlcValueHandler

func (*Connection) GetTracer

func (m *Connection) GetTracer() tracer.Tracer

func (*Connection) GetTransportInstance

func (m *Connection) GetTransportInstance() transports.TransportInstance

func (*Connection) IsConnected

func (m *Connection) IsConnected() bool

func (*Connection) IsTraceEnabled

func (m *Connection) IsTraceEnabled() bool

func (*Connection) Ping

func (m *Connection) Ping() <-chan plc4go.PlcConnectionPingResult

func (*Connection) ReadGroupAddress

func (m *Connection) ReadGroupAddress(ctx context.Context, groupAddress []byte, datapointType *driverModel.KnxDatapointType) <-chan KnxReadResult

func (*Connection) ReadRequestBuilder

func (m *Connection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder

func (*Connection) String

func (m *Connection) String() string

func (*Connection) SubscriptionRequestBuilder

func (m *Connection) SubscriptionRequestBuilder() apiModel.PlcSubscriptionRequestBuilder

func (*Connection) UnsubscriptionRequestBuilder

func (m *Connection) UnsubscriptionRequestBuilder() apiModel.PlcUnsubscriptionRequestBuilder

func (*Connection) WriteRequestBuilder

func (m *Connection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder

type ConnectionMetadata

type ConnectionMetadata struct {
	KnxMedium         driverModel.KnxMedium `stringer:"true"`
	GatewayName       string
	GatewayKnxAddress string
	ClientKnxAddress  string

	ProjectNumber          uint8
	InstallationNumber     uint8
	DeviceSerialNumber     []byte
	DeviceMulticastAddress []byte
	DeviceMacAddress       []byte
	SupportedServices      []string
}

func (*ConnectionMetadata) CanBrowse

func (m *ConnectionMetadata) CanBrowse() bool

func (*ConnectionMetadata) CanRead

func (m *ConnectionMetadata) CanRead() bool

func (*ConnectionMetadata) CanSubscribe

func (m *ConnectionMetadata) CanSubscribe() bool

func (*ConnectionMetadata) CanWrite

func (m *ConnectionMetadata) CanWrite() bool

func (*ConnectionMetadata) GetConnectionAttributes

func (m *ConnectionMetadata) GetConnectionAttributes() map[string]string

func (*ConnectionMetadata) Serialize

func (d *ConnectionMetadata) Serialize() ([]byte, error)

func (*ConnectionMetadata) SerializeWithWriteBuffer

func (d *ConnectionMetadata) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error

func (*ConnectionMetadata) String

func (d *ConnectionMetadata) String() string

type DeviceMemoryAddressPlcTag

type DeviceMemoryAddressPlcTag struct {
	MainGroup   uint8 // 5 Bits: Values 0-31
	MiddleGroup uint8 // 3 Bits: values 0-7
	SubGroup    uint8 // 8 Bits
	Address     uint16
	NumElements uint8
	TagType     *driverModel.KnxDatapointType
	DeviceTag
}

func NewDeviceMemoryAddressPlcTag

func NewDeviceMemoryAddressPlcTag(mainGroup uint8, middleGroup uint8, subGroup uint8, address uint16, numElements uint8, tagType *driverModel.KnxDatapointType) DeviceMemoryAddressPlcTag

func (DeviceMemoryAddressPlcTag) GetAddressString

func (k DeviceMemoryAddressPlcTag) GetAddressString() string

func (DeviceMemoryAddressPlcTag) GetArrayInfo

func (k DeviceMemoryAddressPlcTag) GetArrayInfo() []apiModel.ArrayInfo

func (DeviceMemoryAddressPlcTag) GetValueType

type DevicePropertyAddressPlcTag

type DevicePropertyAddressPlcTag struct {
	MainGroup     uint8 // 5 Bits: Values 0-31
	MiddleGroup   uint8 // 3 Bits: values 0-7
	SubGroup      uint8 // 8 Bits
	ObjectId      uint8
	PropertyId    uint8
	PropertyIndex uint16
	NumElements   uint8
	DeviceTag
}

func NewDevicePropertyAddressPlcTag

func NewDevicePropertyAddressPlcTag(mainGroup uint8, middleGroup uint8, subGroup uint8, objectId uint8, propertyId uint8, propertyIndex uint16, numElements uint8) DevicePropertyAddressPlcTag

func (DevicePropertyAddressPlcTag) GetAddressString

func (k DevicePropertyAddressPlcTag) GetAddressString() string

func (DevicePropertyAddressPlcTag) GetArrayInfo

func (k DevicePropertyAddressPlcTag) GetArrayInfo() []apiModel.ArrayInfo

func (DevicePropertyAddressPlcTag) GetValueType

type DeviceQuery

type DeviceQuery struct {
	apiModel.PlcQuery

	MainGroup   string // 5 Bits: Values 0-31
	MiddleGroup string // 3 Bits: values 0-7
	SubGroup    string // 8 Bits
}

func NewDeviceQuery

func NewDeviceQuery(mainGroup string, middleGroup string, subGroup string) DeviceQuery

func (DeviceQuery) GetAddressString

func (k DeviceQuery) GetAddressString() string

func (DeviceQuery) GetArrayInfo

func (k DeviceQuery) GetArrayInfo() []apiModel.ArrayInfo

func (DeviceQuery) GetQueryString

func (k DeviceQuery) GetQueryString() string

func (DeviceQuery) GetValueType

func (k DeviceQuery) GetValueType() values.PlcValueType

func (DeviceQuery) String

func (k DeviceQuery) String() string

type DeviceTag

type DeviceTag interface {
	Tag
	// contains filtered or unexported methods
}

type Discoverer

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

func NewDiscoverer

func NewDiscoverer(_options ...options.WithOption) *Discoverer

func (*Discoverer) Discover

func (d *Discoverer) Discover(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error

type Driver

type Driver struct {
	_default.DefaultDriver
	// contains filtered or unexported fields
}

func NewDriver

func NewDriver(_options ...options.WithOption) *Driver

func (*Driver) CheckQuery

func (d *Driver) CheckQuery(query string) error

func (*Driver) DiscoverWithContext

func (d *Driver) DiscoverWithContext(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error

func (*Driver) GetConnectionWithContext

func (d *Driver) GetConnectionWithContext(ctx context.Context, transportUrl url.URL, transports map[string]transports.Transport, driverOptions map[string][]string) <-chan plc4go.PlcConnectionConnectResult

func (*Driver) SupportsDiscovery

func (d *Driver) SupportsDiscovery() bool

type GroupAddress1LevelPlcTag

type GroupAddress1LevelPlcTag struct {
	GroupAddressTag

	MainGroup string // 16 Bits
	TagType   *driverModel.KnxDatapointType
}

func NewGroupAddress1LevelPlcTag

func NewGroupAddress1LevelPlcTag(mainGroup string, tagType *driverModel.KnxDatapointType) GroupAddress1LevelPlcTag

func (GroupAddress1LevelPlcTag) GetAddressString

func (k GroupAddress1LevelPlcTag) GetAddressString() string

func (GroupAddress1LevelPlcTag) GetArrayInfo

func (k GroupAddress1LevelPlcTag) GetArrayInfo() []apiModel.ArrayInfo

func (GroupAddress1LevelPlcTag) GetTagType

func (GroupAddress1LevelPlcTag) GetValueType

func (k GroupAddress1LevelPlcTag) GetValueType() values.PlcValueType

func (GroupAddress1LevelPlcTag) IsPatternTag

func (k GroupAddress1LevelPlcTag) IsPatternTag() bool

type GroupAddress2LevelPlcTag

type GroupAddress2LevelPlcTag struct {
	GroupAddressTag

	MainGroup string // 5 Bits: Values 0-31
	SubGroup  string // 11 Bits
	TagType   *driverModel.KnxDatapointType
}

func NewGroupAddress2LevelPlcTag

func NewGroupAddress2LevelPlcTag(mainGroup string, subGroup string, tagType *driverModel.KnxDatapointType) GroupAddress2LevelPlcTag

func (GroupAddress2LevelPlcTag) GetAddressString

func (k GroupAddress2LevelPlcTag) GetAddressString() string

func (GroupAddress2LevelPlcTag) GetArrayInfo

func (k GroupAddress2LevelPlcTag) GetArrayInfo() []apiModel.ArrayInfo

func (GroupAddress2LevelPlcTag) GetTagType

func (GroupAddress2LevelPlcTag) GetValueType

func (k GroupAddress2LevelPlcTag) GetValueType() values.PlcValueType

func (GroupAddress2LevelPlcTag) IsPatternTag

func (k GroupAddress2LevelPlcTag) IsPatternTag() bool

type GroupAddress3LevelPlcTag

type GroupAddress3LevelPlcTag struct {
	GroupAddressTag

	MainGroup   string // 5 Bits: Values 0-31
	MiddleGroup string // 3 Bits: values 0-7
	SubGroup    string // 8 Bits
	TagType     *driverModel.KnxDatapointType
}

func NewGroupAddress3LevelPlcTag

func NewGroupAddress3LevelPlcTag(mainGroup string, middleGroup string, subGroup string, tagType *driverModel.KnxDatapointType) GroupAddress3LevelPlcTag

func (GroupAddress3LevelPlcTag) GetAddressString

func (k GroupAddress3LevelPlcTag) GetAddressString() string

func (GroupAddress3LevelPlcTag) GetArrayInfo

func (k GroupAddress3LevelPlcTag) GetArrayInfo() []apiModel.ArrayInfo

func (GroupAddress3LevelPlcTag) GetTagType

func (GroupAddress3LevelPlcTag) GetValueType

func (k GroupAddress3LevelPlcTag) GetValueType() values.PlcValueType

func (GroupAddress3LevelPlcTag) IsPatternTag

func (k GroupAddress3LevelPlcTag) IsPatternTag() bool

type GroupAddressTag

type GroupAddressTag interface {
	Tag

	GetTagType() *driverModel.KnxDatapointType
	IsPatternTag() bool
	// contains filtered or unexported methods
}

func CastToGroupAddressTagFromPlcTag

func CastToGroupAddressTagFromPlcTag(plcTag apiModel.PlcTag) (GroupAddressTag, error)

type InternalResult

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

type KnxDeviceAuthenticateResult

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

type KnxDeviceConnectResult

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

type KnxDeviceConnection

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

type KnxDeviceDisconnectResult

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

type KnxMemoryReadFragment

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

type KnxReadResult

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

type MessageCodec

type MessageCodec struct {
	_default.DefaultCodec
	// contains filtered or unexported fields
}

func NewMessageCodec

func NewMessageCodec(transportInstance transports.TransportInstance, messageInterceptor func(message spi.Message), _options ...options.WithOption) *MessageCodec

func (*MessageCodec) GetCodec

func (m *MessageCodec) GetCodec() spi.MessageCodec

func (*MessageCodec) Receive

func (m *MessageCodec) Receive() (spi.Message, error)

func (*MessageCodec) Send

func (m *MessageCodec) Send(message spi.Message) error

func (*MessageCodec) Serialize

func (d *MessageCodec) Serialize() ([]byte, error)

func (*MessageCodec) SerializeWithWriteBuffer

func (d *MessageCodec) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error

func (*MessageCodec) String

func (d *MessageCodec) String() string

type Reader

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

func NewReader

func NewReader(connection *Connection, _options ...options.WithOption) *Reader

func (Reader) Read

func (m Reader) Read(ctx context.Context, readRequest apiModel.PlcReadRequest) <-chan apiModel.PlcReadRequestResult

type Subscriber

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

func NewSubscriber

func NewSubscriber(connection *Connection, _options ...options.WithOption) *Subscriber

func (*Subscriber) Serialize

func (d *Subscriber) Serialize() ([]byte, error)

func (*Subscriber) SerializeWithWriteBuffer

func (d *Subscriber) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error

func (*Subscriber) String

func (d *Subscriber) String() string

func (*Subscriber) Subscribe

func (s *Subscriber) Subscribe(ctx context.Context, subscriptionRequest apiModel.PlcSubscriptionRequest) <-chan apiModel.PlcSubscriptionRequestResult

func (*Subscriber) Unregister

func (s *Subscriber) Unregister(registration apiModel.PlcConsumerRegistration)

func (*Subscriber) Unsubscribe

func (s *Subscriber) Unsubscribe(ctx context.Context, unsubscriptionRequest apiModel.PlcUnsubscriptionRequest) <-chan apiModel.PlcUnsubscriptionRequestResult

type SubscriptionEvent

type SubscriptionEvent struct {
	*spiModel.DefaultPlcSubscriptionEvent
	// contains filtered or unexported fields
}

func NewSubscriptionEvent

func NewSubscriptionEvent(
	tags map[string]apiModel.PlcTag,
	types map[string]apiModel.PlcSubscriptionType,
	intervals map[string]time.Duration,
	responseCodes map[string]apiModel.PlcResponseCode,
	addresses map[string][]byte,
	values map[string]values.PlcValue,
	_options ...options.WithOption,
) SubscriptionEvent

func (SubscriptionEvent) GetAddress

func (m SubscriptionEvent) GetAddress(name string) string

GetAddress Decode the binary data in the address according to the tag requested

type SubscriptionHandle

type SubscriptionHandle struct {
	*spiModel.DefaultPlcSubscriptionHandle
	// contains filtered or unexported fields
}

func NewSubscriptionHandle

func NewSubscriptionHandle(subscriber *Subscriber, tagName string, tag Tag, tagType apiModel.PlcSubscriptionType, interval time.Duration) *SubscriptionHandle

type Tag

type Tag interface {
	apiModel.PlcTag
}

func CastToKnxTagFromPlcTag

func CastToKnxTagFromPlcTag(plcTag apiModel.PlcTag) (Tag, error)

type TagHandler

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

func NewTagHandler

func NewTagHandler() TagHandler

func (TagHandler) ParseQuery

func (m TagHandler) ParseQuery(query string) (apiModel.PlcQuery, error)

func (TagHandler) ParseTag

func (m TagHandler) ParseTag(tagAddress string) (apiModel.PlcTag, error)

type ValueDecoder

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

func NewValueDecoder

func NewValueDecoder(rb utils.ReadBuffer) ValueDecoder

func (ValueDecoder) Decode

func (m ValueDecoder) Decode(typeName string) api.PlcValue

type ValueHandler

type ValueHandler struct {
}

func NewValueHandler

func NewValueHandler() ValueHandler

func (ValueHandler) NewPlcValue

func (m ValueHandler) NewPlcValue(tag apiModel.PlcTag, value any) (apiValues.PlcValue, error)

type Writer

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

func NewWriter

func NewWriter(messageCodec spi.MessageCodec) Writer

func (Writer) Write

func (m Writer) Write(ctx context.Context, writeRequest apiModel.PlcWriteRequest) <-chan apiModel.PlcWriteRequestResult

Jump to

Keyboard shortcuts

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