Public Member Functions | Public Attributes

FBCommPort Class Reference

This reference page is linked to from the following overview topics: Utility Classes.


Search for all occurrences

Detailed Description

Comm port class.

Definition at line 92 of file fbio.h.

#include <fbio.h>

Inheritance diagram for FBCommPort:
Inheritance graph
[legend]

List of all members.

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, kULong 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, kULong 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

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,
kULong  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,
kULong  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

Property: Port number.

Definition at line 140 of file fbio.h.

Property: Owner name.

Definition at line 141 of file fbio.h.

Property: Baud rate.

Definition at line 142 of file fbio.h.

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.

Property: Byte size.

Definition at line 146 of file fbio.h.

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.

Property: Is comm port active?

Definition at line 151 of file fbio.h.


The documentation for this class was generated from the following file:

FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort
FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort FBCommPort