Results 1 to 17 of 17

Thread: QSerialPortInfo - Bluetooth SPP devices

  1. #1
    Join Date
    Jan 2016
    Posts
    17
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default QSerialPortInfo - Bluetooth SPP devices

    Hi,

    I am enumerating the available com ports some of which are Bluetooth SPP devices. To be able to check which ones are the ones I am interested in I need to know the Bluetooth 'name'. This does not appear to be possible using QSerialPortInfo.

    If I use Windows Device Manager I can see the Bluetooth port and its properties has the Display Name / Friendly name I am interested in.

    Is there anyway to get the friendly name via QSerialPortInfo? Is there another method?

    Thanks

    Brian

  2. #2
    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: QSerialPortInfo - Bluetooth SPP devices

    Could you please provide an screenshoots?

  3. #3
    Join Date
    Aug 2008
    Posts
    15
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs down Re: QSerialPortInfo - Bluetooth SPP devices

    I am experience that some problem that Windows does not supply all the info , but the same source code produce the more 'correct' information on Linux, this was the same for QT 4.8 and 5.2. Try Linux.

  4. #4
    Join Date
    Jan 2016
    Posts
    17
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QSerialPortInfo - Bluetooth SPP devices

    Hi,

    This is the view from the serial port info data and from the Bluetooth data page. It is the APVision string I am interested in.

    2016-02-17_143651.jpg

    2016-02-17_143636.jpg

    On Windows all I get is COM3 etc

  5. #5
    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: QSerialPortInfo - Bluetooth SPP devices

    I do not understand, what OS is necessary for you? At first you write about Windows... But, next you give screenshots from OS X... What do you want?
    Do you want to see the description/manufacturer strings on Windows, or on OS X, or what?

  6. #6
    Join Date
    Jan 2016
    Posts
    17
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QSerialPortInfo - Bluetooth SPP devices

    Sorry if I was not clear.

    On OS X the Bluetooth name as found on the Bluetooth page is part of the name that serial port info returns. That is good and I can use it to determine which ports are 'mine' and I can ignore the rest.

    On Windows it is not so helpful. The only thing that serial port info returns is COM3 etc. I would like to know what the Bluetooth name is but getting the information via serial port info. Or is there another route to get the Bluetooth name that I can then tie up with the serial port info?

    Windows is where I have the problem.

    Thanks

  7. #7
    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: QSerialPortInfo - Bluetooth SPP devices

    Then, please provide the screenshoot of Devicemanager on your Windows. There are will be like "COM3 standard incoming/outgoing bluetooth port"... for COM3.

  8. #8
    Join Date
    Jan 2016
    Posts
    17
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QSerialPortInfo - Bluetooth SPP devices

    Hi,

    2016-02-17_173507.jpg

    The Bluetooth port I am interested in is AP Vision-BAB1. I know it is Com15 and Com18.

    Qt serial port info tells me description 'Standard Serial over Bluetooth link' portName 'COM18' and systemLocation '\\.\COM18'

    What I want to know is the connection between COM18 and the Bluetooth name. Then I can either discard the port if it is not of interest to me or try to use it if it is.

    Thanks

    Brian

  9. #9
    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: QSerialPortInfo - Bluetooth SPP devices

    I am interested in is AP Vision-BAB1
    On Window, this name is assigned to the BT enumerator only...
    I am not sure that it will be a good idea to take the "BT enumerator
    description" instead of "standard serial port description"...

    UPD: Does returns your "AP Vision-BAB1" by an QSerialPortInfo in the OSX?
    If, yes, then, what is method of QSerialPortInfo returns it (is it description(),
    manufacturer(), product())? because I can not check it at this time on OS X.
    Last edited by kuzulis; 18th February 2016 at 09:16.

  10. #10
    Join Date
    Jan 2016
    Posts
    17
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QSerialPortInfo - Bluetooth SPP devices

    Good Morning,

    On the OS X system this is the info result.

    portName "cu.APVision-BAB1-RNI-SPP"
    description "outgoing port - APVision-BAB1-RNI-SPP"
    systemLocation "/dev/cu.APVision-BAB1-RNI-SPP"

  11. #11
    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: QSerialPortInfo - Bluetooth SPP devices

    It seems there is no universal method to associate the BT device name to the its serial ports, on Windows.

    1) We can enumerate the BT devices, where we can take a device friendly name (like your "AP Vision-BAB1"), and other parameters of device.

    2) We can enumerate the COM ports, where we can take a serial port description (like the "Standard Serial over Bluetooth link") and other parameters of serial port.

    But we can not detect a relationship between 1) and 2) for the unambiguous assignment of the BT friendly name to the related serial port.

  12. #12
    Join Date
    Jan 2016
    Posts
    17
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QSerialPortInfo - Bluetooth SPP devices

    That's the conclusion I reached. Its annoying as this Windows feature is making the connection.

    2016-02-18_160901.jpg

    Presumably it is doing clever stuff in the registry to make the connection.

    Thanks

  13. #13
    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: QSerialPortInfo - Bluetooth SPP devices

    Presumably it is doing clever stuff in the registry to make the connection.
    Maybe there is used a private winapi...
    Maybe you can take the QSerialPort::handle() to use the BT-specific API to get an appropriate bluetooth device name...

  14. #14
    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: QSerialPortInfo - Bluetooth SPP devices

    UPD: Seems, this relationship can be done only for "Outgoing" serial ports..

  15. #15
    Join Date
    Jan 2016
    Posts
    17
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QSerialPortInfo - Bluetooth SPP devices

    Hi,

    Do you have any hints as to how to discover this relationship?

    Thanks

  16. #16
    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: QSerialPortInfo - Bluetooth SPP devices

    Ohhh.. it is not simple:

    1) We need enumerate all BT devices, using SetupApi.

    2) We need store each "FriendlyName" of BT device, and need to parse its BT address and store it too..

    3) We need enumerate all serial ports, using SetupApi

    4) We need parse each "Device Instance Identifier" of each serial port for matching to the same BT address.. Things is that the outgoing BT serial ports contains a BT address inside of own "Device Instance Identifier" string. So, we need to parse this BT address from the string and to compare with each of the BT address of previously saved BT device... When the addresses were equal, then we take the "FriendlyName" from the stored BT device. This "FriendlyName" will be a name of assigned BT device to the serial port. But! This does not work with the "Incoming" serial ports, because its "Device Instance Identifier" string does not contain a BT address!

    PS: Maybe, can be used the winAPI for bluetooth devices, instead of the Registry parsing... But, I am not sure that is is a good idea, because this API is blocking and for other reasons...

    PS2: Also, maybe, you can use the WMI, but this question is out of scope.

  17. #17
    Join Date
    Jan 2016
    Posts
    17
    Thanks
    2
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: QSerialPortInfo - Bluetooth SPP devices

    Thanks for taking the time to look at this. I think I am going to park the issue.

    Thanks.

Similar Threads

  1. Qt5.5 QSerialPortInfo::AvailablePorts returns empty list
    By pilatomic in forum Qt Programming
    Replies: 1
    Last Post: 3rd August 2015, 21:20
  2. trouble with the QSerialPortInfo::availablePorts()
    By xiongxiongchuan in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2014, 09:42
  3. Replies: 3
    Last Post: 7th October 2013, 14:58
  4. QSerialPortInfo Broken
    By RolandHughes in forum Qt Programming
    Replies: 0
    Last Post: 21st June 2013, 15:23
  5. Bluetooth app?
    By danoh in forum Newbie
    Replies: 2
    Last Post: 30th August 2009, 22:48

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.