Свойство | Type | Description | |
---|---|---|---|
Encoding | |||
NewLine | string |
Свойство | Type | Description | |
---|---|---|---|
_bufferSync | object | ||
_continueReading | bool | ||
_incomingBuffer | byte[] | ||
_incomingBufferPosition | int | ||
_incomingBufferValidLength | int | ||
_readBufferSize | int | ||
_readThread | Thread | ||
_readToEvent | |||
_writeBufferSize | int | ||
_writeThread | Thread |
Méthode | Description | |
---|---|---|
Flush ( ) : void | ||
Read ( byte buffer, int offset, int count ) : int |
Reads data from a serial port.
|
|
ReadAvailable ( ) : byte[] |
Reads all available bytes and removes them from the reading buffer.
|
|
ReadAvailable ( int maxCount ) : byte[] |
Reads desired number of bytes and removes them from the reading buffer.
|
|
ReadLine ( ) : string |
Reads data from a serial port up to the NewLine value and decodes them as string using Encoding. This method does not return until NewLine sequence is received. |
|
SerialPortBase ( ) : System | ||
SerialPortBase ( int writeBufferSize, int readBufferSize ) : System | ||
Write ( ) : void |
Writes data to a serial port. The method does not return until all data are sent, including output buffer pauses and/or hardware flow control pauses, if applicable. |
|
Write ( byte data, int offset, int length ) : void |
Writes data to a serial port. The method does not return until all data is sent, including output buffer pauses and/or hardware flow control pauses, if applicable. |
|
Write ( string text ) : void |
Encodes string data using Encoding and sends them to a serial port. The method does not return until all data are sent, including output buffer pauses and/or hardware flow control pauses, if applicable. |
|
WriteLine ( string text ) : void |
Appends NewLine to the string, encodes it using Encoding and sends it to a serial port. The method does not return until all data are sent, including output buffer pauses and/or hardware flow control pauses, if applicable. |
Méthode | Description | |
---|---|---|
AdvancePosition ( int count ) : void |
Advances the internal circular read bufer position by specified amount and updates the valid length field accordingly.
|
|
BufferIndexOf ( byte what ) : int |
Searches the internal circular read buffer for sequence of bytes.
|
|
GetBufferedData ( int arraySize ) : byte[] |
Returns specified amount of data from internal circular read buffer. If there is not enough data available, remaining bytes are filled with zeros.
|
|
GetBufferedData ( byte buffer, int offset, int count ) : int |
Copies specified amount of data from internal circular read buffer to the specified linear buffer.
|
|
OnBusyChanged ( bool busy ) : void | ||
OnDataReceived ( byte data, int validLength ) : void |
Adds the received data into internal circular read buffer and fires DataReceived event.
|
|
ReadDirect ( byte data, int offset, int length ) : int | ||
ReadLoop ( ) : void | ||
StartReading ( ) : void |
Starts waiting for data in order to fire DataReceived event.
|
|
StopReading ( ) : void |
Stops waiting for data.
|
|
WriteDirect ( byte data, int offset, int length ) : int |
Méthode | Description | |
---|---|---|
ReadTo ( ) : byte[] |
protected AdvancePosition ( int count ) : void | ||
count | int | The number of bytes to move forward. |
Résultat | void |
protected BufferIndexOf ( byte what ) : int | ||
what | byte | The sequence to look for. |
Résultat | int |
protected GetBufferedData ( int arraySize ) : byte[] | ||
arraySize | int | The number of bytes to return. |
Résultat | byte[] |
protected GetBufferedData ( byte buffer, int offset, int count ) : int | ||
buffer | byte | The linear buffer that stores the data read from the internal read buffer. |
offset | int | The offset value that indicates where writing to the linear buffer from the internal read buffer is to begin. |
count | int | The number of bytes of data to be copied. |
Résultat | int |
protected OnBusyChanged ( bool busy ) : void | ||
busy | bool | |
Résultat | void |
protected OnDataReceived ( byte data, int validLength ) : void | ||
data | byte | An array with data received. |
validLength | int | Number of valid bytes in the array. |
Résultat | void |
public Read ( byte buffer, int offset, int count ) : int | ||
buffer | byte | The output buffer that stores the data read from the serial port. |
offset | int | The offset value that indicates where writing to the output buffer from the serial port is to begin. |
count | int | The number of bytes of data to be read. |
Résultat | int |
public ReadAvailable ( int maxCount ) : byte[] | ||
maxCount | int | The maximum count of bytes to return. |
Résultat | byte[] |
protected abstract ReadDirect ( byte data, int offset, int length ) : int | ||
data | byte | |
offset | int | |
length | int | |
Résultat | int |
public SerialPortBase ( int writeBufferSize, int readBufferSize ) : System | ||
writeBufferSize | int | |
readBufferSize | int | |
Résultat | System |
public Write ( byte data, int offset, int length ) : void | ||
data | byte | The input buffer that is to write to the serial port. |
offset | int | The offset value that indicates where writing from the input buffer to the serial port is to begin. |
length | int | The number of bytes of data to be written to the serial port. |
Résultat | void |
public Write ( string text ) : void | ||
text | string | String data to send. |
Résultat | void |
protected abstract WriteDirect ( byte data, int offset, int length ) : int | ||
data | byte | |
offset | int | |
length | int | |
Résultat | int |
public WriteLine ( string text ) : void | ||
text | string | String data to send. |
Résultat | void |
protected int _incomingBufferValidLength | ||
Résultat | int |
protected AutoResetEvent,System.Threading _readToEvent | ||
Résultat |