void frame:: framegeneration()
{
static const char mydata[] = {0x0c, 0x14, 0x03, 0x84, 0x78, 0x9c, 0x3b, 0x76,
0xec, 0x18, 0xc3, 0x31, 0x0a, 0xf1};
char i1 = port->write(data.toHex(),data.length());
textEdit->append(data.toHex());
}
void frame:: framegeneration()
{
static const char mydata[] = {0x0c, 0x14, 0x03, 0x84, 0x78, 0x9c, 0x3b, 0x76,
0xec, 0x18, 0xc3, 0x31, 0x0a, 0xf1};
QByteArray data = QByteArray::fromRawData(mydata, sizeof(mydata));
char i1 = port->write(data.toHex(),data.length());
textEdit->append(data.toHex());
}
To copy to clipboard, switch view to plain text mode
setupUi(this);
port = new QextSerialPort("COM1");
port->setBaudRate(BAUD19200);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_2);
setupUi(this);
port = new QextSerialPort("COM1");
port->setBaudRate(BAUD19200);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_2);
port->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
To copy to clipboard, switch view to plain text mode
Bookmarks