23 #define TCP_PORT_NAME "TCP_PORT_6000" 39 std::list<CString> &aList
44 const CString& aPortName
49 const CString& aPortName
62 virtual bool isOpen()
const;
75 std::list<CString> &aList
80 std::list<CString> &aList
87 const CString& aOperation
Physical layer implementation for a serial port.
Abstract base class for the physical layer.
virtual bool setBaudRate(uint32 aBaudRate)
Set the baud rate.
void recordErrorText(const CString &aOperation)
Store a textual description of the last error that occurred.
CString mPortName
Display name of the serial port being used for communication.
virtual void close()
Close the COM port if one is in use.
static bool initSerialPort(const CString &aPortName)
Initializes the port passed in.
static void getPortListEnum(std::list< CString > &aList)
Find the COM ports on the system by opening each in turn.
virtual uint32 getBaudRate() const
Return the last successfully applied baud rate .
static SerialPort * sInstance
The one and only instance of this object.
HANDLE mComPortHandle
File handle for the com port that is open, or INVALID_HANDLE_VALUE if the port is not open...
static bool getPortListFromRegistry(std::list< CString > &aList)
Get the list of com ports on the system by enumerating the device map in the Windows registry...
virtual const CString & getPortName() const
Get the name of the serial port that is open.
SerialPort()
Construct the SerialPort.
Abstract base class for link Layers in the OSI model.
bool init(const CString &aPortName)
Initializes the port passed in.
virtual bool tx(uint8 *aData, uint16 aSize)
Transmit bytes on the serial port.
virtual ~SerialPort()
Destructor. Close the serial port.
const CString & getLastError() const
Return a description of the last error that occurred.
BOOL mHandleInitialized
If TRUE, mComPortHandle is initialized.
static SerialPort * getInstance()
Get the one and only serial port object.
static void getPortList(std::list< CString > &aList)
Get the list of serial ports.
unsigned short int uint16
16-bit unsigned integer
Abstract base class for objects that need to do something periodically.
unsigned char uint8
8-bit unsigned integer
CString mLastErrorText
String containing the last communication error.
virtual bool isOpen() const
Indicate whether the port is open.
virtual void pumpRx()
Receive and process any data.
unsigned long int uint32
32-bit unsigned integer
void onTimer()
Timer callback.
Physical layer implementation for a serial port.
uint32 mBaudRate
The last successfully applied baud rate.
static void destroyInstance()
Destroy the one and only serial port object.