Results 1 to 2 of 2

Thread: Get Serial Port signal From Device in ubuntu

  1. #1
    Join Date
    Dec 2016
    Posts
    1
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Question Get Serial Port signal From Device in ubuntu

    How to Get Data from external device. device connected via serial port..
    i want read device passing value ..
    am try to code here
    Qt Code:
    1. ui->setupUi(this);
    2. serial.setPortName("/dev/ttyS0");
    3. serial.setBaudRate(QSerialPort::Baud9600);
    4. serial.setDataBits(QSerialPort::Data8);
    5. serial.setParity(QSerialPort::NoParity);
    6. serial.setStopBits(QSerialPort::OneStop);
    7. serial.setFlowControl(QSerialPort::NoFlowControl);
    8. serial.open(QIODevice::ReadWrite);
    To copy to clipboard, switch view to plain text mode 


    after how to ready port value

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Get Serial Port signal From Device in ubuntu

    Since it appears your serial class is a QIODevice then you can use any of the reading methods.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. Serial read misses to read data from the serial port
    By mania in forum Qt for Embedded and Mobile
    Replies: 11
    Last Post: 18th August 2014, 08:49
  2. qt serial port
    By saman_artorious in forum Newbie
    Replies: 9
    Last Post: 24th April 2013, 16:19
  3. Serial Port communication
    By mgurbuz in forum Qt Programming
    Replies: 12
    Last Post: 22nd January 2011, 02:38
  4. serial port issues
    By jhowland in forum Qt Programming
    Replies: 7
    Last Post: 12th January 2009, 13:38
  5. Serial Port
    By b1 in forum Qt Programming
    Replies: 2
    Last Post: 18th January 2007, 02:05

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.