[solved]I cant receive all data through serial interface



  • I am writing list of commands [around 7 request command ] to the sensor through serial interface using qexserialport library .Once I send these commands I should receive respond from the sensor for each command that I send.

    I put all commands in Qlist to send at once .. But when I run the application and send the button for sending all commands I received only for first three commands !

    @QList<QByteArray> list;
    list << "*cmd1" << "cmd2" << "cmd3"<< "cmd4"<<" cmd5"<<"cmd6"<<"cmd7";

    QByteArray s;
    
    foreach( s, list ){
    port->write(s);
    qDebug() << s;}
    

    @



  • Mm... I'm not sure you are using the right approach.
    Maybe you have to use the official Qt serial library.
    Normally the device responds at all request. I think you have to wait the response at each request and after that send the new one.



  • Thanks after I add delay function ,I received all data requested.
    [quote author="mrdebug" date="1409046424"]Mm... I'm not sure you are using the right approach.
    Maybe you have to use the official Qt serial library.
    Normally the device responds at all request. I think you have to wait the response at each request and after that send the new one.[/quote]


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.