Serial Framework C++ Edition
wclSerial Namespace Reference

Classes

class  CwclComDatabase
 The class provides access to the system COM ports database. More...
 
class  CwclCustomSerialMonitor
 The base serial devices monitor class. More...
 
class  CwclSerialClient
 The component represents a Serial Client connection. More...
 
class  CwclSerialMonitor
 The Serial Monitor allows your application to enumerate available serial devices and to monitor changes in its configuration. More...
 
class  CwclUsbMonitor
 The USB Monitor allows your application to enumerate available USB devices and to monitor changes in its configuration. More...
 
class  wclESerial
 The base Serial Framework exceptions class. More...
 
class  wclESerialClient
 The Serial Client exceptions class. More...
 
class  wclESerialMonitor
 The Serial Monitor exceptions class. More...
 
struct  wclSerialConfig
 The structure describes a serial device (COM port) configuration settings that is used to open the COM port. More...
 
struct  wclSerialDevice
 The record contains information about serial device. More...
 
struct  wclSerialFeatures
 Contains communications driver features information. More...
 
struct  wclSerialTimeouts
 Contains the time-out parameters for a communications device. More...
 
struct  wclUsbDevice
 The structure contains information about USB device. More...
 

Typedefs

typedef std::set< wclSerialParity > wclSerialParities
 The set of supported parities.
 
typedef std::set< wclSerialStopBits > wclSerialStopBitsSet
 Set of the number of stop bits to be used.
 
typedef std::set< wclSerialPurgeFlag > wclSerialPurgeFlags
 The set of flags used in PurgeComm method.
 
typedef std::set< wclSerialEvent > wclSerialEvents
 The set of the communication events.
 
typedef std::set< wclSerialError > wclSerialErrors
 Set of serial device errors.
 
typedef std::set< wclSerialCommunicationState > wclSerialCommunicationStates
 The set contains the current communication device state.
 
typedef std::set< wclModemStatus > wclModemStatuses
 The states of the modem control-register values.
 
typedef std::set< wclSerialBaudRate > wclSerialBaudRates
 The serial port baud rates.
 
typedef std::set< wclSerialCapability > wclSerialCapabilities
 The capabilities offered by the serial port.
 
typedef std::set< wclSerialParam > wclSerialParams
 The set of the communications parameters that can be changed.
 
typedef std::set< wclSerialDataSize > wclSerialDataSizes
 The set of number of data bits that can be set.
 
typedef std::list< wclSerialDevice > wclSerialDevices
 The array contains information about found serial devices.
 
typedef std::list< wclUsbDevice > wclUsbDevices
 The array contains list of found USB devices.
 
typedef std::list< unsigned int > wclComPortNumbers
 The list represents a COM port numbers..
 

Enumerations

enum  wclSerialDtrControl { dtrControlDisable , dtrControlEnable , dtrControlHandshake }
 Specifies the DTR (data-terminal-ready) input flow control. More...
 
enum  wclSerialRtsControl { rtsControlDisable , rtsControlEnable , rtsControlHandshake , rtsControlToggle }
 Specifies the RTS (request-to-send) input flow control. More...
 
enum  wclSerialParity {
  spNo , spOdd , spEven , spMark ,
  spSpace
}
 Specifies the parity scheme to be used. More...
 
enum  wclSerialStopBits { sbOne , sbOne5 , sbTwo }
 Specifies the number of stop bits to be used. More...
 
enum  wclSerialPurgeFlag { purgeRxAbort , purgeRxClear , purgeTxAbort , purgeTxClear }
 The flags used in PurgeConmm method. More...
 
enum  wclSerialEscapeFunction {
  escClrBreak , escClrDtr , escClrRts , escSetBreak ,
  escSetDtr , escSetRts , escSetXoff , escSetXon
}
 The extended function to be performed by the EscapeCommFunction method. More...
 
