Documentation
¶
Index ¶
- type ASTMConnection
- func (astmConn *ASTMConnection) CalculateChecksum(frame []byte) []byte
- func (astmConn *ASTMConnection) CheckChecksum(frame []byte) bool
- func (astmConn *ASTMConnection) Connect() error
- func (astmConn *ASTMConnection) Disconnect() error
- func (astmConn *ASTMConnection) EstablishSendMode() bool
- func (astmConn *ASTMConnection) IsConnected() bool
- func (astmConn *ASTMConnection) Listen()
- func (astmConn *ASTMConnection) ReadMessage(timeout time.Duration) (string, error)
- func (astmConn *ASTMConnection) SendMessage(message []byte)
- func (astmConn *ASTMConnection) StopSendMode()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ASTMConnection ¶
type ASTMConnection struct {
// contains filtered or unexported fields
}
func NewASTMConnection ¶
func NewASTMConnection(conn connection.Connection, saveIncomingMessage bool, incomingMessageSaveDir ...string) *ASTMConnection
func (*ASTMConnection) CalculateChecksum ¶
func (astmConn *ASTMConnection) CalculateChecksum(frame []byte) []byte
CalculateChecksum calculates the checksum of the given frame
func (*ASTMConnection) CheckChecksum ¶
func (astmConn *ASTMConnection) CheckChecksum(frame []byte) bool
CheckChecksum calculates the checksum of the frame
func (*ASTMConnection) Connect ¶
func (astmConn *ASTMConnection) Connect() error
Connect runs connect method of underlying Connection object
func (*ASTMConnection) Disconnect ¶
func (astmConn *ASTMConnection) Disconnect() error
Disconnect runs the disconnect method of underlying Connection object and also closes channels
func (*ASTMConnection) EstablishSendMode ¶
func (astmConn *ASTMConnection) EstablishSendMode() bool
EstablishSendMode sends an ENQ and waits for ACK/NAK
func (*ASTMConnection) IsConnected ¶
func (astmConn *ASTMConnection) IsConnected() bool
IsConnected checks the connection status of the underlying connection object
func (*ASTMConnection) Listen ¶
func (astmConn *ASTMConnection) Listen()
Listen listens to the incoming messages over the connection
func (*ASTMConnection) ReadMessage ¶
func (astmConn *ASTMConnection) ReadMessage(timeout time.Duration) (string, error)
ReadMessage reads a single ASTM Message from the connection.
func (*ASTMConnection) SendMessage ¶
func (astmConn *ASTMConnection) SendMessage(message []byte)
SendMessage takes single ASTM Record as input and sends it as one or more frames over the connection
func (*ASTMConnection) StopSendMode ¶
func (astmConn *ASTMConnection) StopSendMode()
StopSendMode send an EOT byte and changes status to Idle