From pykde Wed Apr 17 11:45:48 2024 From: Phil Thompson Date: Wed, 17 Apr 2024 11:45:48 +0000 To: pykde Subject: Re: PyQt 6.6.1 QBluetoothDeviceInfo getServiceData() Bug Message-Id: <459e57657e717761bba53292cce168d4 () riverbankcomputing ! com> X-MARC-Message: https://marc.info/?l=pykde&m=171335419113339 On 12/04/2024 10:51, Benjamin Griffiths wrote: > Hi there, > > I am trying to read the BLE service data from QBluetoothDeviceInfo > via the serviceData() method, but I believe I have discovered a bug. > > _serviceData() ->__ Dict[QBluetoothUuid, QByteArray]_ > > The function returns an empty dictionary for discovered devices that > have no service data available (correct behaviour). However, when the > device does have service data, a TypeError is raised. > > _TypeError: unhashable type: 'QBluetoothUuid'_ > > I have attached a minimal reproducible example that scans for all > Bluetooth Low Energy devices and tries to read the service data using > serviceData(). Obviously to reproduce this error you will need to be > in range of some BLE devices that have non-empty service data. > > I am using Python 3.10.11 and PyQt 6.6.1. > > A work around is to use the serviceUuids() method, then use > serviceData(uuid) for each UUID. However as per the documentation this > only return the "first" item in service data, not all of it. > > Any support would be greatly appreciated. > > Many thanks, > > Ben Should be fixed in the next snapshot. Thanks, Phil