C# 클래스 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)
상속: ICanUsbHardware
파일 보기 프로젝트 열기: nusolar/sc6-telemetry-code

공개 메소드들

메소드 설명
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

보호된 메소드들

메소드 설명
Dispose ( bool disposing ) : void

메소드 상세

CanUsbHardware() 공개 메소드

Initializes a new instance of the SolarCar.SyncSerialPort class.
public CanUsbHardware ( ) : System
리턴 System

Close() 공개 메소드

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

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

Dispose() 보호된 메소드

protected Dispose ( bool disposing ) : void
disposing bool
리턴 void

LockReadData() 공개 메소드

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
리턴 void

LockWriteLine() 공개 메소드

Acquire the SerialPort, and write a line.
public LockWriteLine ( string line ) : void
line string Line.
리턴 void

Open() 공개 메소드

public Open ( ) : void
리턴 void