Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2474

Scanning for BLE devices reports also classic bluetooch devices on MacOs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2: Important P2: Important
    • 6.7.0
    • 6.2.2
    • PySide
    • PySide6.2.2, Shiboken6.2.2, PyCharm 2022.3.3 (Community Edition), Python 3.9.7
    • macOS

      Hi all,

      Scanning for BLE devices on MacOs seems to have issues! I detect classic bluetooth devices along with LE devices.

      I am using the following code to scan:

      self.__discovery_agent: QBluetoothDeviceDiscoveryAgent = QBluetoothDeviceDiscoveryAgent()
      self._discovery_agent.deviceDiscovered.connect(self._discovery_agent_device_discovered_handler)
      self._discovery_agent.finished.connect(self._discovery_agent_scan_finished_handler)
      self.__discovery_agent.DiscoveryMethod = QBluetoothDeviceDiscoveryAgent.LowEnergyMethod
      self.__discovery_agent.setLowEnergyDiscoveryTimeout(timeout)
      self.__discovery_agent.start()

      I have an assumption that the following line of code should limit the scanning to BLE devices:

      self.__discovery_agent.DiscoveryMethod = QBluetoothDeviceDiscoveryAgent.LowEnergyMethod 

      This code works pretty fine on WindowsOS.

      I see the following traces during scanning phase:

      2023-09-26 09:27:08.937 Python[85263:5125034] [IOBluetoothDeviceInquiry initWithDelegate:]   0x600002c2d320qt.bluetooth.darwin: IOKit error code: 1
      qt.bluetooth.darwin: IOKit error code: 1
      qt.bluetooth.darwin: IOKit error code: 1
      qt.bluetooth.darwin: IOKit error code: 1qt.bluetooth.darwin: Manually interrupting IOBluetoothDeviceInquiry

      Please note that I've communicated with Qt C++ devs. and they replied that 
      a C++-based code on MacOS does not detect classic bluetooth devices.
      For more informatoin; Please see https://bugreports.qt.io/projects/QTBUG/issues/QTBUG-117009 

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            shpremna Shyamnath Premnadh
            rida-shamasneh Rida Shamasneh
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes