github.com/enbility/spine-go@v0.7.0/api/sender.go (about) 1 package api 2 3 import "github.com/enbility/spine-go/model" 4 5 /* Sender */ 6 7 type ComControlInterface interface { 8 // This must be connected to the correct remote device !! 9 SendSpineMessage(datagram model.DatagramType) error 10 } 11 12 type SenderInterface interface { 13 // Process a received message, e.g. for handling caching data 14 ProcessResponseForMsgCounterReference(msgCounterRef *model.MsgCounterType) 15 // Sends a read cmd to request some data 16 Request(cmdClassifier model.CmdClassifierType, senderAddress, destinationAddress *model.FeatureAddressType, ackRequest bool, cmd []model.CmdType) (*model.MsgCounterType, error) 17 // Sends a result cmd with no error to indicate that a message was processed successfully 18 ResultSuccess(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType) error 19 // Sends a result cmd with error information to indicate that a message processing failed 20 ResultError(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, err *model.ErrorType) error 21 // Sends a reply cmd to response to a read cmd 22 Reply(requestHeader *model.HeaderType, senderAddress *model.FeatureAddressType, cmd model.CmdType) error 23 // Sends a call cmd with a subscription request 24 Subscribe(senderAddress, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) 25 // Sends a call cmd with a subscription delete request 26 Unsubscribe(senderAddress, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) 27 // Sends a call cmd with a binding request 28 Bind(senderAddress, destinationAddress *model.FeatureAddressType, serverFeatureType model.FeatureTypeType) (*model.MsgCounterType, error) 29 // Sends a call cmd with a binding delte request 30 Unbind(senderAddress, destinationAddress *model.FeatureAddressType) (*model.MsgCounterType, error) 31 // Sends a notify cmd to indicate that a subscribed feature changed 32 Notify(senderAddress, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) 33 // Sends a write cmd, setting properties of remote features 34 Write(senderAddress, destinationAddress *model.FeatureAddressType, cmd model.CmdType) (*model.MsgCounterType, error) 35 // return the datagram for a given msgCounter (only availbe for Notify messages!), error if not found 36 DatagramForMsgCounter(msgCounter model.MsgCounterType) (model.DatagramType, error) 37 }