![]() |
stec-platform
|
The Transceiver class interprocess commununication transceiver. More...
#include <transceiver.h>
Public Member Functions | |
Transceiver () | |
Transceiver. | |
void | reset () |
virtual makes blocksize 0 | |
virtual void | userDataPacket (const QVariantList &msg) |
called when there is a complete message received | |
void | bytesReady (QTcpSocket *xm) |
this will throw and exception if error occurs, user can act on the exception or let the system die More... | |
Static Public Member Functions | |
static QByteArray | encode (QVariantList vl, QTcpSocket *xm=nullptr) |
static QVariantList | decode (const QByteArray &txStream) |
The Transceiver class interprocess commununication transceiver.
Used with auto-reconnect Used with stdcom2 nextstep 2 communication
void cyo::Transceiver::bytesReady | ( | QTcpSocket * | xm | ) |
this will throw and exception if error occurs, user can act on the exception or let the system die
do this way incase of MAC coming in
there are 4 cases we need to handle:
Cases 2 we successfully read some data
number of bytes in the message
this is without the initial size
Cases 3 and 4 loop and try to read more data if they are available
Cases 1 just exit the function and wait for more data to come in commitTransaction() will actually rollback if it detects there was an error and return false