Results 1 to 5 of 5

Thread: Detecting Serial port events on specific lines

  1. #1
    Join Date
    Sep 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Detecting Serial port events on specific lines

    Hi,

    I'd like to be able to be notified on hi / lo signal changes on serial lines such as the RING, DCD, CTS line.

    In this case it's for detecting a time synchronization pulse.

    Is this possible with QSerialPort somehow?


    Thanks

    Jamie

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Detecting Serial port events on specific lines

    You have access to the status of these lines through the QSerialPort::pinoutSignals() method. However, except for DTR and RTS, there are no signals emitted when these lines change level. You might be able to look into the implementation of QSerialPort where DTR and RTS are handled to see if at that low level there is access to these lines. If so, you may be able to derive a class from QSerialPort and add level change signals for the lines you are interested in. The assumption here is that if pinoutSignals() can tell you the status of those lines, then somewhere in the internals it must be reading them and maybe responding to changes.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Detecting Serial port events on specific lines

    It is impossible with QSerialPort.

  4. #4
    Join Date
    Sep 2013
    Posts
    4
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Detecting Serial port events on specific lines

    Thanks for the replies.

    I did look through the source code and could only calls that emitted the DTR and RTS notifier signals as responses to changes made on the application side rather than actual system events.

    I think I'll try and use winAPI to do it.

    Thanks

  5. #5
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Detecting Serial port events on specific lines

    I think I'll try and use winAPI to do it.
    I figured you'd end up having to dip into system calls. QSerialPort is too high-level and abstract.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. issue in detecting swipe events
    By psioka in forum Qt Programming
    Replies: 0
    Last Post: 26th July 2016, 16:10
  2. 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
  3. Detecting tooltip events of external application...
    By siraj in forum Qt Programming
    Replies: 1
    Last Post: 23rd April 2014, 10:05
  4. USB Win Events messages Detecting in QT
    By AlphaWolfXV in forum Qt Programming
    Replies: 3
    Last Post: 16th August 2013, 14:33
  5. Options for detecting if https (port 443) is blocked
    By Berryblue031 in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2011, 08:16

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.