Hi all,

I'm currently updating a copy of Qextserialport for my own use on a MS Windows based pc. This will be a 'real world' use as I intend to port a big program to Qt that my business uses for race timing that is left running on a pc 24/7 with 3 concurrent serial ports open and data traffic flowing all the time (this program was originally written in Borland Builder 6 C++, by me). Once I'm satisfied that everything functions ok I will post it on this site for everyone to use.

So far I've stripped it down to a pure windows version (no linux - as yet) and ironed out a few bugs. I've added a number of features and am interested in feedback from other users out there that might want other features adding- if there's something not on the following list that might be useful drop me a line !

Note - WinComPort will automatically scan the pc on startup and build a table of all usable com ports, it also supplies text strings of all possible and current settings. The popup dialogue (ShowDialogue) will populate various comboboxes with valid user selections for all settings of the comport.

Features working so far :-

WinComPort(QWidget *parent) ;
~WinComPort(void) ;

void ShowDialogue(void) ; // show user port setup dialog

bool CheckValidPort(int portnum) ; // true if valid port fitted to pc

QString GetPortName(void) ;
int GetPortNumber(void) ;
bool SetPortNumber(int newportnum) ;

int GetBaudRate(void) ;
QString GetBaudRateText(void) ;
void SetBaudRate(int newbaudrate) ;

int GetDataBits(void) ;
QString GetDataBitsText(void) ;
void SetDataBits(int newdatabits) ;

int GetStopBits(void) ;
QString GetStopBitsText(void) ;
void SetStopBits(int newstopbits) ;

int GetParity(void) ;
QString GetParityText(void) ;
void SetParity(int newparity) ;

int GetFlowControl(void) ;
QString GetFlowControlText(void) ;
void SetFlowControl(int newflow) ;

void SetDtr(bool set = true) ;
void SetRts(bool set = true) ;
ulong GetLineStatus(void) ;

void SetTimeout(long newtimeout) ;

ulong GetLastError(void) ;
void TranslateError(ulong error) ;

void CheckComEvents(void) ; // used by seperate thread
void StopComEvents(void) ; // used by seperate thread

// overridden from QIODevice :-

virtual bool open(void) ;
virtual void close(void) ;
virtual void flush(void) ;
virtual bool putChar(char chr) ;
virtual bool getChar(char *chr) ;
virtual qint64 writeData(const char *data, qint64 maxSize) ;
virtual qint64 readData(char *data, qint64 maxSize) ;
virtual qint64 readLine(char * data, qint64 maxSize) ;

virtual qint64 bytesToWrite(void) ;
virtual qint64 bytesAvailable(void) ;

// not relevant for serial comms but included from Qextserialport

virtual bool atEnd(void) ;
virtual void ungetChar(char c) ;
virtual qint64 size(void) ; // not thread safe
virtual bool isSequential(void) ;
virtual bool waitForReadyRead(int msecs);

signals:
void DsrChanged(bool state) ;
void CtsChanged(bool state) ;
void DcdChanged(bool state) ;
void RiChanged(bool state) ;
void SettingsChanged(void) ; // port settings changed in popup user dialog
void readyRead(void) ;


Steve Holmes
(a beginner to Qt maybe - but I started programming in the time of punched cards and tape !)