C# Class Solar.Car.CanUsbHardware

A customized SerialPort, with support for our BUGGY CAN-USB cable. * asynchronously reads lines from a SerialPort, firing the LineReceived event. * locks the SerialPort for all reading and writing. * drains the SerialPort Read buffer when closing (WARNING this can infinite loop)
Inheritance: ICanUsbHardware
Afficher le fichier Open project: nusolar/sc6-telemetry-code

Méthodes publiques

Méthode Description
CanUsbHardware ( ) : System

Initializes a new instance of the SolarCar.SyncSerialPort class.

Close ( ) : void

Releases the SerialPort and performs other cleanup operations before the SolarCar.SyncSerialPort is reclaimed by garbage collection.

Dispose ( ) : void
LockReadData ( ) : void

Event Handler for this.port's SerialPort.DataReceived event. Acquires the SerialPort, reads data into buffer. It is invoked on a separate thread by SerialPort. Lines terminated by the NewLine character are passed to the LineReceivedDelegate.

LockWriteLine ( string line ) : void

Acquire the SerialPort, and write a line.

Open ( ) : void

Méthodes protégées

Méthode Description
Dispose ( bool disposing ) : void

Method Details

CanUsbHardware() public méthode

Initializes a new instance of the SolarCar.SyncSerialPort class.
public CanUsbHardware ( ) : System
Résultat System

Close() public méthode

Releases the SerialPort and performs other cleanup operations before the SolarCar.SyncSerialPort is reclaimed by garbage collection.
public Close ( ) : void
Résultat void

Dispose() public méthode

public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

LockReadData() public méthode

Event Handler for this.port's SerialPort.DataReceived event. Acquires the SerialPort, reads data into buffer. It is invoked on a separate thread by SerialPort. Lines terminated by the NewLine character are passed to the LineReceivedDelegate.
public LockReadData ( ) : void
Résultat void

LockWriteLine() public méthode

Acquire the SerialPort, and write a line.
public LockWriteLine ( string line ) : void
line string Line.
Résultat void

Open() public méthode

public Open ( ) : void
Résultat void