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

Inheritance: IDisposable, IConnection
Afficher le fichier Open project: nothingmn/AGENT.Contrib

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode 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 méthode

public Close ( ) : void
Résultat void

Connection() public méthode

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
Résultat System

Dispose() public méthode

public Dispose ( ) : void
Résultat void

GetBytes() protected méthode

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
Résultat byte[]

Open() public méthode

public Open ( ) : void
Résultat void

Write() public méthode

public Write ( object data ) : void
data object
Résultat void

_port_DataReceived() public méthode

public _port_DataReceived ( object sender, System.IO.Ports.SerialDataReceivedEventArgs e ) : void
sender object
e System.IO.Ports.SerialDataReceivedEventArgs
Résultat void