FBCommPort Class Reference

#include <fbio.h>
FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort
Inheritance diagram for FBCommPort:
Inheritance graph
[legend]

List of all members.


Detailed Description

Comm port class.

Definition at line 92 of file fbio.h.


Public Member Functions

  FBCommPort ()
  Constructor.
bool  Read (void *lpBuffer, int nNumberOfBytesToRead, int *lpNumberOfBytesRead=NULL)
  Read data from comm port (non-blocking).
bool  ReadBlocking (void *lpBuffer, int nNumberOfBytesToRead, int *lpNumberOfBytesRead=NULL, unsigned long pTimeOut=500)
  Read data from comm port (blocking).
bool  Write (void *lpBuffer, int nNumberOfBytesToWrite, int *lpNumberOfBytesWritten=NULL)
  Write data to comm port (non-blocking).
bool  WriteBlocking (void *lpBuffer, int nNumberOfBytesToWrite, int *lpNumberOfBytesWritten=NULL, unsigned long pTimeOut=500)
  Write data to comm port (blocking).
bool  EmptyBuffer ()
  Empty comm port buffer.

Public Attributes

FBPropertyInt  PortNumber
  Property: Port number.
FBPropertyString  OwnerName
  Property: Owner name.
FBPropertyInt  BaudRate
  Property: Baud rate.
FBPropertyBool  UseHardwareFC
  Property: Use hardware flow control?
FBPropertyParity  Parity
  Property: Parity.
FBPropertyInt  ByteSize
  Property: Byte size.
FBPropertyInt  StopBits
  Property: Stop bits.
FBPropertyRSType  RSType
  Property: Communications protocol (RS232 or RS422)?
FBPropertyCommPortType  CommPortType
  Property: Comm type (physical, virtual or internal)?
FBPropertyBool  Active
  Property: Is comm port active?

Constructor & Destructor Documentation

FBCommPort (  ) 

Constructor.


Member Function Documentation

bool Read ( void *  lpBuffer,
int  nNumberOfBytesToRead,
int *  lpNumberOfBytesRead = NULL  
)

Read data from comm port (non-blocking).

Return values:
lpBuffer  Buffer to fill.
Parameters:
nNumberOfBytesToRead  Number of bytes to read.
Return values:
lpNumberOfBytesRead  Number of bytes actually read (if not at NULL).
Returns:
true if the number of bytes read is equal to the number of bytes to read.

bool ReadBlocking ( void *  lpBuffer,
int  nNumberOfBytesToRead,
int *  lpNumberOfBytesRead = NULL,
unsigned long  pTimeOut = 500  
)

Read data from comm port (blocking).

Return values:
lpBuffer  Buffer to fill.
Parameters:
nNumberOfBytesToRead  Number of bytes to read.
Return values:
lpNumberOfBytesRead  Number of bytes actually read (if not at NULL).
Parameters:
pTimeOut  Timeout for operation.
Returns:
true if the number of bytes read is equal to the number of bytes to read.
Warning:
This operation is blocking!

bool Write ( void *  lpBuffer,
int  nNumberOfBytesToWrite,
int *  lpNumberOfBytesWritten = NULL  
)

Write data to comm port (non-blocking).

Parameters:
lpBuffer  Buffer to write.
nNumberOfBytesToWrite  Number of bytes to write.
Return values:
lpNumberOfBytesWritten  Number of bytes actually written (if not at NULL).
Returns:
true if the number of bytes written is equal to the number of bytes to write.

bool WriteBlocking ( void *  lpBuffer,
int  nNumberOfBytesToWrite,
int *  lpNumberOfBytesWritten = NULL,
unsigned long  pTimeOut = 500  
)

Write data to comm port (blocking).

Parameters:
lpBuffer  Buffer to write.
nNumberOfBytesToWrite  Number of bytes to write.
Return values:
lpNumberOfBytesWritten  Number of bytes actually written (if not at NULL).
Parameters:
pTimeOut  Timeout for operation.
Returns:
true if the number of bytes written is equal to the number of bytes to write.
Warning:
This operation is blocking!

bool EmptyBuffer (  ) 

Empty comm port buffer.

Returns:
true if successful.

Member Data Documentation

FBPropertyInt PortNumber

Property: Port number.

Definition at line 140 of file fbio.h.

FBPropertyString OwnerName

Property: Owner name.

Definition at line 141 of file fbio.h.

FBPropertyInt BaudRate

Property: Baud rate.

Definition at line 142 of file fbio.h.

FBPropertyBool UseHardwareFC

Property: Use hardware flow control?

Definition at line 143 of file fbio.h.

FBPropertyParity Parity

Property: Parity.

Definition at line 145 of file fbio.h.

FBPropertyInt ByteSize

Property: Byte size.

Definition at line 146 of file fbio.h.

FBPropertyInt StopBits

Property: Stop bits.

Definition at line 147 of file fbio.h.

FBPropertyRSType RSType

Property: Communications protocol (RS232 or RS422)?

Definition at line 148 of file fbio.h.

FBPropertyCommPortType CommPortType

Property: Comm type (physical, virtual or internal)?

Definition at line 149 of file fbio.h.

FBPropertyBool Active

Property: Is comm port active?

Definition at line 151 of file fbio.h.


Please send us your comments about this page.