Results 1 to 2 of 2

Thread: Permission error while locking the device when writing to QSerialPort

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2016
    Location
    S. Stefano di Sessanio
    Posts
    11
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Permission error while locking the device when writing to QSerialPort

    Hi,
    I'm working on a Qt5.7 application cross-compiled for my device. I added the serialport module to read and write to the serialport.
    After opening the QSerialPort, when I try to write to it, the following error message (attached to the thread) appears in the GUI: "Permission error while locking the device", and the message is not sent to the serial port.
    This is the way I open and try to write to the serial port:

    Qt Code:
    1. serialport->setPortName("/dev/ttymxc2");
    2. serialport->setBaudRate(QSerialPort::Baud9600);
    3. serialport->setDataBits(QSerialPort::Data8);
    4. serialport->setParity(QSerialPort::NoParity);
    5. serialport->setStopBits(QSerialPort::OneStop);
    6. serialport->setFlowControl(QSerialPort::NoFlowControl);
    7. //serial->setFlowControl(QSerialPort::HardwareControl);
    8. if (serialport->open(QIODevice::ReadWrite))
    9. //opened
    To copy to clipboard, switch view to plain text mode 
    ...

    The write section:

    Qt Code:
    1. ba.resize(50);
    2. ...
    3. const qint64 bytesWritten = serialport->write(ba);
    To copy to clipboard, switch view to plain text mode 


    Could anyone help to find the solution? What am I missing?
    Thank you!
    Attached Images Attached Images

Similar Threads

  1. Reading/writing long values to BLE device via Qt
    By WereWind in forum Qt Programming
    Replies: 0
    Last Post: 1st June 2015, 13:49
  2. Replies: 5
    Last Post: 17th April 2015, 07:09
  3. Replies: 5
    Last Post: 15th August 2014, 03:04
  4. Permission denied error during linking
    By bashamehboob in forum Newbie
    Replies: 2
    Last Post: 15th April 2006, 13:02
  5. Reading/Writing data from/to usb device
    By yellowmat in forum Newbie
    Replies: 2
    Last Post: 6th March 2006, 13:08

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.