Documentation ¶
Overview ¶
Package ardop provides means of establishing a connection to a remote node using ARDOP TNC
Index ¶
- Constants
- Variables
- type Addr
- type State
- type StateReceiver
- type TNC
- func (tnc *TNC) ARQBandwidth() (int, error)
- func (tnc *TNC) ARQTimeout() (time.Duration, error)
- func (tnc *TNC) Abort() error
- func (tnc *TNC) AutoBreak() (bool, error)
- func (tnc *TNC) BeaconEvery(d time.Duration) error
- func (tnc *TNC) Busy() bool
- func (tnc *TNC) CWID() (bool, error)
- func (tnc *TNC) Close() error
- func (tnc *TNC) Dial(targetcall string) (net.Conn, error)
- func (tnc *TNC) DialURL(url *transport.URL) (net.Conn, error)
- func (tnc *TNC) Disconnect() error
- func (tnc *TNC) GridSquare() (string, error)
- func (tnc *TNC) Heard() map[string]time.Time
- func (tnc *TNC) Idle() bool
- func (tnc *TNC) Listen() (ln net.Listener, err error)
- func (tnc *TNC) ListenEnabled() StateReceiver
- func (tnc *TNC) MyCall() (string, error)
- func (tnc *TNC) NegotiateBandwidth() (bool, error)
- func (tnc *TNC) Ping() error
- func (tnc *TNC) SendID() error
- func (tnc *TNC) SetARQBandwidth(bw int) error
- func (tnc *TNC) SetARQTimeout(d time.Duration) error
- func (tnc *TNC) SetAutoBreak(on bool) error
- func (tnc *TNC) SetAuxiliaryCalls(calls []string) (err error)
- func (tnc *TNC) SetCWID(enabled bool) error
- func (tnc *TNC) SetCodec(state bool) error
- func (tnc *TNC) SetGridSquare(gs string) error
- func (tnc *TNC) SetListenEnabled(listen bool) error
- func (tnc *TNC) SetMycall(mycall string) error
- func (tnc *TNC) SetNegotiateBandwidth(negotiate bool) error
- func (tnc *TNC) SetPTT(ptt transport.PTTController)
- func (tnc *TNC) State() State
- func (tnc *TNC) Version() (string, error)
Constants ¶
const ( DefaultAddr = "localhost:8515" // The default address Ardop TNC listens on DefaultARQTimeout = 90 * time.Second // The default ARQ session idle timout )
const ( ModeARQ = "ARQ" // ARQ mode ModeFEC = "FEC" // FEC mode )
Variables ¶
var ( ErrBusy = errors.New("TNC control port is busy.") ErrConnectInProgress = errors.New("A connect is in progress.") ErrFlushTimeout = errors.New("Flush timeout.") ErrActiveListenerExists = errors.New("An active listener is already registered with this TNC.") ErrDisconnectTimeout = errors.New("Disconnect timeout: aborted connection.") ErrConnectTimeout = errors.New("Connect timeout") ErrRejectedBandwidth = errors.New("Connection rejected by peer: incompatible bandwidth") ErrRejectedBusy = errors.New("Connection rejected: channel busy") ErrChecksumMismatch = errors.New("Control protocol checksum mismatch") ErrTNCClosed = errors.New("TNC closed") )
Functions ¶
This section is empty.
Types ¶
type State ¶
type State uint8
const ( //go:generate stringer -type=State . Unknown State = iota Offline // Sound card disabled and all sound card resources are released Disconnected // The session is disconnected, the sound card remains active ISS // Information Sending Station (Sending Data) IRS // Information Receiving Station (Receiving data) Quiet // ?? FECSend // ?? FECReceive // Receiving FEC (unproto) data )
TNC states
type StateReceiver ¶
type StateReceiver struct {
// contains filtered or unexported fields
}
func (StateReceiver) Close ¶
func (r StateReceiver) Close()
func (StateReceiver) States ¶
func (r StateReceiver) States() <-chan State
type TNC ¶
type TNC struct {
// contains filtered or unexported fields
}
func Open ¶
func Open(ctrl io.ReadWriteCloser, mycall, gridSquare string) (*TNC, error)
Open opens and initializes an ardop TNC.
func (*TNC) BeaconEvery ¶
BeaconEvery starts a goroutine that sends an ID frame (SendID) at the regular interval d
The gorutine will be closed on Close() or if d equals 0.
func (*TNC) Disconnect ¶
Disconnect gracefully disconnects the active connection or cancels an ongoing connect.
The method will block until the TNC is disconnected.
If the TNC is not connecting/connected, Disconnect is a noop.
func (*TNC) GridSquare ¶
Returns the grid square as reported by the TNC
func (*TNC) Heard ¶
Heard returns all stations heard by the TNC since it was opened.
The returned map is a map from callsign to last time the station was heard.
func (*TNC) ListenEnabled ¶
func (tnc *TNC) ListenEnabled() StateReceiver
ListenState() returns a StateReceiver which can be used to get notification when the TNC state changes.
func (*TNC) NegotiateBandwidth ¶
If negotiate bandwidth flag is set, peer bandwidths other than the ARQBandwidth() are acceptable
func (*TNC) SendID ¶
SendID will send an ID frame
If CWID is enabled the ID frame will be followed by a FSK CW ID.
func (*TNC) SetARQTimeout ¶
Sets the ARQ timeout
func (*TNC) SetAutoBreak ¶
SetAutoBreak Disables/enables automatic link turnover.
func (*TNC) SetAuxiliaryCalls ¶
Sets the auxiliary call signs that the TNC should answer to on incoming connections.
func (*TNC) SetCodec ¶
Enable/disable sound card and other resources
This is done automatically on Open(), users should normally don't do this.
func (*TNC) SetListenEnabled ¶
Enable/disable TNC response to an ARQ connect request.
This is disabled automatically on Open(), and enabled when needed. Users should normally don't do this.
func (*TNC) SetNegotiateBandwidth ¶
Enable or disable bandwidth negotiation
func (*TNC) SetPTT ¶
func (tnc *TNC) SetPTT(ptt transport.PTTController)
Set the PTT that should be controlled by the TNC.
If nil, the PTT request from the TNC is ignored.