C# 클래스 Serial, UnitySerialPort

상속: UnrealBuildTool.ModuleRules
파일 보기 프로젝트 열기: prossel/UnitySerialPort 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
EnableDebugInfos bool
NotifyData bool
NotifyLines bool
NotifyValues bool
RememberLines int
SkipFirstLine bool
ValuesSeparator char

공개 메소드들

메소드 설명
ClearReceivedBytes ( ) : void

Clears the received bytes. Warning: This prevents line detection and notification. To be used when no \n is expected to avoid keeping unnecessary big amount of data in memory You should normally not call this function if \n are expected.

GetLastLine ( bool keepLines = false ) : string
GetLines ( bool keepLines = false ) : List
OnApplicationQuit ( ) : void
OnDisable ( ) : void
OnEnable ( ) : void
OnGUI ( ) : void
OnValidate ( ) : void
ReadSerialLoop ( ) : IEnumerator
ReadSerialLoopWin ( ) : IEnumerator
SimulateDataReceptionLn ( float data ) : void

Act as if the serial port has received data followed by a new line.

SimulateDataReceptionLn ( string data ) : void

Act as if the serial port has received data followed by a new line.

Start ( ) : void
Update ( ) : void
Write ( string message ) : void

Send data to the serial port.

WriteLn ( string message = "" ) : void

Send data to the serial port and append a new line character (\n)

checkOpen ( int portSpeed = 9600 ) : bool

Verify if the serial port is opened and opens it if necessary

보호된 메소드들

메소드 설명
receivedData ( string data ) : void

비공개 메소드들

메소드 설명
GetPortName ( ) : string

메소드 상세

ClearReceivedBytes() 공개 메소드

Clears the received bytes. Warning: This prevents line detection and notification. To be used when no \n is expected to avoid keeping unnecessary big amount of data in memory You should normally not call this function if \n are expected.
public ClearReceivedBytes ( ) : void
리턴 void

GetLastLine() 공개 메소드

public GetLastLine ( bool keepLines = false ) : string
keepLines bool
리턴 string

GetLines() 공개 메소드

public GetLines ( bool keepLines = false ) : List
keepLines bool
리턴 List

OnApplicationQuit() 공개 메소드

public OnApplicationQuit ( ) : void
리턴 void

OnDisable() 공개 메소드

public OnDisable ( ) : void
리턴 void

OnEnable() 공개 메소드

public OnEnable ( ) : void
리턴 void

OnGUI() 공개 메소드

public OnGUI ( ) : void
리턴 void

OnValidate() 공개 메소드

public OnValidate ( ) : void
리턴 void

ReadSerialLoop() 공개 메소드

public ReadSerialLoop ( ) : IEnumerator
리턴 IEnumerator

ReadSerialLoopWin() 공개 메소드

public ReadSerialLoopWin ( ) : IEnumerator
리턴 IEnumerator

SimulateDataReceptionLn() 공개 메소드

Act as if the serial port has received data followed by a new line.
public SimulateDataReceptionLn ( float data ) : void
data float
리턴 void

SimulateDataReceptionLn() 공개 메소드

Act as if the serial port has received data followed by a new line.
public SimulateDataReceptionLn ( string data ) : void
data string
리턴 void

Start() 공개 메소드

public Start ( ) : void
리턴 void

Update() 공개 메소드

public Update ( ) : void
리턴 void

Write() 공개 정적인 메소드

Send data to the serial port.
public static Write ( string message ) : void
message string
리턴 void

WriteLn() 공개 정적인 메소드

Send data to the serial port and append a new line character (\n)
public static WriteLn ( string message = "" ) : void
message string
리턴 void

checkOpen() 공개 정적인 메소드

Verify if the serial port is opened and opens it if necessary
public static checkOpen ( int portSpeed = 9600 ) : bool
portSpeed int Port speed.
리턴 bool

receivedData() 보호된 메소드

protected receivedData ( string data ) : void
data string
리턴 void

프로퍼티 상세

EnableDebugInfos 공개적으로 프로퍼티

The enable debug infos. The first script with debug infos enabled will enable them until the program stop. Therefore, only one script need to enable the debug info to have them in all app, even with multiple scene and multiple instances, until the program stops.
public bool EnableDebugInfos
리턴 bool

NotifyData 공개적으로 프로퍼티

Enable notification of data as it arrives Sends OnSerialData(string data) message
public bool NotifyData
리턴 bool

NotifyLines 공개적으로 프로퍼티

Enable line detection and notification on received data. Message OnSerialLine(string line) is sent for every received line
public bool NotifyLines
리턴 bool

NotifyValues 공개적으로 프로퍼티

Enable lines detection, values separation and notification. Each line is split with the value separator (TAB by default) Sends Message OnSerialValues(string [] values)
public bool NotifyValues
리턴 bool

RememberLines 공개적으로 프로퍼티

Maximum number of lines to remember. Get them with GetLines() or GetLastLine()
public int RememberLines
리턴 int

SkipFirstLine 공개적으로 프로퍼티

Discard all received data until first line. Do not enable if you do not expect a \n as this would prevent the notification of any line or value. Data notification is not impacted by this parameter.
public bool SkipFirstLine
리턴 bool

ValuesSeparator 공개적으로 프로퍼티

The values separator.
public char ValuesSeparator
리턴 char