This class represents the RS232 which allows sending and receiving data over a RS232 port.
Public Member Functions | |
void | ConfigureBaudRate (const UInt32 BaudRate) |
Configures the baud rate. More... | |
void | ReadNByte (const UInt32 BytesToRead, UInt32 % BytesIn, array< Byte >^ pData, const UInt32 msTimeout) |
Reads the specified number of characters. More... | |
RS232 () | |
Default constructor for the device object More... | |
void | WriteNByte (const UInt32 BytesToWrite, array< Byte >^ pData) |
Sends the given number of bytes. More... | |
Public Member Functions inherited from VIB_NET::iDevice | |
void | Close () |
Closes a device More... | |
bool | isOpen () |
Returns the open state of a device object More... | |
void | Open () |
Opens a device More... | |
void | Open (unsigned int Index) |
Opens a device More... | |
Properties | |
UInt32 | NumberOfBytesAvailable [get] |
Contains the number of valid characters within the receive buffer. More... | |
virtual VIB_NET::eDEVICE_TYPE | Type [get] |
Returns the device type for the current instance, see eDEVICE_TYPE More... | |
Properties inherited from VIB_NET::iDevice | |
virtual VIB_NET::eDEVICE_TYPE | Type [get] |
Returns the device type for the current instance, see eDEVICE_TYPE More... | |
VIB_NET::RS232::RS232 | ( | ) |
Default constructor for the device object
The device must be opened with Open() before it can be used.
void VIB_NET::RS232::ConfigureBaudRate | ( | const UInt32 | BaudRate | ) |
Configures the baud rate.
Must be called before the user can send or receive data.
BaudRate | the desired speed, from 9600 to 921600 |
void VIB_NET::RS232::ReadNByte | ( | const UInt32 | BytesToRead, |
UInt32 % | BytesIn, | ||
array< Byte >^ | pData, | ||
const UInt32 | msTimeout | ||
) |
Reads the specified number of characters.
The function waits until all the desired bytes are received, or until the specified timeout expires. The function returns successfully, if at least one byte was received.
BytesToRead | Number of bytes to copy to pData buffer |
BytesIn | Number of valid bytes returned |
pData | Buffer for storing the received bytes |
msTimeout | TimeOut in milliseconds, 0 ... INFINITE |
void VIB_NET::RS232::WriteNByte | ( | const UInt32 | BytesToWrite, |
array< Byte >^ | pData | ||
) |
Sends the given number of bytes.
The functions doesn't wait not for completion of the transmit operation.
BytesToWrite | Number of Bytes to send |
pData | Pointer to the data |
|
get |
Contains the number of valid characters within the receive buffer.
It contains the number of bytes that can be read with ReadNByte() without blocking
|
get |
Returns the device type for the current instance, see eDEVICE_TYPE