enum  wclSerialEvent {
  evBreak , evCts , evDsr , evRing ,
  evRlsd , evChar
}
 The type of a serial device event. More...
 
enum  wclSerialError {
  erBreak , erFrame , erOverrun , erRxOver ,
  erRxParity
}
 The serial errors. More...
 
enum  wclSerialCommunicationState {
  csCtsHold , csDsrHold , csRlsdHold , csXoffHold ,
  csXoffSent , csEof , csTxim
}
 The enumeration describes state of the serial communication device. More...
 
enum  wclModemStatus { msCtsOn , msDsrOn , msRingOn , msRlsdOn }
 The state of the modem control-register value. More...
 
enum  wclSerialBaudRate {
  br075 , br110 , br134_5 , br150 ,
  br300 , br600 , br1200 , br1800 ,
  br2400 , br4800 , br7200 , br9600 ,
  br14400 , br19200 , br38400 , br56K ,
  br57600 , br115200 , br128K , brUser
}
 The maximum allowable baud rate, in bits per second (bps). More...
 
enum  wclSerialType {
  stFax , stLat , stModem , stNetworkBridge ,
  stParallelPort , stRS232 , stRS422 , stRS423 ,
  stRS449 , stScanner , stTcpIpTelNet , stX25 ,
  stUnspecified
}
 The communications-provider type. More...
 
enum  wclSerialCapability {
  sc16BitMode , scDtrDsr , scIntervalTimeouts , scParityCheck ,
  scRlsd , scRtsCts , scSetXChar , scSpecialChars ,
  scTotalTimeouts , scXOnXoff
}
 The possible serial port capabilities. More...
 
enum  wclSerialParam {
  spBaud , spDataBits , spHandshaking , spParity ,
  spParityCheck , sRlsd , spStopBits
}
 The communications parameters that can be changed. More...
 
enum  wclSerialDataSize {
  sdFive , sdSix , sdSeven , sdEight ,
  sdSixteen , sdWide
}
 The number of data bits that can be set. More...
 

Functions

int wclReadDeviceInformation (const tstring &Instance, wclSerialDevice &Device)
 Helper function that reads serial device information by its Device Instance ID.
 

Variables

const int WCL_E_SERIAL_BASE = 0x00060000
 The base error code for Serial Framework errors.
 
const int WCL_E_SERIAL_UNABLE_OPEN_DEVICE_KEY = WCL_E_SERIAL_BASE + 0x0000
 The device's registry key was not found or not enough privileges.
 
const int WCL_E_SERIAL_UNABLE_READ_FRIENDLY_NAME = WCL_E_SERIAL_BASE + 0x0001
 Unable to read a device's friendly name.
 
const int WCL_E_SERIAL_UNABLE_OPEN_DEVICE_PARAMETERS_KEY = WCL_E_SERIAL_BASE + 0x0002
 The device's parameters registry key was not found or not enough privileges.
 
const int WCL_E_SERIAL_UNABLE_READ_PORT_NAME = WCL_E_SERIAL_BASE + 0x0003
 Unable to read a device's port name.
 
const int WCL_E_SERIAL_DEVICE_CLASS_NOT_FOUND = WCL_E_SERIAL_BASE + 0x0004
 The given Device Class GUID was not found.
 
const int WCL_E_SERIAL_MONITORING_RUNNING = WCL_E_SERIAL_BASE + 0x0005
 Monitoring is running.
 
const int WCL_E_SERIAL_MONITORING_NOT_RUNNING = WCL_E_SERIAL_BASE + 0x0006
 Monitoring is not running.
 
const int WCL_E_SERIAL_UNABLE_GET_READ_BUFFER = WCL_E_SERIAL_BASE + 0x0007
 Unable to get read buffer size.
 
const int WCL_E_SERIAL_UNABLE_GET_WRITE_BUFFER = WCL_E_SERIAL_BASE + 0x0008
 Unable to get write buffer size.
 
const int WCL_E_SERIAL_UNABLE_SET_READ_BUFFER = WCL_E_SERIAL_BASE + 0x0009
 Unable to set read buffer size.
 
const int WCL_E_SERIAL_UNABLE_SET_WRITE_BUFFER = WCL_E_SERIAL_BASE + 0x000A
 Unable to set write buffer size.
 
const int WCL_E_SERIAL_UNABLE_INIT_OVERLAPPED_OPERATION = WCL_E_SERIAL_BASE + 0x000B
 Unable to initialize the overlapped IO operation.
 
const int WCL_E_SERIAL_WRITE_FAILED = WCL_E_SERIAL_BASE + 0x000C
 Write data to the serial port was failed.
 
const int WCL_E_SERIAL_WRITE_TIMEOUT = WCL_E_SERIAL_BASE + 0x000D
 Timeout appeared during write operation. That doe snot mean real error. That just means that some bytes were sent but time out appeared before all bytes are sent. You can retry to send remaining bytes or terminate connection.
 
const int WCL_E_SERIAL_DEVICE_REMOVED = WCL_E_SERIAL_BASE + 0x000E
 A serial device has been removed.
 
const int WCL_E_SERIAL_UNABLE_GET_COMM_CONFIGURATION = WCL_E_SERIAL_BASE + 0x000F
 Unable to read COM port configuration.
 
const int WCL_E_SERIAL_UNABLE_SET_COMM_CONFIGURATION = WCL_E_SERIAL_BASE + 0x0010
 Unable to write COM port configuration.
 
const int WCL_E_SERIAL_UNABLE_GET_COMM_TIMEOUTS = WCL_E_SERIAL_BASE + 0x0011
 Unable to read COM port timeouts.
 
const int WCL_E_SERIAL_UNABLE_SET_COMM_TIMEOUTS = WCL_E_SERIAL_BASE + 0x0012
 Unable to write COM port timeouts.
 
const int WCL_E_SERIAL_UNABLE_CREATE_OVERLAPPED_EVENT = WCL_E_SERIAL_BASE + 0x0013
 Unable create overlapped operation event.
 
const int WCL_E_SERIAL_UNABLE_OPEN_PORT = WCL_E_SERIAL_BASE + 0x0014
 Unable to open the specified COM port.
 
const int WCL_E_SERIAL_UNABLE_GET_COMM_FEATURES = WCL_E_SERIAL_BASE + 0x0015
 COM features read failed.
 
const int WCL_E_SERIAL_UNABLE_SET_EVENTS_MASK = WCL_E_SERIAL_BASE + 0x0016
 Unable to set COM port events mask.
 
const int WCL_E_SERIAL_PURGE_COMM_FAILED = WCL_E_SERIAL_BASE + 0x0017
 The PurgeComm operation was failed.
 
const int WCL_E_SERIAL_ESCAPE_COMM_FUNCTION_FAILED = WCL_E_SERIAL_BASE + 0x0018
 The EscapeCommFunction has been failed.
 
const int WCL_E_SERIAL_SET_COMM_BREAK_FAILED = WCL_E_SERIAL_BASE + 0x0019
 The SetCommBreak method failed.
 
const int WCL_E_SERIAL_CLEAR_COMM_BREAK_FAILED = WCL_E_SERIAL_BASE + 0x001A
 The ClearCommBreak method failed.
 
const int WCL_E_SERIAL_TRANSMIT_COMM_CHAR_FAILED = WCL_E_SERIAL_BASE + 0x001B
 The TransmitCommChar method failed.
 
const int WCL_E_SERIAL_FLUSH_BUFFERS_FAILED = WCL_E_SERIAL_BASE + 0x001C
 The FlushBuffers method failed.
 
const int WCL_E_SERIAL_GET_MODEM_STATUS_FAILED = WCL_E_SERIAL_BASE + 0x001D
 The GetCommStatus method failed.
 
const int WCL_E_SERIAL_READ_ERROR = WCL_E_SERIAL_BASE + 0x001E
 Read operation failed.
 
const int WCL_E_SERIAL_UNABLE_CREATE_RESTART_EVENT = WCL_E_SERIAL_BASE + 0x001F
 Unable create communication restart event.
 
const int WCL_E_SERIAL_DEVICE_WRITE_TIMEOUT = WCL_E_SERIAL_BASE + 0x0020
 Write operation was timed out on wait. Probably device is disconnected or not available.
 
const int WCL_E_SERIAL_CFGMGR_DLL_NOT_FOUND = WCL_E_SERIAL_BASE + 0x0021
 Configuration Manager DLL was not found.
 
const int WCL_E_SERIAL_CFGMGR_NOT_AVAILABLE = WCL_E_SERIAL_BASE + 0x0022
 Required Configuration Manager functions (API) are not available.
 
const int WCL_E_SERIAL_UNABLE_GET_DEVICE_NODE = WCL_E_SERIAL_BASE + 0x0023
 Unable to locate specified device's node.
 
const int WCL_E_SERIAL_DEVICE_INTERFACES_NOT_FOUND = WCL_E_SERIAL_BASE + 0x0024
 No one device's interface was found for specified device's instance ID.
 
const int WCL_E_SERIAL_DEVICE_SWITCH_FAILED = WCL_E_SERIAL_BASE + 0x0025
 Unable to switch (disable or enable) specified USB (serial) devices.
 
const int WCL_E_USB_MONITOR_BASE = WCL_E_SERIAL_BASE + 0x1000
 The base error code for USB monitor errors.
 
const int WCL_E_USB_MONITOR_DEVICE_CLASS_NOT_FOUND = WCL_E_USB_MONITOR_BASE + 0x0000
 No USB devices found on this system.
 
const int WCL_E_COM_DATABASE_BASE = WCL_E_SERIAL_BASE + 0x2000
 The base error code for COM database errors.
 
const int WCL_E_COM_DATABASE_CREATE_MUTEX_FAILED = WCL_E_COM_DATABASE_BASE + 0x0000
 The COM Database API access Mutex creation failed.
 
const int WCL_E_COM_DATABASE_NOT_AVAILABLE = WCL_E_COM_DATABASE_BASE + 0x0001
 The COM Database API is not available.
 
const int WCL_E_COM_DATABASE_NOT_LOADED = WCL_E_COM_DATABASE_BASE + 0x0002
 The COM Database API was not loaded.
 
const int WCL_E_COM_DATABASE_OPENED = WCL_E_COM_DATABASE_BASE + 0x0003
 The COM database is opened.
 
const int WCL_E_COM_DATABASE_CLOSED = WCL_E_COM_DATABASE_BASE + 0x0004
 The COM database is closed.
 
const int WCL_E_COM_DATABASE_ACCESS_DENIED = WCL_E_COM_DATABASE_BASE + 0x0005
 The routine could not open the database.
 
const int WCL_E_COM_DATABASE_UNKNOWN = WCL_E_COM_DATABASE_BASE + 0x0006
 Unknown or undefined error.
 
const int WCL_E_COM_DATABASE_NOT_CONNECTED = WCL_E_COM_DATABASE_BASE + 0x0007
 The method could not access the COM database.
 
const int WCL_E_COM_DATABASE_WRITE_FAILED = WCL_E_COM_DATABASE_BASE + 0x0008
 Write to the COM port database failed.
 
const int WCL_E_COM_DATABASE_HANDLE_INVALID = WCL_E_COM_DATABASE_BASE + 0x0009
 The COM port database handle is not valid.
 
const int WCL_E_COM_DATABASE_FULL = WCL_E_COM_DATABASE_BASE + 0x000A
 The COM port database is full and cannot arbitrate any more port numbers.
 
const int WCL_E_COM_DATABASE_INVALID_PORT = WCL_E_COM_DATABASE_BASE + 0x000B
 The specified port number is not in the COM port database.