Documentation ¶
Index ¶
- func WithStateMachineAccessPointDeviceInfoCache(deviceInfoCache *DeviceInfoCache) GenericApplier[*StateMachineAccessPoint]
- type ApplicationServiceAccessPoint
- func (a *ApplicationServiceAccessPoint) AlternateString() (string, bool)
- func (a *ApplicationServiceAccessPoint) Confirmation(args Args, kwArgs KWArgs) error
- func (a *ApplicationServiceAccessPoint) Indication(args Args, kwArgs KWArgs) error
- func (a *ApplicationServiceAccessPoint) SapConfirmation(args Args, kwArgs KWArgs) error
- func (a *ApplicationServiceAccessPoint) SapIndication(args Args, kwArgs KWArgs) error
- func (d *ApplicationServiceAccessPoint) Serialize() ([]byte, error)
- func (d *ApplicationServiceAccessPoint) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *ApplicationServiceAccessPoint) String() string
- type ClientSSM
- type DeviceInfo
- type DeviceInfoCache
- func (d *DeviceInfoCache) Acquire(key DeviceInfoCacheKey) (DeviceInfo, bool)
- func (d *DeviceInfoCache) GetDeviceInfo(key DeviceInfoCacheKey) (DeviceInfo, bool)
- func (d *DeviceInfoCache) HasDeviceInfo(key DeviceInfoCacheKey) bool
- func (d *DeviceInfoCache) IAmDeviceInfo(iAm readWriteModel.BACnetUnconfirmedServiceRequestIAm, pduSource Address)
- func (d *DeviceInfoCache) Release(deviceInfo DeviceInfo) error
- func (d *DeviceInfoCache) Serialize() ([]byte, error)
- func (d *DeviceInfoCache) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *DeviceInfoCache) String() string
- func (d *DeviceInfoCache) UpdateDeviceInfo(deviceInfo DeviceInfo)
- type DeviceInfoCacheKey
- type SSM
- type SSMProcessingRequirements
- type SSMSAPRequirements
- type SSMState
- type ServerSSM
- type StateMachineAccessPoint
- func (s *StateMachineAccessPoint) AlternateString() (string, bool)
- func (s *StateMachineAccessPoint) Confirmation(args Args, kwArgs KWArgs) error
- func (s *StateMachineAccessPoint) GetApplicationTimeout() uint
- func (s *StateMachineAccessPoint) GetClientTransactions() []*ClientSSM
- func (s *StateMachineAccessPoint) GetDefaultAPDUSegmentTimeout() uint
- func (s *StateMachineAccessPoint) GetDefaultAPDUTimeout() uint
- func (s *StateMachineAccessPoint) GetDefaultMaxSegmentsAccepted() readWriteModel.MaxSegmentsAccepted
- func (s *StateMachineAccessPoint) GetDefaultMaximumApduLengthAccepted() readWriteModel.MaxApduLengthAccepted
- func (s *StateMachineAccessPoint) GetDefaultSegmentationSupported() readWriteModel.BACnetSegmentation
- func (s *StateMachineAccessPoint) GetDeviceInfoCache() *DeviceInfoCache
- func (s *StateMachineAccessPoint) GetLocalDevice() LocalDeviceObject
- func (s *StateMachineAccessPoint) GetProposedWindowSize() uint8
- func (s *StateMachineAccessPoint) GetServerTransactions() []*ServerSSM
- func (s *StateMachineAccessPoint) RemoveClientTransaction(c *ClientSSM)
- func (s *StateMachineAccessPoint) RemoveServerTransaction(sssm *ServerSSM)
- func (s *StateMachineAccessPoint) SapConfirmation(args Args, kwArgs KWArgs) error
- func (s *StateMachineAccessPoint) SapIndication(args Args, kwArgs KWArgs) error
- func (d *StateMachineAccessPoint) Serialize() ([]byte, error)
- func (d *StateMachineAccessPoint) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (s *StateMachineAccessPoint) SetDeviceInfoCache(cache *DeviceInfoCache)
- func (d *StateMachineAccessPoint) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithStateMachineAccessPointDeviceInfoCache ¶
func WithStateMachineAccessPointDeviceInfoCache(deviceInfoCache *DeviceInfoCache) GenericApplier[*StateMachineAccessPoint]
Types ¶
type ApplicationServiceAccessPoint ¶
type ApplicationServiceAccessPoint struct { ApplicationServiceElementContract ServiceAccessPointContract *DefaultRFormatter `ignore:"true"` // contains filtered or unexported fields }
func NewApplicationServiceAccessPoint ¶
func NewApplicationServiceAccessPoint(localLog zerolog.Logger, options ...Option) (*ApplicationServiceAccessPoint, error)
func (*ApplicationServiceAccessPoint) AlternateString ¶
func (a *ApplicationServiceAccessPoint) AlternateString() (string, bool)
func (*ApplicationServiceAccessPoint) Confirmation ¶
func (a *ApplicationServiceAccessPoint) Confirmation(args Args, kwArgs KWArgs) error
TODO: big WIP
func (*ApplicationServiceAccessPoint) Indication ¶
func (a *ApplicationServiceAccessPoint) Indication(args Args, kwArgs KWArgs) error
func (*ApplicationServiceAccessPoint) SapConfirmation ¶
func (a *ApplicationServiceAccessPoint) SapConfirmation(args Args, kwArgs KWArgs) error
TODO: big WIP
func (*ApplicationServiceAccessPoint) SapIndication ¶
func (a *ApplicationServiceAccessPoint) SapIndication(args Args, kwArgs KWArgs) error
func (*ApplicationServiceAccessPoint) Serialize ¶
func (d *ApplicationServiceAccessPoint) Serialize() ([]byte, error)
func (*ApplicationServiceAccessPoint) SerializeWithWriteBuffer ¶
func (d *ApplicationServiceAccessPoint) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*ApplicationServiceAccessPoint) String ¶
func (d *ApplicationServiceAccessPoint) String() string
type ClientSSM ¶
type ClientSSM struct { *SSM // contains filtered or unexported fields }
func NewClientSSM ¶
func NewClientSSM(localLog zerolog.Logger, sap SSMSAPRequirements, pduAddress *Address) (*ClientSSM, error)
func (*ClientSSM) Confirmation ¶
Confirmation This function is called by the device for all upstream messages related to the transaction.
func (*ClientSSM) Indication ¶
Indication This function is called after the device has bound a new transaction and wants to start the process
rolling
func (*ClientSSM) ProcessTask ¶
ProcessTask This function is called when something has taken too long
type DeviceInfo ¶
type DeviceInfo struct { DeviceIdentifier readWriteModel.BACnetTagPayloadObjectIdentifier Address Address MaximumApduLengthAccepted *readWriteModel.MaxApduLengthAccepted `stringer:"true"` SegmentationSupported *readWriteModel.BACnetSegmentation `stringer:"true"` MaxSegmentsAccepted *readWriteModel.MaxSegmentsAccepted `stringer:"true"` VendorId *readWriteModel.BACnetVendorId `stringer:"true"` MaximumNpduLength *uint // contains filtered or unexported fields }
func NewDeviceInfo ¶
func NewDeviceInfo(deviceIdentifier readWriteModel.BACnetTagPayloadObjectIdentifier, address Address) DeviceInfo
func (*DeviceInfo) Serialize ¶
func (d *DeviceInfo) Serialize() ([]byte, error)
func (*DeviceInfo) SerializeWithWriteBuffer ¶
func (d *DeviceInfo) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*DeviceInfo) String ¶
func (d *DeviceInfo) String() string
type DeviceInfoCache ¶
type DeviceInfoCache struct {
// contains filtered or unexported fields
}
func NewDeviceInfoCache ¶
func NewDeviceInfoCache(localLog zerolog.Logger) *DeviceInfoCache
func (*DeviceInfoCache) Acquire ¶
func (d *DeviceInfoCache) Acquire(key DeviceInfoCacheKey) (DeviceInfo, bool)
Acquire Return the known information about the device and mark the record as being used by a segmentation state
machine.
func (*DeviceInfoCache) GetDeviceInfo ¶
func (d *DeviceInfoCache) GetDeviceInfo(key DeviceInfoCacheKey) (DeviceInfo, bool)
GetDeviceInfo gets a DeviceInfo from cache
func (*DeviceInfoCache) HasDeviceInfo ¶
func (d *DeviceInfoCache) HasDeviceInfo(key DeviceInfoCacheKey) bool
HasDeviceInfo Return true if cache has information about the device.
func (*DeviceInfoCache) IAmDeviceInfo ¶
func (d *DeviceInfoCache) IAmDeviceInfo(iAm readWriteModel.BACnetUnconfirmedServiceRequestIAm, pduSource Address)
IAmDeviceInfo Create a device information record based on the contents of an IAmRequest and put it in the cache.
func (*DeviceInfoCache) Release ¶
func (d *DeviceInfoCache) Release(deviceInfo DeviceInfo) error
Release This function is called by the segmentation state machine when it has finished with the device information.
func (*DeviceInfoCache) Serialize ¶
func (d *DeviceInfoCache) Serialize() ([]byte, error)
func (*DeviceInfoCache) SerializeWithWriteBuffer ¶
func (d *DeviceInfoCache) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*DeviceInfoCache) String ¶
func (d *DeviceInfoCache) String() string
func (*DeviceInfoCache) UpdateDeviceInfo ¶
func (d *DeviceInfoCache) UpdateDeviceInfo(deviceInfo DeviceInfo)
UpdateDeviceInfo The application has updated one or more fields in the device information record and the cache needs
to be updated to reflect the changes. If this is a cached version of a persistent record then this is the opportunity to update the database.
type DeviceInfoCacheKey ¶
type DeviceInfoCacheKey struct { Instance *uint32 PduSource *Address }
DeviceInfoCacheKey caches by either Instance, PduSource of both
func (DeviceInfoCacheKey) HashKey ¶
func (k DeviceInfoCacheKey) HashKey() uint32
func (DeviceInfoCacheKey) String ¶
func (k DeviceInfoCacheKey) String() string
type SSM ¶
type SSM struct { *OneShotTask SSMProcessingRequirements // contains filtered or unexported fields }
SSM - Segmentation State Machine
func NewSSM ¶
func NewSSM(localLog zerolog.Logger, sap interface { SSMSAPRequirements SSMProcessingRequirements }, pduAddress *Address) (*SSM, error)
func (*SSM) RestartTimer ¶
func (*SSM) StartTimer ¶
type SSMProcessingRequirements ¶
type SSMProcessingRequirements interface {
// contains filtered or unexported methods
}
type SSMSAPRequirements ¶
type SSMSAPRequirements interface { ServiceAccessPointContract Client GetDeviceInfoCache() *DeviceInfoCache GetLocalDevice() LocalDeviceObject GetProposedWindowSize() uint8 GetClientTransactions() []*ClientSSM RemoveClientTransaction(*ClientSSM) GetServerTransactions() []*ServerSSM RemoveServerTransaction(*ServerSSM) GetApplicationTimeout() uint GetDefaultAPDUTimeout() uint GetDefaultSegmentationSupported() readWriteModel.BACnetSegmentation GetDefaultAPDUSegmentTimeout() uint GetDefaultMaxSegmentsAccepted() readWriteModel.MaxSegmentsAccepted GetDefaultMaximumApduLengthAccepted() readWriteModel.MaxApduLengthAccepted }
type ServerSSM ¶
type ServerSSM struct { *SSM // contains filtered or unexported fields }
func NewServerSSM ¶
func NewServerSSM(localLog zerolog.Logger, sap SSMSAPRequirements, pduAddress *Address) (*ServerSSM, error)
func (*ServerSSM) Confirmation ¶
Confirmation This function is called when the application has provided a response and needs it to be sent to the
client.
func (*ServerSSM) Indication ¶
Indication This function is called for each downstream packet related to
the transaction
func (*ServerSSM) ProcessTask ¶
ProcessTask This function is called when the client has failed to send all the segments of a segmented request,
the application has taken too long to complete the request, or the client failed to ack the segments of a segmented response
type StateMachineAccessPoint ¶
type StateMachineAccessPoint struct { ClientContract ServiceAccessPointContract *DefaultRFormatter `ignore:"true"` // contains filtered or unexported fields }
func NewStateMachineAccessPoint ¶
func NewStateMachineAccessPoint(localLog zerolog.Logger, localDevice LocalDeviceObject, options ...Option) (*StateMachineAccessPoint, error)
func (*StateMachineAccessPoint) AlternateString ¶
func (s *StateMachineAccessPoint) AlternateString() (string, bool)
func (*StateMachineAccessPoint) Confirmation ¶
func (s *StateMachineAccessPoint) Confirmation(args Args, kwArgs KWArgs) error
Confirmation Packets coming up the stack are APDU's
func (*StateMachineAccessPoint) GetApplicationTimeout ¶
func (s *StateMachineAccessPoint) GetApplicationTimeout() uint
func (*StateMachineAccessPoint) GetClientTransactions ¶
func (s *StateMachineAccessPoint) GetClientTransactions() []*ClientSSM
func (*StateMachineAccessPoint) GetDefaultAPDUSegmentTimeout ¶
func (s *StateMachineAccessPoint) GetDefaultAPDUSegmentTimeout() uint
func (*StateMachineAccessPoint) GetDefaultAPDUTimeout ¶
func (s *StateMachineAccessPoint) GetDefaultAPDUTimeout() uint
func (*StateMachineAccessPoint) GetDefaultMaxSegmentsAccepted ¶
func (s *StateMachineAccessPoint) GetDefaultMaxSegmentsAccepted() readWriteModel.MaxSegmentsAccepted
func (*StateMachineAccessPoint) GetDefaultMaximumApduLengthAccepted ¶
func (s *StateMachineAccessPoint) GetDefaultMaximumApduLengthAccepted() readWriteModel.MaxApduLengthAccepted
func (*StateMachineAccessPoint) GetDefaultSegmentationSupported ¶
func (s *StateMachineAccessPoint) GetDefaultSegmentationSupported() readWriteModel.BACnetSegmentation
func (*StateMachineAccessPoint) GetDeviceInfoCache ¶
func (s *StateMachineAccessPoint) GetDeviceInfoCache() *DeviceInfoCache
func (*StateMachineAccessPoint) GetLocalDevice ¶
func (s *StateMachineAccessPoint) GetLocalDevice() LocalDeviceObject
func (*StateMachineAccessPoint) GetProposedWindowSize ¶
func (s *StateMachineAccessPoint) GetProposedWindowSize() uint8
func (*StateMachineAccessPoint) GetServerTransactions ¶
func (s *StateMachineAccessPoint) GetServerTransactions() []*ServerSSM
func (*StateMachineAccessPoint) RemoveClientTransaction ¶
func (s *StateMachineAccessPoint) RemoveClientTransaction(c *ClientSSM)
func (*StateMachineAccessPoint) RemoveServerTransaction ¶
func (s *StateMachineAccessPoint) RemoveServerTransaction(sssm *ServerSSM)
func (*StateMachineAccessPoint) SapConfirmation ¶
func (s *StateMachineAccessPoint) SapConfirmation(args Args, kwArgs KWArgs) error
SapConfirmation This function is called when the application is responding to a request, the apdu may be a simple
ack, complex ack, error, reject or abort
func (*StateMachineAccessPoint) SapIndication ¶
func (s *StateMachineAccessPoint) SapIndication(args Args, kwArgs KWArgs) error
SapIndication This function is called when the application is requesting a new transaction as a client.
func (*StateMachineAccessPoint) Serialize ¶
func (d *StateMachineAccessPoint) Serialize() ([]byte, error)
func (*StateMachineAccessPoint) SerializeWithWriteBuffer ¶
func (d *StateMachineAccessPoint) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*StateMachineAccessPoint) SetDeviceInfoCache ¶
func (s *StateMachineAccessPoint) SetDeviceInfoCache(cache *DeviceInfoCache)
func (*StateMachineAccessPoint) String ¶
func (d *StateMachineAccessPoint) String() string
Source Files ¶
- app_DeviceInfo.go
- app_DeviceInfoCache.go
- app_DeviceInfoCache_plc4xgen.go
- app_DeviceInfo_plc4xgen.go
- appservice.go
- appservice_ApplicationServiceAccessPoint.go
- appservice_ApplicationServiceAccessPoint_plc4xgen.go
- appservice_ClientSSM.go
- appservice_SSM.go
- appservice_ServerSSM.go
- appservice_StateMachineAccessPoint.go
- appservice_StateMachineAccessPoint_plc4xgen.go