Metratec devices library 3.1.1.0
|
The common interface definition for different hardware communication options. More...
Public Member Functions | |
void | Connect () |
The method to connect the communication interface. | |
void | Disconnect () |
The method to close the communication interface. | |
void | Send (byte[] data, int offset, int count) |
Method to write a byte-array to the device (e.g. a binary file) | |
void | Send (byte[] data) |
Method to write a byte-array to the device (e.g. a binary file) | |
void | Send (string data) |
Method to write a string to the device. | |
void | SendCommand (string command) |
The method used to send a command to the reader. | |
byte[] | Read (int count) |
Method to read a stream of bytes from device. | |
string | ReadResponse () |
The method used to synchronously read a reader response. | |
Properties | |
int | ReceiveTimeout [get, set] |
The communication receive timeout. | |
int | BaudRate [get, set] |
The communication baud rate. | |
string | NewlineString [get, set] |
The communication new line string. | |
bool | DataAvailable [get] |
Indicates whether data is available for reading. | |
bool | IsConnected [get] |
Connection flag. | |
The common interface definition for different hardware communication options.
void CommunicationInterfaces.ICommunicationInterface.Connect | ( | ) |
The method to connect the communication interface.
T:System.InvalidOperationException | Thrown when the serial port could not be set up (e.g. wrong parameters, insufficient permissions, invalid port state). |
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.
void CommunicationInterfaces.ICommunicationInterface.Disconnect | ( | ) |
The method to close the communication interface.
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.
byte[] CommunicationInterfaces.ICommunicationInterface.Read | ( | int | count | ) |
Method to read a stream of bytes from device.
count | Number of bytes to read |
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.
string CommunicationInterfaces.ICommunicationInterface.ReadResponse | ( | ) |
The method used to synchronously read a reader response.
T:System.TimeoutException | Thrown when no answer is received for more than 400ms. |
T:System.ObjectDisposedException | Thrown when the underlying function reports a broken stream |
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.
void CommunicationInterfaces.ICommunicationInterface.Send | ( | byte[] | data | ) |
Method to write a byte-array to the device (e.g. a binary file)
data | The overall byte-array of data |
void CommunicationInterfaces.ICommunicationInterface.Send | ( | byte[] | data, |
int | offset, | ||
int | count | ||
) |
Method to write a byte-array to the device (e.g. a binary file)
data | The overall byte-array of data |
offset | The starting address in the array |
count | The number of characters to write |
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.
void CommunicationInterfaces.ICommunicationInterface.Send | ( | string | data | ) |
Method to write a string to the device.
data | The overall byte-array of data |
void CommunicationInterfaces.ICommunicationInterface.SendCommand | ( | string | command | ) |
The method used to send a command to the reader.
command | The data / command sent to the reader |
T:System.ArgumentNullException | Thrown when the specified command is null . |
T:System.InvalidOperationException | Thrown when an exception occurs when trying to access the port (e.g. port closed, timeout). |
T:System.ObjectDisposedException | Thrown when the underlying function reports a broken stream |
Implemented in CommunicationInterfaces.SerialInterface, and CommunicationInterfaces.EthernetInterface.
|
getset |
The communication baud rate.
T:System.InvalidOperationException | Thrown in case baud rate setting did not work |
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.
|
get |
Indicates whether data is available for reading.
T:System.ObjectDisposedException | Thrown when the underlying function reports a broken stream |
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.
|
get |
Connection flag.
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.
|
getset |
The communication new line string.
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.
|
getset |
The communication receive timeout.
T:System.InvalidOperationException | Thrown in case baud rate setting did not work |
Implemented in CommunicationInterfaces.EthernetInterface, and CommunicationInterfaces.SerialInterface.