Documentation
¶
Index ¶
- Constants
- type Addr
- type Modem
- func (p *Modem) Close() error
- func (p *Modem) DialURL(url *transport.URL) (net.Conn, error)
- func (p *Modem) Flush() (err error)
- func (p *Modem) Listen() (ln net.Listener, err error)
- func (p *Modem) LocalAddr() net.Addr
- func (p *Modem) Read(d []byte) (int, error)
- func (p *Modem) RemoteAddr() net.Addr
- func (p *Modem) SetDeadline(t time.Time) error
- func (p *Modem) SetReadDeadline(t time.Time) error
- func (p *Modem) SetWriteDeadline(t time.Time) error
- func (p *Modem) TxBufferLen() int
- func (p *Modem) Write(d []byte) (int, error)
- type State
Constants ¶
const ( SerialTimeout = 1 PactorChannel = 31 MaxSendData = 256 MaxFrameNotTX = 2 )
SerialTimeout: Timeout for read operations on serial bus PactorChannel: Pactor channel, 31 should work for both, PTC-IIex and P4 Dragon MaxSendData: Pactor internal command buffer is 256 byte MaxFrameNotTX: Max. number of frames not transmitted at time.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Modem ¶
type Modem struct {
// contains filtered or unexported fields
}
func OpenModem ¶
func OpenModem(path string, baudRate int, myCall string, initScript string, cmdlineinit string) (p *Modem, err error)
Initialise the pactor modem and all variables. Switch the modem into hostmode. Start the link setup.
Will abort if modem reports failed link setup, Close() is called or timeout has occured (90 seconds)
func (*Modem) Close ¶
Close closes the current connection.
Will abort ("dirty disconnect") after 60 seconds if normal "disconnect" have not succeeded yet.
func (*Modem) DialURL ¶
DialURL dials pactor:// URLs
BLOCK until connection is established or timeoud occured
func (*Modem) Flush ¶
Flush waits for the last frames to be transmitted.
Will throw error if remaining frames could not bet sent within 120s
func (*Modem) Read ¶
Read bytes from the Software receive buffer. The receive thread takes care of reading them from the pactor modem
BLOCK until receive buffer has any data!
func (*Modem) RemoteAddr ¶
func (*Modem) TxBufferLen ¶
TxBufferLen returns the number of bytes in the out buffer queue.