Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Packet Loss when using QtSerialPort

Packet Loss when using QtSerialPort

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 644 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SolarSunrise
    wrote on last edited by
    #1

    I'm making a program that reads a stream of data coming from a serial RN42 bluetooth connection at 250 samples per second (115200 baud) and saving it to a file. When running the code, I've noticed that some of the data were being dropped not and read, thus getting out of sync.

    @SerialMonitor::SerialMonitor(QObject *parent) :
    QObject(parent)
    {

    // Initialization here
    
     DAQ = new QSerialPort(this);
     DAQ->setPortName("/dev/tty.BIOEXG-SPP");
     DAQ->setBaudRate(QSerialPort::Baud115200);
     DAQ->setDataBits(QSerialPort::Data8);
     DAQ->setParity(QSerialPort::NoParity);
     DAQ->setStopBits(QSerialPort::OneStop);
     DAQ->setFlowControl(QSerialPort::NoFlowControl);
    
     if (DAQ->open(QIODevice::ReadOnly)) printf("Success!\n");
     else printf("FAILED...\n");
    
     connect(DAQ, SIGNAL(readyRead()), this, SLOT(WriteToText()));
    

    }

    void SerialMonitor::WriteToText()
    {
    while (DAQ->canReadLine()) {
    QString IncomingData = DAQ->readLine();

        // More processing here
    
    }
    

    }
    }@

    Is there a problem with my code? If not, is there a way around this problem? This is an EEG device thus every single data point is crucial.

    Thanks in advance!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved