Home > Back-end >  QT serial communication
QT serial communication

Time:12-19

And serial port communication equipment, assume that a total of 20 different orders, how to implement after sending a if OK to accept data, then send the second and so on, until you send all the data,

CodePudding user response:

You can define an array of instruction, then define a signal and slot function and parameters for the Int said index a sent instructions.

 

QString inst [20]=
{
"Inst1,"
"Inst2,"
.

};

Signals:

Void nextInst (int I);


Slots:

Void Sendslot (int I);

Send (inst [I])

  • Related