Interface IStreamResource
Represents a serial resource. Implementor - http://en.wikipedia.org/wiki/Bridge_Pattern
Inherited Members
Namespace: NModbus.IO
Assembly: NModbus.dll
Syntax
public interface IStreamResource : IDisposable
Properties
| Improve this Doc View SourceInfiniteTimeout
Indicates that no timeout should occur.
Declaration
int InfiniteTimeout { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ReadTimeout
Gets or sets the number of milliseconds before a timeout occurs when a read operation does not finish.
Declaration
int ReadTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
WriteTimeout
Gets or sets the number of milliseconds before a timeout occurs when a write operation does not finish.
Declaration
int WriteTimeout { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Methods
| Improve this Doc View SourceDiscardInBuffer()
Purges the receive buffer.
Declaration
void DiscardInBuffer()
Read(Byte[], Int32, Int32)
Reads a number of bytes from the input buffer and writes those bytes into a byte array at the specified offset.
Declaration
int Read(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The byte array to write the input to. |
System.Int32 | offset | The offset in the buffer array to begin writing. |
System.Int32 | count | The number of bytes to read. |
Returns
Type | Description |
---|---|
System.Int32 | The number of bytes read. |
Write(Byte[], Int32, Int32)
Writes a specified number of bytes to the port from an output buffer, starting at the specified offset.
Declaration
void Write(byte[] buffer, int offset, int count)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | buffer | The byte array that contains the data to write to the port. |
System.Int32 | offset | The offset in the buffer array to begin writing. |
System.Int32 | count | The number of bytes to write. |