Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. QExtSerialPort: How to determine if a serial port is in use by another application?
Forum Updated to NodeBB v4.3 + New Features

QExtSerialPort: How to determine if a serial port is in use by another application?

Scheduled Pinned Locked Moved 3rd Party Software
11 Posts 5 Posters 6.2k 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.
  • M Offline
    M Offline
    mcosta
    wrote on last edited by
    #2

    Hi,

    generally speaking Qt and QExtSerialPort use Guest Operating System services to access to the hardware.
    To obtain what do you wantn on MacOSX probabli you should use Apple API.

    Once your problem is solved don't forget to:

    • Mark the thread as SOLVED using the Topic Tool menu
    • Vote up the answer(s) that helped you to solve the issue

    You can embed images using (http://imgur.com/) or (http://postimage.org/)

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by
      #3

      QextSerialPort used POSIX API. But the design of the library is not incorporated this possibility.

      For a solution of problem is need to use other library as QtSerialPort.

      PS:

      And indeed, to be honest it's very slippery POSIX solution, because not all applications adhere to the standards for locking already open serial ports. Therefore, if a some program opens a port, but did not set a "lock" (as TIOEXCL or using the lock file), then you are in any way you not will know that the device is already being used by someone.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        maikel
        wrote on last edited by
        #4

        [quote author="kuzulis" date="1367927829"]
        And indeed, to be honest it's very slippery POSIX solution, because not all applications adhere to the standards for locking already open serial ports. Therefore, if a some program opens a port, but did not set a "lock" (as TIOEXCL or using the lock file), then you are in any way you not will know that the device is already being used by someone.
        [/quote]

        That would be OK. I only need a lock for my own application, because the user can start several instances of my application to connect to all attached serial devices. If a port is locked by another instance, then the new instance has to search on the next available port.
        Do you know how to set a lock and how to release it? If the application crashes then the lock must also be released. I do not really know much about POSIX standards, lock files and such things.

        Thanks

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kuzulis
          Qt Champions 2020
          wrote on last edited by
          #5

          See e.g. http://linux.die.net/man/3/lockdev

          1 Reply Last reply
          0
          • N Offline
            N Offline
            NvrGvUp
            wrote on last edited by
            #6

            hi to all

            IT IS POSSIBLE TO CONNECT QSOCKETDEVICE INTO BIOMETRICS DIRECTLY!

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #7

              Hi,

              Please, don't highjack someone's thread with your own question, create a new thread, and for politeness don't use all caps phrase, this won't get you any help.

              Additionally, you'll have to give more details about what you wan't to do.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • N Offline
                N Offline
                NvrGvUp
                wrote on last edited by
                #8

                hi SGaist,

                Why QT 4.8 is not compatible to QT 5.0.,i am creating a payroll system QT 4.8 but i tried to run Qt 5.0 but not working. I'm put the dialog header QT 4.8 still working otherwise i tried to put dialog header QT 5.0 is not working.

                thanks

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  As I said, please, open a new thread for your problem and provide more details about your problem. I won't answer on this thread about them.

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    maikel
                    wrote on last edited by
                    #10

                    [quote author="kuzulis" date="1367939084"]See e.g. http://linux.die.net/man/3/lockdev[/quote]

                    Many Thanks for this hint!

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      maikel
                      wrote on last edited by
                      #11

                      I found an easier solution. Just append O_EXLOCK into the open_sys() function in qextserialport_unix.cpp

                      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