Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

BUG in ManageSerialPort.cpp

2009-05-29
2013-04-23
  • FROM ThreadReceive::run()
    -------------------
                     mutexReceive.lock();
                    extSerialPort.read(data, Caracteres); // extSerialPort.read(data, numBytes);

                    data[numBytes]='\0';
                    dataReceived = data;
                    mutexReceive.unlock();
                    emit newData(dataReceived);
    -----------------------
    If device says 05 (for example) then dataReceived.size() == 0.

    Fix:
    mutexReceive.lock();
                    extSerialPort.read(data, Caracteres); // extSerialPort.read(data, numBytes);

                    dataReceived.append(data, numBytes);
                    mutexReceive.unlock();
                    emit newData(dataReceived);

     
    • thank, i fix this error.