Documentation
¶
Overview ¶
Package cwclient provides a client library for the cwdaemon (https://github.com/acerion/cwdaemon) server application.
The client communicates with the cwdaemon server via UDP using the proprietary protocol defined in the cwdaemon documentation.
To run the cwdaemon locally for testing use the following command line: "cwdaemon -yi -xs -n -d null" This will start the cwdaemon as foreground process listening on port 6789, its output is written to stdout and stderr. To kill the process, hit Ctrl+C.
Index ¶
- Constants
- type Client
- func (client *Client) Abort()
- func (client *Client) BandIndex(bandIndex int)
- func (client *Client) Connect() error
- func (client *Client) Device(device string)
- func (client *Client) Disconnect()
- func (client *Client) IsConnected() bool
- func (client *Client) IsIdle() bool
- func (client *Client) PTT(on bool)
- func (client *Client) PTTDelay(milliseconds int)
- func (client *Client) Reset()
- func (client *Client) SSBSource(source SSBSource)
- func (client *Client) Send(text string)
- func (client *Client) Soundsystem(soundsystem Soundsystem)
- func (client *Client) Speed(speed int)
- func (client *Client) Tone(tone int)
- func (client *Client) ToneOff()
- func (client *Client) Tune(seconds int)
- func (client *Client) Volume(volume int)
- func (client *Client) Wait()
- func (client *Client) Weight(weight int)
- func (client *Client) Wordmode()
- type SSBSource
- type Soundsystem
Constants ¶
const ( SSBFromMicrophone = 0 SSBFromSoundcard = 1 )
The SSB sources supported by the cwdaemon
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the cwdaemon server application.
func New ¶
New creates a new Client for a cwdaemon server running on the given hostname and port. If the hostname is empty, localhost will be used. If the port is 0, the default port 6789 will be used.
func NewDefault ¶
NewDefault returns a Client for a cwdaemon server running on localhost:6789.
func (*Client) Abort ¶
func (client *Client) Abort()
Abort aborts the output of CW and discards all pending texts.
func (*Client) BandIndex ¶
BandIndex outputs the given band index on the pins 2 (lsb), 7, 8, 9 (msb) of the parport.
func (*Client) Disconnect ¶
func (client *Client) Disconnect()
Disconnect closes the connection between the client and the server.
func (*Client) IsConnected ¶
IsConnected indicates if the client has an active connection to the server.
func (*Client) IsIdle ¶
IsIdle returns true if there are no texts waiting on the server for output as CW.
func (*Client) PTTDelay ¶
PTTDelay sets the PTT delay to the given duration in milliseconds [0..50].
func (*Client) Reset ¶
func (client *Client) Reset()
Reset resets the server to the default values: speed = 24 WpM tone = 800 Hz sound = on wordmode = off weight = 0 UDP port = 6789 PTT delay = 0 (off) device = parport0 sound device = console buzzer
func (*Client) SSBSource ¶
SSBSource sets the source for the SSB signal either to microphone or soundcard.
func (*Client) Soundsystem ¶
func (client *Client) Soundsystem(soundsystem Soundsystem)
Soundsystem instructs the cwdaemon to use the given soundsystem
func (*Client) Wait ¶
func (client *Client) Wait()
Wait waits for all pending text to be output as CW.
type Soundsystem ¶
type Soundsystem string
Soundsystem supported by the cwdaemon
const ( PCSpeaker Soundsystem = "c" OSS Soundsystem = "o" ALSA Soundsystem = "a" PulseAudio Soundsystem = "p" None Soundsystem = "n" Soundcard Soundsystem = "s" )
The Soundsystems supported by the cwdaemon