Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved QCanBus - List devices?

    General and Desktop
    4
    4
    761
    Loading More Posts
    • 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.
    • B
      Bremenpl last edited by

      Hello there,
      Is there a way to list connected devices using QCanBus class before creating the device? For example I could have an USB PCAN and PCI PCAN devices connected and I would likee to list them and choose which one to use. I would apreciate all help.

      lprzenioslo.zut.edu.pl

      1 Reply Last reply Reply Quote 0
      • K
        kuzulis Qt Champions 2020 last edited by

        Is there a way to list connected devices using QCanBus class before creating the device?

        no

        1 Reply Last reply Reply Quote 0
        • aha_1980
          aha_1980 Lifetime Qt Champion last edited by

          @Bremenpl: I know this thread is quite old, but since Qt 5.9 there is a function that does exactly what you were asking for: https://doc.qt.io/qt-5/qcanbus.html#availableDevices

          Just wanted to mention this and I guess this thread can now be closed.

          Qt has to stay free or it will die.

          1 Reply Last reply Reply Quote 1
          • Buckwheat
            Buckwheat last edited by

            Hi @Bremenpl

            In Qt 5.9 and 5.10 you can list the devices available. For you case, PCAN will list the interfaces as usb0 and pci0 and not give you two different devices. Look at the CANbus example in the SerialBus section. It is a simple little program that does all that for you.

            Dave Fileccia

            1 Reply Last reply Reply Quote 1
            • First post
              Last post