C# Class ApexLumia.RTTY

Show file Open project: ApexHAB/apex-lumia Class Usage Examples

Public Methods

Method Description
RTTY ( double frequency = 3000, int samplerate = 42000, int baud = 300, int shift = 425, double low = 0.1, double high = 1.0, int stopbits = 2 ) : System

Constructor: Setup RTTY and Sound settings.

Start ( ) : void

Start the sine wave playing.

Stop ( ) : void

Stop the sine wave from playing.

transmitSentence ( string sentence ) : bool

Gets a sentence ready to be transmitted next. If this is called again whilst a sentence is already queued, the queued sentence is overwritten with the new one.

Private Methods

Method Description
BufferNeeded ( object sender, EventArgs e ) : void

Event Handler: Called when a new buffer is needed. Calls updateBuffer() on a new thread.

convertToBits ( string toConvert ) : List

Convert a string to a list of bits (booleans) incl. start bits and stop bits.

updateBuffer ( object o ) : void

Fills the next buffer with a sine wave, amplitude modulated with the data to be transmitted.

Method Details

RTTY() public method

Constructor: Setup RTTY and Sound settings.
public RTTY ( double frequency = 3000, int samplerate = 42000, int baud = 300, int shift = 425, double low = 0.1, double high = 1.0, int stopbits = 2 ) : System
frequency double The frequency of the sine wave.
samplerate int The sample rate of the sound.
baud int The baud rate of the data transmission.
shift int The eventual radio frequency shift in Hz. (Not used)
low double The amplitude for a 'low' bit. 0.0->1.0
high double The amplitude for a 'high' bit. 0.0->1.0
stopbits int The number of stop bits for each byte.
return System

Start() public method

Start the sine wave playing.
public Start ( ) : void
return void

Stop() public method

Stop the sine wave from playing.
public Stop ( ) : void
return void

transmitSentence() public method

Gets a sentence ready to be transmitted next. If this is called again whilst a sentence is already queued, the queued sentence is overwritten with the new one.
public transmitSentence ( string sentence ) : bool
sentence string The string to be transmitted.
return bool