Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QCanBus - List devices?
Forum Updated to NodeBB v4.3 + New Features

QCanBus - List devices?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 1.0k 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.
  • B Offline
    B Offline
    Bremenpl
    wrote on last edited by
    #1

    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
    0
    • K Offline
      K Offline
      kuzulis
      Qt Champions 2020
      wrote on last edited by
      #2

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

      no

      1 Reply Last reply
      0
      • aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @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
        1
        • BuckwheatB Offline
          BuckwheatB Offline
          Buckwheat
          wrote on last edited by
          #4

          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
          1

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved