PORT Class Reference

#include <mi32/ports.h>

Inheritance diagram for PORT:
Inheritance graph
[legend]

List of all members.

Public Types

enum  STATUS {
  STATUS_OK = 0, STATUS_Error = 0x0008, STATUS_OffLine = 0x0010, STATUS_OutOfPaper = 0x0020,
  STATUS_NotReady = 0x0080, STATUS_TimeOut = 0x0001, STATUS_Abort = 0x8000, STATUS_DiskFull = 0x0100
}
enum  TYPE {
  TYPE_Automatic = 0, TYPE_Parallel = 0x0001, TYPE_Serial = 0x0002, TYPE_File = 0x0008,
  TYPE_Pipe = 0x0080, TYPE_WindowPrinter = 0x0400
}

Public Member Functions

 PORT (const MPORTTYPE *PortType)
 PORT (const char *PortType)
 PORT (TYPE type=TYPE_Automatic)
virtual ~PORT ()
ERRVALUE Flush ()
STATUS GetStatus () const
bool HasDataAvailable () const
ERRVALUE Open (const MISTRING &portname, const char *parameters=0, bool bNonBlocking=false)
void SetParms (const char *)
virtual CAPABILITIES v_GetCapabilities () const
virtual INT64 v_GetSize () const
virtual INT64 v_GetSizeLimit () const
virtual INT32 v_Read (void *buffer, INT32 numbytes, bool AllowPartial)
virtual ERRVALUE v_Resize (INT64 newsize)
virtual INT64 v_Seek (INT64 offset, SEEKFROM from)
virtual INT64 v_Tell () const
virtual ERRVALUE v_Write (const void *buffer, INT32 numbytes)

Public Attributes

const MPORTTYPEm_PortType
MPORTm_priv

Member Enumeration Documentation

Enumerator:
STATUS_OK 
STATUS_Error 
STATUS_OffLine 
STATUS_OutOfPaper 
STATUS_NotReady 
STATUS_TimeOut 
STATUS_Abort 
STATUS_DiskFull 

for files only

enum PORT::TYPE
Enumerator:
TYPE_Automatic 
TYPE_Parallel 

Will determine type based on name.

TYPE_Serial 
TYPE_File 
TYPE_Pipe 

via popen()

TYPE_WindowPrinter 

Windows printer driver.


Constructor & Destructor Documentation

PORT::PORT ( TYPE  type = TYPE_Automatic  ) 

Constructor.

PORT::PORT ( const char *  PortType  ) 

Construct a port given a port type name.

This one is used by SML. Port type names are like "serial_port", "parallel_port", etc. Also used when the port type needs to be stored in an ini file

PORT::PORT ( const MPORTTYPE PortType  ) 

Construct a port given an MPORTTYPE*.

This version will eventually go away. It's just here as a temporary link betweek old code and new code

virtual PORT::~PORT (  )  [virtual]

Member Function Documentation

ERRVALUE PORT::Flush (  ) 
STATUS PORT::GetStatus (  )  const
bool PORT::HasDataAvailable (  )  const

Determine if a serial port has data available Returns false for non-serial ports.

ERRVALUE PORT::Open ( const MISTRING portname,
const char *  parameters = 0,
bool  bNonBlocking = false 
)
void PORT::SetParms ( const char *   ) 
virtual CAPABILITIES PORT::v_GetCapabilities (  )  const [virtual]

Override to get instance capabilities.

Implements GENERICRW.

virtual INT64 PORT::v_GetSize (  )  const [virtual]

Override to get data size.

Implements GENERICRW.

virtual INT64 PORT::v_GetSizeLimit (  )  const [virtual]

Override to get maximum possible data size.

Implements GENERICRW.

virtual INT32 PORT::v_Read ( void *  buffer,
INT32  numbytes,
bool  AllowPartial 
) [virtual]

Override to read data.

Returns:
Number of bytes read (may be less than requested), 0 if no more available at present, -1 if end of data, < -1 if error

Implements GENERICRW.

virtual ERRVALUE PORT::v_Resize ( INT64  newsize  )  [virtual]

Override to resize.

Implements GENERICRW.

virtual INT64 PORT::v_Seek ( INT64  offset,
SEEKFROM  from 
) [virtual]

Override to seek.

Implements GENERICRW.

virtual INT64 PORT::v_Tell (  )  const [virtual]

Override to return current position.

Implements GENERICRW.

virtual ERRVALUE PORT::v_Write ( const void *  buffer,
INT32  numbytes 
) [virtual]

Override to write data.

Implements GENERICRW.


Member Data Documentation


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

Generated on Sun Oct 7 21:33:44 2012 for TNTsdk 2012 by  doxygen 1.6.1