17 #include <QtSerialPort/QSerialPort> 18 #include <QtSerialPort/QSerialPortInfo> 35 #define REBOOT_WAIT 2500 50 Q_CLASSINFO(
"className",
"Interface")
57 virtual bool readTheData(
const quint32,
const quint32 bytes = 0U ) = 0;
111 Q_CLASSINFO(
"className",
"InterfaceSP")
115 InterfaceSP(QObject *parent,
const QString & portName );
123 void initSerialPort(
void );
124 void searchAllSerialPort(
void );
125 bool searchSerialPort(
const QString & portName );
126 QStringList availableSerialPorts(
void );
130 bool readTheData(
const quint32 timewait,
const quint32 bytes = 0U );
137 QString getPortName(
void )
const;
138 qint32 getPortBaudRate(
void )
const;
139 QString getDescription(
void )
const;
140 QString getManufacturer(
void )
const;
141 QString getSerialNumber(
void )
const;
142 quint16 getProductIdentifier(
void )
const;
143 QSerialPortInfo getSerialPortInfo(
void )
const;
144 QSerialPort* getSerialPort(
void );
147 void handleReadyRead();
148 void handleTimeout();
149 void handleError( QSerialPort::SerialPortError error );
176 #endif // INTERFACE_H virtual bool openSocket(void)=0
qint64 bytesAvailable
The number of bytes that are in the buffer for reading.
Definition: interface.h:172
void setBlockSize(const quint16 size)
Interface::setBlockSize.
Definition: interface.cpp:64
QTimer * timer
Timer for Time-out method.
Definition: interface.h:80
void debugMessage(const QVariant &message) const
quint16 blockSize
Size of the data block for the communication protocol.
Definition: interface.h:86
qint64 readBufferSize
Definition: interface.h:169
virtual qint64 writeTheData(const QByteArray &)=0
virtual void initSocket(void)=0
QSerialPortInfo serialPortInfo
Definition: interface.h:164
void errorMessage(const QVariant &message) const
quint32 timeout
The timeout interval in milliseconds.
Definition: interface.h:83
void setTimer(QTimer *timer)
Interface::setTimer.
Definition: interface.cpp:104
virtual QIODevice * getSocket(void)=0
Interface The base class Interface provides for the communication between Bootloader Client and Host ...
Definition: interface.h:47
QByteArray & getReceivedData(void)
Interface::getReceivedData.
Definition: interface.cpp:153
QSerialPort * serialPort
Serial Port.
Definition: interface.h:154
quint32 getTimeout(void) const
Interface::getTimeout.
Definition: interface.cpp:141
The class InterfaceSP provides methods to access serial ports.
Definition: interface.h:108
QTimer * getTimer(void)
Interface::getTimer.
Definition: interface.cpp:116
QByteArray receivedData
The received data.
Definition: interface.h:89
virtual void closeSocket(void)=0
void setTimeout(quint32 time)
Interface::setTimeout.
Definition: interface.cpp:129
quint16 getBlockSize(void) const
Interface::getBlockSize.
Definition: interface.cpp:76
void infoMessage(const QVariant &message) const
virtual bool readTheData(const quint32, const quint32 bytes=0U)=0
quint32 getReceivedBytes(void) const
Interface::getReceivedBytes.
Definition: interface.cpp:88
Interface(QObject *parent=0)
Interface::Interface Constructor of the class Interface for creating objects with default values...
Definition: interface.cpp:50