Documentation ¶
Index ¶
- Variables
- func CreateRequestContext(cBusMessage readWriteModel.CBusMessage) readWriteModel.RequestContext
- func CreateRequestContextWithInfoCallback(cBusMessage readWriteModel.CBusMessage, infoCallBack func(string)) readWriteModel.RequestContext
- func MapEncodedReply(localLog zerolog.Logger, transaction transactions.RequestTransaction, ...) error
- func NewDriver(_options ...options.WithOption) plc4go.PlcDriver
- func TagToCBusMessage(tag apiModel.PlcTag, value apiValues.PlcValue, alphaGenerator *AlphaGenerator, ...) (cBusMessage readWriteModel.CBusMessage, ...)
- type AlphaGenerator
- type Browser
- type CALGetStatusTag
- type CALIdentifyTag
- type CALRecallTag
- type CalTag
- type CommandAndArgumentsCount
- type Configuration
- type Connection
- func (c *Connection) BrowseRequestBuilder() apiModel.PlcBrowseRequestBuilder
- func (c *Connection) Close() <-chan plc4go.PlcConnectionCloseResult
- func (c *Connection) ConnectWithContext(ctx context.Context) <-chan plc4go.PlcConnectionConnectResult
- func (c *Connection) GetConnection() plc4go.PlcConnection
- func (c *Connection) GetConnectionId() string
- func (c *Connection) GetMessageCodec() spi.MessageCodec
- func (c *Connection) GetMetadata() apiModel.PlcConnectionMetadata
- func (c *Connection) GetTracer() tracer.Tracer
- func (c *Connection) IsTraceEnabled() bool
- func (c *Connection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder
- func (d *Connection) Serialize() ([]byte, error)
- func (d *Connection) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *Connection) String() string
- func (c *Connection) SubscriptionRequestBuilder() apiModel.PlcSubscriptionRequestBuilder
- func (c *Connection) UnsubscriptionRequestBuilder() apiModel.PlcUnsubscriptionRequestBuilder
- func (c *Connection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder
- type Discoverer
- type Driver
- func (m *Driver) Close() error
- func (m *Driver) DiscoverWithContext(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), ...) error
- func (m *Driver) GetConnectionWithContext(ctx context.Context, transportUrl url.URL, ...) <-chan plc4go.PlcConnectionConnectResult
- func (m *Driver) SetAwaitDisconnectComplete(awaitComplete bool)
- func (m *Driver) SetAwaitSetupComplete(awaitComplete bool)
- func (m *Driver) SupportsDiscovery() bool
- type DriverContext
- type MMIMonitorTag
- type MessageCodec
- func (m *MessageCodec) Connect() error
- func (m *MessageCodec) ConnectWithContext(ctx context.Context) error
- func (m *MessageCodec) Disconnect() error
- func (m *MessageCodec) GetCodec() spi.MessageCodec
- func (m *MessageCodec) Receive() (spi.Message, error)
- func (m *MessageCodec) Send(message spi.Message) error
- func (d *MessageCodec) Serialize() ([]byte, error)
- func (d *MessageCodec) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *MessageCodec) String() string
- type Reader
- type RequestTransactiondeprecated
- type SALMonitorTag
- type SALTag
- type StatusRequestType
- type StatusTag
- type Subscriber
- func (s *Subscriber) Register(consumer apiModel.PlcSubscriptionEventConsumer, ...) apiModel.PlcConsumerRegistration
- func (d *Subscriber) Serialize() ([]byte, error)
- func (d *Subscriber) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *Subscriber) String() string
- func (s *Subscriber) Subscribe(_ context.Context, subscriptionRequest apiModel.PlcSubscriptionRequest) <-chan apiModel.PlcSubscriptionRequestResult
- func (s *Subscriber) Unregister(registration apiModel.PlcConsumerRegistration)
- func (s *Subscriber) Unsubscribe(ctx context.Context, unsubscriptionRequest apiModel.PlcUnsubscriptionRequest) <-chan apiModel.PlcUnsubscriptionRequestResult
- type SubscriptionEvent
- type SubscriptionHandle
- type SubscriptionTag
- type Tag
- type TagHandler
- type TagType
- type UnitInfoQuery
- type ValueHandler
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var PossibleSalCommands = map[readWriteModel.ApplicationId][]CommandAndArgumentsCount{ readWriteModel.ApplicationId_RESERVED: nil, readWriteModel.ApplicationId_FREE_USAGE: nil, readWriteModel.ApplicationId_TEMPERATURE_BROADCAST: c2nl(readWriteModel.TemperatureBroadcastCommandTypeValues), readWriteModel.ApplicationId_ROOM_CONTROL_SYSTEM: nil, readWriteModel.ApplicationId_LIGHTING: c2nl(readWriteModel.LightingCommandTypeValues), readWriteModel.ApplicationId_VENTILATION: c2nl(readWriteModel.LightingCommandTypeValues), readWriteModel.ApplicationId_IRRIGATION_CONTROL: c2nl(readWriteModel.LightingCommandTypeValues), readWriteModel.ApplicationId_POOLS_SPAS_PONDS_FOUNTAINS_CONTROL: c2nl(readWriteModel.LightingCommandTypeValues), readWriteModel.ApplicationId_HEATING: c2nl(readWriteModel.LightingCommandTypeValues), readWriteModel.ApplicationId_AIR_CONDITIONING: c2nl(readWriteModel.AirConditioningCommandTypeValues), readWriteModel.ApplicationId_TRIGGER_CONTROL: c2nl(readWriteModel.TriggerControlCommandTypeValues), readWriteModel.ApplicationId_ENABLE_CONTROL: c2nl(readWriteModel.EnableControlCommandTypeValues), readWriteModel.ApplicationId_AUDIO_AND_VIDEO: c2nl(readWriteModel.LightingCommandTypeValues), readWriteModel.ApplicationId_SECURITY: c2nl(readWriteModel.SecurityCommandTypeValues), readWriteModel.ApplicationId_METERING: c2nl(readWriteModel.MeteringCommandTypeValues), readWriteModel.ApplicationId_ACCESS_CONTROL: c2nl(readWriteModel.AccessControlCommandTypeValues), readWriteModel.ApplicationId_CLOCK_AND_TIMEKEEPING: c2nl(readWriteModel.ClockAndTimekeepingCommandTypeValues), readWriteModel.ApplicationId_TELEPHONY_STATUS_AND_CONTROL: c2nl(readWriteModel.TelephonyCommandTypeValues), readWriteModel.ApplicationId_MEASUREMENT: c2nl(readWriteModel.MeasurementCommandTypeValues), readWriteModel.ApplicationId_TESTING: nil, readWriteModel.ApplicationId_MEDIA_TRANSPORT_CONTROL: c2nl(readWriteModel.MediaTransportControlCommandTypeValues), readWriteModel.ApplicationId_ERROR_REPORTING: c2nl(readWriteModel.ErrorReportingCommandTypeValues), readWriteModel.ApplicationId_HVAC_ACTUATOR: c2nl(readWriteModel.LightingCommandTypeValues), }
Functions ¶
func CreateRequestContext ¶
func CreateRequestContext(cBusMessage readWriteModel.CBusMessage) readWriteModel.RequestContext
func CreateRequestContextWithInfoCallback ¶
func CreateRequestContextWithInfoCallback(cBusMessage readWriteModel.CBusMessage, infoCallBack func(string)) readWriteModel.RequestContext
func MapEncodedReply ¶
func MapEncodedReply(localLog zerolog.Logger, transaction transactions.RequestTransaction, encodedReply readWriteModel.EncodedReply, tagName string, addResponseCode func(name string, responseCode apiModel.PlcResponseCode), addPlcValue func(name string, plcValue apiValues.PlcValue)) error
func NewDriver ¶
func NewDriver(_options ...options.WithOption) plc4go.PlcDriver
func TagToCBusMessage ¶
func TagToCBusMessage(tag apiModel.PlcTag, value apiValues.PlcValue, alphaGenerator *AlphaGenerator, messageCodec *MessageCodec) (cBusMessage readWriteModel.CBusMessage, supportsRead, supportsWrite, supportsSubscribe bool, err error)
Types ¶
type AlphaGenerator ¶
type AlphaGenerator struct {
// contains filtered or unexported fields
}
func (*AlphaGenerator) Serialize ¶
func (d *AlphaGenerator) Serialize() ([]byte, error)
func (*AlphaGenerator) SerializeWithWriteBuffer ¶
func (d *AlphaGenerator) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*AlphaGenerator) String ¶
func (d *AlphaGenerator) String() string
type Browser ¶
type Browser struct { _default.DefaultBrowser // contains filtered or unexported fields }
func NewBrowser ¶
func NewBrowser(connection plc4go.PlcConnection, _options ...options.WithOption) *Browser
func (*Browser) BrowseQuery ¶
func (m *Browser) BrowseQuery(ctx context.Context, interceptor func(result apiModel.PlcBrowseItem) bool, queryName string, query apiModel.PlcQuery) (responseCode apiModel.PlcResponseCode, queryResults []apiModel.PlcBrowseItem)
type CALGetStatusTag ¶
type CALGetStatusTag interface { Tag CalTag GetParameter() readWriteModel.Parameter GetCount() uint8 }
CALGetStatusTag can be used to get device/network management tags
func NewCALGetStatusTag ¶
func NewCALGetStatusTag(unitAddress readWriteModel.UnitAddress, bridgeAddresses []readWriteModel.BridgeAddress, parameter readWriteModel.Parameter, count uint8, numElements uint16) CALGetStatusTag
type CALIdentifyTag ¶
type CALIdentifyTag interface { Tag CalTag GetAttribute() readWriteModel.Attribute }
CALIdentifyTag can be used to get device/network management tags
func NewCALIdentifyTag ¶
func NewCALIdentifyTag(unitAddress readWriteModel.UnitAddress, bridgeAddresses []readWriteModel.BridgeAddress, attribute readWriteModel.Attribute, numElements uint16) CALIdentifyTag
type CALRecallTag ¶
type CALRecallTag interface { Tag CalTag GetParameter() readWriteModel.Parameter GetCount() uint8 }
CALRecallTag can be used to get device/network management tags
func NewCALRecallTag ¶
func NewCALRecallTag(unitAddress readWriteModel.UnitAddress, bridgeAddresses []readWriteModel.BridgeAddress, parameter readWriteModel.Parameter, count uint8, numElements uint16) CALRecallTag
type CalTag ¶
type CalTag interface { GetBridgeAddresses() []readWriteModel.BridgeAddress GetUnitAddress() readWriteModel.UnitAddress }
type Configuration ¶
type Configuration struct { Srchk bool Exstat bool Pun bool LocalSal bool Pcn bool Idmon bool Monitor bool Smart bool XonXoff bool Connect bool MonitoredApplication1 byte MonitoredApplication2 byte }
func ParseFromOptions ¶
func (*Configuration) Serialize ¶
func (d *Configuration) Serialize() ([]byte, error)
func (*Configuration) SerializeWithWriteBuffer ¶
func (d *Configuration) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*Configuration) String ¶
func (d *Configuration) String() string
type Connection ¶
type Connection struct { _default.DefaultConnection // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(messageCodec *MessageCodec, configuration Configuration, driverContext DriverContext, tagHandler spi.PlcTagHandler, tm transactions.RequestTransactionManager, connectionOptions map[string][]string, _options ...options.WithOption) *Connection
func (*Connection) BrowseRequestBuilder ¶
func (c *Connection) BrowseRequestBuilder() apiModel.PlcBrowseRequestBuilder
func (*Connection) Close ¶
func (c *Connection) Close() <-chan plc4go.PlcConnectionCloseResult
func (*Connection) ConnectWithContext ¶
func (c *Connection) ConnectWithContext(ctx context.Context) <-chan plc4go.PlcConnectionConnectResult
func (*Connection) GetConnection ¶
func (c *Connection) GetConnection() plc4go.PlcConnection
func (*Connection) GetConnectionId ¶
func (c *Connection) GetConnectionId() string
func (*Connection) GetMessageCodec ¶
func (c *Connection) GetMessageCodec() spi.MessageCodec
func (*Connection) GetMetadata ¶
func (c *Connection) GetMetadata() apiModel.PlcConnectionMetadata
func (*Connection) GetTracer ¶
func (c *Connection) GetTracer() tracer.Tracer
func (*Connection) IsTraceEnabled ¶
func (c *Connection) IsTraceEnabled() bool
func (*Connection) ReadRequestBuilder ¶
func (c *Connection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder
func (*Connection) Serialize ¶
func (d *Connection) Serialize() ([]byte, error)
func (*Connection) SerializeWithWriteBuffer ¶
func (d *Connection) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*Connection) String ¶
func (d *Connection) String() string
func (*Connection) SubscriptionRequestBuilder ¶
func (c *Connection) SubscriptionRequestBuilder() apiModel.PlcSubscriptionRequestBuilder
func (*Connection) UnsubscriptionRequestBuilder ¶
func (c *Connection) UnsubscriptionRequestBuilder() apiModel.PlcUnsubscriptionRequestBuilder
func (*Connection) WriteRequestBuilder ¶
func (c *Connection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder
type Discoverer ¶
type Discoverer struct {
// contains filtered or unexported fields
}
func NewDiscoverer ¶
func NewDiscoverer(_options ...options.WithOption) *Discoverer
func (*Discoverer) Close ¶
func (d *Discoverer) Close() error
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 (*Driver) DiscoverWithContext ¶
func (m *Driver) DiscoverWithContext(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error
func (*Driver) GetConnectionWithContext ¶
func (*Driver) SetAwaitDisconnectComplete ¶
func (*Driver) SetAwaitSetupComplete ¶
func (*Driver) SupportsDiscovery ¶
type DriverContext ¶
type DriverContext struct {
// contains filtered or unexported fields
}
func NewDriverContext ¶
func NewDriverContext(_ Configuration) DriverContext
func (*DriverContext) Serialize ¶
func (d *DriverContext) Serialize() ([]byte, error)
func (*DriverContext) SerializeWithWriteBuffer ¶
func (d *DriverContext) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*DriverContext) String ¶
func (d *DriverContext) String() string
type MMIMonitorTag ¶
type MMIMonitorTag interface { SubscriptionTag GetUnitAddress() readWriteModel.UnitAddress GetApplication() *readWriteModel.ApplicationIdContainer }
MMIMonitorTag can be used to monitor mmi tags
func NewMMIMonitorTag ¶
func NewMMIMonitorTag(unitAddress readWriteModel.UnitAddress, application *readWriteModel.ApplicationIdContainer, numElements uint16) MMIMonitorTag
type MessageCodec ¶
type MessageCodec struct { _default.DefaultCodec // contains filtered or unexported fields }
func NewMessageCodec ¶
func NewMessageCodec(transportInstance transports.TransportInstance, _options ...options.WithOption) *MessageCodec
func (*MessageCodec) Connect ¶
func (m *MessageCodec) Connect() error
func (*MessageCodec) ConnectWithContext ¶
func (m *MessageCodec) ConnectWithContext(ctx context.Context) error
func (*MessageCodec) Disconnect ¶
func (m *MessageCodec) Disconnect() error
func (*MessageCodec) GetCodec ¶
func (m *MessageCodec) GetCodec() spi.MessageCodec
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(tpduGenerator *AlphaGenerator, messageCodec *MessageCodec, tm transactions.RequestTransactionManager, _options ...options.WithOption) *Reader
func (*Reader) Read ¶
func (m *Reader) Read(ctx context.Context, readRequest apiModel.PlcReadRequest) <-chan apiModel.PlcReadRequestResult
type RequestTransaction
deprecated
type RequestTransaction interface { transactions.RequestTransaction }
Deprecated: don't use it in productive code
type SALMonitorTag ¶
type SALMonitorTag interface { SubscriptionTag GetUnitAddress() readWriteModel.UnitAddress GetApplication() *readWriteModel.ApplicationIdContainer }
SALMonitorTag can be used to monitor sal tags
func NewSALMonitorTag ¶
func NewSALMonitorTag(unitAddress readWriteModel.UnitAddress, application *readWriteModel.ApplicationIdContainer, numElements uint16) SALMonitorTag
type SALTag ¶
type SALTag interface { Tag GetBridgeAddresses() []readWriteModel.BridgeAddress GetApplication() readWriteModel.ApplicationIdContainer GetSALCommand() string }
SALTag can be used to send SAL commands
func NewSALTag ¶
func NewSALTag(bridgeAddresses []readWriteModel.BridgeAddress, application readWriteModel.ApplicationIdContainer, salCommand string, numElements uint16) SALTag
type StatusRequestType ¶
type StatusRequestType uint8
const ( StatusRequestTypeBinaryState StatusRequestType = iota StatusRequestTypeLevel )
func (StatusRequestType) String ¶
func (i StatusRequestType) String() string
type StatusTag ¶
type StatusTag interface { Tag GetBridgeAddresses() []readWriteModel.BridgeAddress GetStatusRequestType() StatusRequestType GetStartingGroupAddressLabel() *byte GetApplication() readWriteModel.ApplicationIdContainer }
StatusTag can be used to query status using a P-to-MP-StatusRequest command
func NewStatusTag ¶
func NewStatusTag(bridgeAddresses []readWriteModel.BridgeAddress, statusRequestType StatusRequestType, startingGroupAddressLabel *byte, application readWriteModel.ApplicationIdContainer, numElements uint16) StatusTag
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber(addSubscriber func(subscriber *Subscriber), _options ...options.WithOption) *Subscriber
func (*Subscriber) Register ¶
func (s *Subscriber) Register(consumer apiModel.PlcSubscriptionEventConsumer, handles []apiModel.PlcSubscriptionHandle) apiModel.PlcConsumerRegistration
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(_ 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, address map[string]string, sources map[string]string, values map[string]apiValues.PlcValue, _options ...options.WithOption, ) SubscriptionEvent
func (SubscriptionEvent) GetAddress ¶
func (m SubscriptionEvent) GetAddress(name string) string
func (SubscriptionEvent) GetSource ¶
func (m SubscriptionEvent) GetSource(name string) string
type SubscriptionHandle ¶
type SubscriptionHandle struct { *spiModel.DefaultPlcSubscriptionHandle // contains filtered or unexported fields }
func NewSubscriptionHandle ¶
func NewSubscriptionHandle(subscriber *Subscriber, tagName string, tag any, subscriptionType apiModel.PlcSubscriptionType, interval time.Duration) *SubscriptionHandle
type SubscriptionTag ¶
type SubscriptionTag interface { Tag apiModel.PlcSubscriptionTag }
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)
type TagType ¶
type TagType uint8
const ( STATUS TagType = iota CAL_RESET /* TODO: implement me*/ CAL_RECALL CAL_IDENTIFY CAL_GETSTATUS CAL_WRITE /* TODO: implement me*/ CAL_IDENTIFY_REPLY /* TODO: implement me*/ CAL_STATUS /* TODO: implement me*/ CAL_STATUS_EXTENDED /* TODO: implement me*/ SAL SAL_MONITOR MMI_STATUS_MONITOR UNIT_INFO )
type UnitInfoQuery ¶
type UnitInfoQuery interface { apiModel.PlcQuery GetUnitAddress() readWriteModel.UnitAddress GetAttribute() *readWriteModel.Attribute }
UnitInfoQuery can be used to get information about unit(s)
func NewUnitInfoQuery ¶
func NewUnitInfoQuery(unitAddress readWriteModel.UnitAddress, attribute *readWriteModel.Attribute, numElements uint16) UnitInfoQuery
type ValueHandler ¶
type ValueHandler struct {
spiValues.DefaultValueHandler
}
func NewValueHandler ¶
func NewValueHandler(_options ...options.WithOption) ValueHandler
func (ValueHandler) NewPlcValue ¶
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(tpduGenerator *AlphaGenerator, messageCodec *MessageCodec, tm transactions.RequestTransactionManager, _options ...options.WithOption) *Writer
func (*Writer) Write ¶
func (m *Writer) Write(ctx context.Context, writeRequest apiModel.PlcWriteRequest) <-chan apiModel.PlcWriteRequestResult
Source Files ¶
- AlphaGenerator_plc4xgen.go
- Browser.go
- CBusMessageMapper.go
- Configuration.go
- Configuration_plc4xgen.go
- Connection.go
- Connection_plc4xgen.go
- Discoverer.go
- Driver.go
- DriverContext.go
- DriverContext_plc4xgen.go
- MessageCodec.go
- MessageCodec_plc4xgen.go
- Query.go
- Reader.go
- Subscriber.go
- Subscriber_plc4xgen.go
- SubscriptionEvent.go
- SubscriptionHandle.go
- Tag.go
- TagHandler.go
- Util.go
- ValueHandler.go
- Writer.go
- mock_requirements.go
- statusrequesttype_string.go
- tagtype_string.go
Click to show internal directories.
Click to hide internal directories.