Documentation ¶
Overview ¶
Package winmor provides means of establishing a connection to a remote node using WINMOR TNC
Index ¶
- Constants
- Variables
- type Addr
- type Command
- type State
- type StateReceiver
- type TNC
- func (tnc *TNC) Busy() bool
- 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) DirtyDisconnect() 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(bandwidth int) (ln net.Listener, err error)
- func (tnc *TNC) ListenEnabled() StateReceiver
- func (tnc *TNC) MyCall() (string, error)
- func (tnc *TNC) Ping() error
- func (tnc *TNC) SetAuxiliaryCalls(calls []string) (err error)
- func (tnc *TNC) SetCodec(state bool) error
- func (tnc *TNC) SetDriveLevel(l int) error
- func (tnc *TNC) SetGridSquare(gs string) error
- func (tnc *TNC) SetListenEnabled(listen bool) error
- func (tnc *TNC) SetMaxConnReq(n int) error
- func (tnc *TNC) SetMycall(mycall string) error
- func (tnc *TNC) SetPTT(ptt transport.PTTController)
- func (tnc *TNC) SetResponseDelay(ms int) error
- func (tnc *TNC) SetRobust(robust bool) error
- func (tnc *TNC) State() State
- func (tnc *TNC) Version() (string, error)
Constants ¶
const ( BufferInQueued = iota BufferInSequenced BufferOutQueued BufferOutConfirmed BufferAvgThroughput )
Buffer slice index
"BUFFERS <in queued> <in sequenced> <out queued> <out confirmed> <1m avg throughput in bytes/minute>"
const DefaultAddr = "localhost:8500"
The default address Winmor TNC listens on
Variables ¶
var ( ErrInvalidBandwidth error = errors.New("Invalid bandwidth. Supported values are 500 or 1600.") ErrActiveListenerExists error = errors.New("An active listener is already registered with this TNC.") )
var ( ErrBusy = errors.New("TNC control port is busy.") ErrConnectInProgress = errors.New("A connect is in progress.") )
var ( ErrConnectTimeout = errors.New("Connect timeout") ErrInvalidAddr = errors.New("Invalid address format") )
Functions ¶
This section is empty.
Types ¶
type State ¶
type State uint8
const ( Unknown State = iota Offline // Sound card disabled and all sound card resources are released Disconnected // The session is disconnected, the sound card remains active Connecting // The station is sending Connect Requests to a target station ConnectPending // A connect request frame was sensed and a connection is pending and capture/decoding is in process SendID // Sending ID ISS // Information Sending Station (Sending Data) IRS // Information Receiving Station (Receiving data) IRSToISS // Transition state from IRS to ISS to insure proper link turnover IRSModeShift // Supplying Packets Sequenced information to the ISS for a requested mode shift ISSModeShift // Requesting Packets Sequenced information from the IRS in preparation for a mode shift FECReceive // Receiving FEC (unproto) data FEC500 // Sending FEC data 500Hz bandwidth FEC1600 // Sending FEC data 1600Hz bandwidth )
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 (*TNC) Close ¶
Closes the connection to the TNC (and any on-going connections).
This will not actually close the TNC software.
func (*TNC) DialURL ¶ added in v0.7.0
DialURL dials winmor:// URLs
Syntax: winmor://mycall@/targetcall (mycall part is optional)
func (*TNC) DirtyDisconnect ¶
DirtyDisconnect will send a dirty disconnect command to the TNC.
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.
It returns a map from callsign to last time it was heard. Each call returns a new copy of the latest map.
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) 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) SetDriveLevel ¶ added in v0.7.0
Set the TX audio drive level
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) SetMaxConnReq ¶
Set the number of connect requests before giving up.
Allowed values are 3-15
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.