C# Class AGENT.Contrib.Hardware.Bluetooth.Connection

Inheritance: IDisposable, IConnection
Show file Open project: nothingmn/AGENT.Contrib

Public Methods

Method Description
Close ( ) : void
Connection ( string port, IChannel channel, int baudRate = 9600, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One ) : System
Dispose ( ) : void
Open ( ) : void
Write ( object data ) : void
_port_DataReceived ( object sender, System.IO.Ports.SerialDataReceivedEventArgs e ) : void

Protected Methods

Method Description
GetBytes ( SerialPort port ) : byte[]

Get a byte[] from the serial port. Will keep reading until the port returns a 0. 0 bytes were read on the port

Private Methods

Method Description
CombineArrays ( byte source, byte destination ) : byte[]

Append source to the end of destination Resize or new up destination if needed. We assume that destination is full, so no need to keep track of the last byte used, just extend and copy source into

Method Details

Close() public method

public Close ( ) : void
return void

Connection() public method

public Connection ( string port, IChannel channel, int baudRate = 9600, Parity parity = Parity.None, int dataBits = 8, StopBits stopBits = StopBits.One ) : System
port string
channel IChannel
baudRate int
parity Parity
dataBits int
stopBits StopBits
return System

Dispose() public method

public Dispose ( ) : void
return void

GetBytes() protected method

Get a byte[] from the serial port. Will keep reading until the port returns a 0. 0 bytes were read on the port
protected GetBytes ( SerialPort port ) : byte[]
port System.IO.Ports.SerialPort
return byte[]

Open() public method

public Open ( ) : void
return void

Write() public method

public Write ( object data ) : void
data object
return void

_port_DataReceived() public method

public _port_DataReceived ( object sender, System.IO.Ports.SerialDataReceivedEventArgs e ) : void
sender object
e System.IO.Ports.SerialDataReceivedEventArgs
return void