QBluetoothDeviceInfo#

The QBluetoothDeviceInfo class stores information about the Bluetooth device. More

Synopsis#

Functions#

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

Detailed Description#

QBluetoothDeviceInfo provides information about a Bluetooth device’s name, address and class of device.

class PySide6.QtBluetooth.QBluetoothDeviceInfo#

PySide6.QtBluetooth.QBluetoothDeviceInfo(address, name, classOfDevice)

PySide6.QtBluetooth.QBluetoothDeviceInfo(other)

PySide6.QtBluetooth.QBluetoothDeviceInfo(uuid, name, classOfDevice)

Parameters:

Constructs an invalid QBluetoothDeviceInfo object.

Constructs a QBluetoothDeviceInfo object with Bluetooth address address, device name name and the encoded class of device classOfDevice.

The classOfDevice parameter is encoded in the following format

Bits

Size

Description

0 - 1

2

Unused, set to 0.

2 - 7

6

Minor device class.

8 - 12

5

Major device class.

13 - 23

11

Service class.

Constructs a QBluetoothDeviceInfo that is a copy of other.

Constructs a QBluetoothDeviceInfo object with unique uuid, device name name and the encoded class of device classOfDevice.

This constructor is required for Low Energy devices on macOS and iOS. CoreBluetooth API hides addresses and provides unique UUIDs to identify a device. This UUID is not the same thing as a service UUID and is required to work later with CoreBluetooth API and discovered devices.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MajorDeviceClass#

This enum describes a Bluetooth device’s major device class.

Constant

Description

QBluetoothDeviceInfo.MiscellaneousDevice

A miscellaneous device.

QBluetoothDeviceInfo.ComputerDevice

A computer device or PDA.

QBluetoothDeviceInfo.PhoneDevice

A telephone device.

QBluetoothDeviceInfo.NetworkDevice

A device that provides access to a local area network (since Qt 5.13).

QBluetoothDeviceInfo.AudioVideoDevice

A device capable of playback or capture of audio and/or video.

QBluetoothDeviceInfo.PeripheralDevice

A peripheral device such as a keyboard, mouse, and so on.

QBluetoothDeviceInfo.ImagingDevice

An imaging device such as a display, printer, scanner or camera.

QBluetoothDeviceInfo.WearableDevice

A wearable device such as a watch or pager.

QBluetoothDeviceInfo.ToyDevice

A toy.

QBluetoothDeviceInfo.HealthDevice

A health reated device such as heart rate or temperature monitor.

QBluetoothDeviceInfo.UncategorizedDevice

A device that does not fit into any of the other device classes.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorMiscellaneousClass#

This enum describes the minor device classes for miscellaneous Bluetooth devices.

Constant

Description

QBluetoothDeviceInfo.UncategorizedMiscellaneous

An uncategorized miscellaneous device.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorComputerClass#

This enum describes the minor device classes for computer devices.

Constant

Description

QBluetoothDeviceInfo.UncategorizedComputer

An uncategorized computer device.

QBluetoothDeviceInfo.DesktopComputer

A desktop computer.

QBluetoothDeviceInfo.ServerComputer

A server computer.

QBluetoothDeviceInfo.LaptopComputer

A laptop computer.

QBluetoothDeviceInfo.HandheldClamShellComputer

A clamshell handheld computer or PDA.

QBluetoothDeviceInfo.HandheldComputer

A handheld computer or PDA.

QBluetoothDeviceInfo.WearableComputer

A wearable computer.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorPhoneClass#

This enum describes the minor device classes for phone devices.

Constant

Description

QBluetoothDeviceInfo.UncategorizedPhone

An uncategorized phone device.

QBluetoothDeviceInfo.CellularPhone

A cellular phone.

QBluetoothDeviceInfo.CordlessPhone

A cordless phone.

QBluetoothDeviceInfo.SmartPhone

A smart phone.

QBluetoothDeviceInfo.WiredModemOrVoiceGatewayPhone

A wired modem or voice gateway.

QBluetoothDeviceInfo.CommonIsdnAccessPhone

A device that provides ISDN access.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorNetworkClass#

This enum describes the minor device classes for local area network access devices. Local area network access devices use the minor device class to specify the current network utilization.

Constant

Description

QBluetoothDeviceInfo.NetworkFullService

100% of the total bandwidth is available.

QBluetoothDeviceInfo.NetworkLoadFactorOne

0 - 17% of the total bandwidth is currently being used.

QBluetoothDeviceInfo.NetworkLoadFactorTwo

17 - 33% of the total bandwidth is currently being used.

QBluetoothDeviceInfo.NetworkLoadFactorThree

33 - 50% of the total bandwidth is currently being used.

QBluetoothDeviceInfo.NetworkLoadFactorFour

50 - 67% of the total bandwidth is currently being used.

QBluetoothDeviceInfo.NetworkLoadFactorFive

67 - 83% of the total bandwidth is currently being used.

QBluetoothDeviceInfo.NetworkLoadFactorSix

83 - 99% of the total bandwidth is currently being used.

QBluetoothDeviceInfo.NetworkNoService

No network service available.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorAudioVideoClass#

This enum describes the minor device classes for audio/video devices.

Constant

Description

QBluetoothDeviceInfo.UncategorizedAudioVideoDevice

An uncategorized audio/video device.

QBluetoothDeviceInfo.WearableHeadsetDevice

A wearable headset device.

QBluetoothDeviceInfo.HandsFreeDevice

A handsfree device.

QBluetoothDeviceInfo.Microphone

A microphone.

QBluetoothDeviceInfo.Loudspeaker

A loudspeaker.

QBluetoothDeviceInfo.Headphones

Headphones.

QBluetoothDeviceInfo.PortableAudioDevice

A portable audio device.

QBluetoothDeviceInfo.CarAudio

A car audio device.

QBluetoothDeviceInfo.SetTopBox

A settop box.

QBluetoothDeviceInfo.HiFiAudioDevice

A HiFi audio device.

QBluetoothDeviceInfo.Vcr

A video cassette recorder.

QBluetoothDeviceInfo.VideoCamera

A video camera.

QBluetoothDeviceInfo.Camcorder

A video camera.

QBluetoothDeviceInfo.VideoMonitor

A video monitor.

QBluetoothDeviceInfo.VideoDisplayAndLoudspeaker

A video display with built-in loudspeaker.

QBluetoothDeviceInfo.VideoConferencing

A video conferencing device.

QBluetoothDeviceInfo.GamingDevice

A gaming device.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorPeripheralClass#

This enum describes the minor device classes for peripheral devices.

Constant

Description

QBluetoothDeviceInfo.UncategorizedPeripheral

An uncategorized peripheral device.

QBluetoothDeviceInfo.KeyboardPeripheral

A keyboard.

QBluetoothDeviceInfo.PointingDevicePeripheral

A pointing device, for example a mouse.

QBluetoothDeviceInfo.KeyboardWithPointingDevicePeripheral

A keyboard with built-in pointing device.

QBluetoothDeviceInfo.JoystickPeripheral

A joystick.

QBluetoothDeviceInfo.GamepadPeripheral

A game pad.

QBluetoothDeviceInfo.RemoteControlPeripheral

A remote control.

QBluetoothDeviceInfo.SensingDevicePeripheral

A sensing device.

QBluetoothDeviceInfo.DigitizerTabletPeripheral

A digitizer tablet peripheral.

QBluetoothDeviceInfo.CardReaderPeripheral

A card reader peripheral.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorImagingClass#

This enum describes the minor device classes for imaging devices.

Constant

Description

QBluetoothDeviceInfo.UncategorizedImagingDevice

An uncategorized imaging device.

QBluetoothDeviceInfo.ImageDisplay

A device capable of displaying images.

QBluetoothDeviceInfo.ImageCamera

A camera.

QBluetoothDeviceInfo.ImageScanner

An image scanner.

QBluetoothDeviceInfo.ImagePrinter

A printer.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorWearableClass#

This enum describes the minor device classes for wearable devices.

Constant

Description

QBluetoothDeviceInfo.UncategorizedWearableDevice

An uncategorized wearable device.

QBluetoothDeviceInfo.WearableWristWatch

A wristwatch.

QBluetoothDeviceInfo.WearablePager

A pager.

QBluetoothDeviceInfo.WearableJacket

A jacket.

QBluetoothDeviceInfo.WearableHelmet

A helmet.

QBluetoothDeviceInfo.WearableGlasses

A pair of glasses.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorToyClass#

This enum describes the minor device classes for toy devices.

Constant

Description

QBluetoothDeviceInfo.UncategorizedToy

An uncategorized toy.

QBluetoothDeviceInfo.ToyRobot

A toy robot.

QBluetoothDeviceInfo.ToyVehicle

A toy vehicle.

QBluetoothDeviceInfo.ToyDoll

A toy doll or action figure.

QBluetoothDeviceInfo.ToyController

A controller.

QBluetoothDeviceInfo.ToyGame

A game.

PySide6.QtBluetooth.QBluetoothDeviceInfo.MinorHealthClass#

This enum describes the minor device classes for health devices.

Constant

Description

QBluetoothDeviceInfo.UncategorizedHealthDevice

An uncategorized health device.

QBluetoothDeviceInfo.HealthBloodPressureMonitor

A blood pressure monitor.

QBluetoothDeviceInfo.HealthThermometer

A Thermometer.

QBluetoothDeviceInfo.HealthWeightScale

A scale.

QBluetoothDeviceInfo.HealthGlucoseMeter

A glucose meter.

QBluetoothDeviceInfo.HealthPulseOximeter

A blood oxygen saturation meter.

QBluetoothDeviceInfo.HealthDataDisplay

A data display.

QBluetoothDeviceInfo.HealthStepCounter

A pedometer.

PySide6.QtBluetooth.QBluetoothDeviceInfo.ServiceClass#

(inherits enum.Flag) This enum describes the service class of the Bluetooth device. The service class is used as a rudimentary form of service discovery. It is meant to provide a list of the types of services that the device might provide.

Constant

Description

QBluetoothDeviceInfo.NoService

The device does not provide any services.

QBluetoothDeviceInfo.PositioningService

The device provides positioning services.

QBluetoothDeviceInfo.NetworkingService

The device provides networking services.

QBluetoothDeviceInfo.RenderingService

The device provides rendering services.

QBluetoothDeviceInfo.CapturingService

The device provides capturing services.

QBluetoothDeviceInfo.ObjectTransferService

The device provides object transfer services.

QBluetoothDeviceInfo.AudioService

The device provides audio services.

QBluetoothDeviceInfo.TelephonyService

The device provides telephony services.

QBluetoothDeviceInfo.InformationService

The device provides information services.

QBluetoothDeviceInfo.AllServices

The device provides services of all types.

PySide6.QtBluetooth.QBluetoothDeviceInfo.Field#

(inherits enum.Flag) This enum is used in conjuntion with the deviceUpdated() signal and indicates the field that changed.

Constant

Description

QBluetoothDeviceInfo.Field.None

None of the values changed.

QBluetoothDeviceInfo.Field.RSSI

The rssi() value of the device changed.

QBluetoothDeviceInfo.Field.ManufacturerData

The manufacturerData() field changed

QBluetoothDeviceInfo.Field.ServiceData

The serviceData() field changed

QBluetoothDeviceInfo.Field.All

Matches every possible field.

PySide6.QtBluetooth.QBluetoothDeviceInfo.CoreConfiguration#

(inherits enum.Flag) This enum describes the configuration of the device.

Constant

Description

QBluetoothDeviceInfo.UnknownCoreConfiguration

The type of the Bluetooth device cannot be determined.

QBluetoothDeviceInfo.BaseRateCoreConfiguration

The device is a standard Bluetooth device.

QBluetoothDeviceInfo.BaseRateAndLowEnergyCoreConfiguration

The device is a Bluetooth Smart device with support for standard and Low Energy device.

QBluetoothDeviceInfo.LowEnergyCoreConfiguration

The device is a Bluetooth Low Energy device.

PySide6.QtBluetooth.QBluetoothDeviceInfo.address()#
Return type:

PySide6.QtBluetooth.QBluetoothAddress

Returns the address of the device.

Note

On iOS and macOS this address is invalid. Instead deviceUuid() should be used. Those two platforms do not expose Bluetooth addresses for found Bluetooth devices and utilize unique device identifiers.

See also

deviceUuid()

PySide6.QtBluetooth.QBluetoothDeviceInfo.coreConfigurations()#
Return type:

Combination of QBluetoothDeviceInfo.CoreConfiguration

Returns the configuration of the device. If device configuration is not set, basic rate device configuration will be returned.

PySide6.QtBluetooth.QBluetoothDeviceInfo.deviceUuid()#
Return type:

PySide6.QtBluetooth.QBluetoothUuid

Returns a unique identifier for a Bluetooth device without an address.

In general, this uuid is invalid on every platform but macOS and iOS. It is used as a workaround for those two platforms as they do not provide Bluetooth addresses for found Bluetooth Low Energy devices. Every other platform uses address() instead.

See also

setDeviceUuid()

PySide6.QtBluetooth.QBluetoothDeviceInfo.isCached()#
Return type:

bool

Returns true if the QBluetoothDeviceInfo object is created from cached data.

PySide6.QtBluetooth.QBluetoothDeviceInfo.isValid()#
Return type:

bool

Returns true if the QBluetoothDeviceInfo object is valid, otherwise returns false.

PySide6.QtBluetooth.QBluetoothDeviceInfo.majorDeviceClass()#
Return type:

MajorDeviceClass

Returns the major device class of the device.

PySide6.QtBluetooth.QBluetoothDeviceInfo.manufacturerData()#
Return type:

.QMultiHashquint16,QByteArray

Returns the complete set of all manufacturer data from advertisement packets.

Some devices may provide multiple manufacturer data entries per manufacturer ID. An example might be a Bluetooth Low Energy device that sends a different manufacturer data via advertisement packets and scan response packets respectively. Therefore the returned hash table may have multiple entries per manufacturer ID or hash key.

PySide6.QtBluetooth.QBluetoothDeviceInfo.manufacturerData(manufacturerId)
Parameters:

manufacturerId – int

Return type:

PySide6.QtCore.QByteArray

Returns the data associated with the given manufacturerId.

Manufacturer data is defined by the Supplement to the Bluetooth Core Specification and consists of two segments:

  • Manufacturer specific identifier code from the Assigned Numbers Company Identifiers document

  • Sequence of arbitrary data octets

The interpretation of the data octets is defined by the manufacturer specified by the company identifier.

Note

The remote device may provide multiple data entries per manufacturerId. This function only returns the first entry. If all entries are needed use manufacturerData() which returns a multi hash.

PySide6.QtBluetooth.QBluetoothDeviceInfo.manufacturerIds()#
Return type:

.list of quint16

Returns all manufacturer IDs from advertisement packets attached to this device information.

PySide6.QtBluetooth.QBluetoothDeviceInfo.minorDeviceClass()#
Return type:

int

Returns the minor device class of the device. The actual information is context dependent on the value of majorDeviceClass() .

See also

MinorAudioVideoClass MinorComputerClass MinorHealthClass MinorImagingClass MinorMiscellaneousClass MinorNetworkClass MinorPeripheralClass MinorPhoneClass MinorToyClass MinorWearableClass

PySide6.QtBluetooth.QBluetoothDeviceInfo.name()#
Return type:

str

Returns the name assigned to the device.

See also

setName()

PySide6.QtBluetooth.QBluetoothDeviceInfo.__ne__(b)#
Parameters:

bPySide6.QtBluetooth.QBluetoothDeviceInfo

Return type:

bool

Returns true if the two QBluetoothDeviceInfo objects a and b are not equal.

PySide6.QtBluetooth.QBluetoothDeviceInfo.__eq__(b)#
Parameters:

bPySide6.QtBluetooth.QBluetoothDeviceInfo

Return type:

bool

Returns true if the two QBluetoothDeviceInfo objects a and b are equal.

PySide6.QtBluetooth.QBluetoothDeviceInfo.rssi()#
Return type:

int

Returns the signal strength when the device was last scanned

See also

setRssi()

PySide6.QtBluetooth.QBluetoothDeviceInfo.serviceClasses()#
Return type:

Combination of QBluetoothDeviceInfo.ServiceClass

Returns the service class of the device.

PySide6.QtBluetooth.QBluetoothDeviceInfo.serviceData()#
Return type:

.QMultiHashQBluetoothUuid,QByteArray

Returns the complete set of all service data from advertisement packets.

Some devices may provide multiple service data entries per service data ID. An example might be a Bluetooth Low Energy device that sends a different service data via advertisement packets and scan response packets respectively. Therefore the returned hash table may have multiple entries per service data ID or hash key.

See also

setServiceData

PySide6.QtBluetooth.QBluetoothDeviceInfo.serviceData(serviceId)
Parameters:

serviceIdPySide6.QtBluetooth.QBluetoothUuid

Return type:

PySide6.QtCore.QByteArray

Returns the data associated with the given serviceId.

Service data is defined by the Supplement to the Bluetooth Core Specification and consists of two segments:

  • Service UUID

  • Sequence of arbitrary data octets

Note

The remote device may provide multiple data entries per serviceId. This function only returns the first entry. If all entries are needed use serviceData() which returns a multi hash.

PySide6.QtBluetooth.QBluetoothDeviceInfo.serviceIds()#
Return type:

.list of QBluetoothUuid

Returns all service data IDs from advertisement packets attached to this device information.

PySide6.QtBluetooth.QBluetoothDeviceInfo.serviceUuids()#
Return type:

.list of QBluetoothUuid

Returns the list of service UUIDs supported by the device. Most commonly this list of UUIDs represents custom service UUIDs or a service UUID value specified by ServiceClassUuid .

PySide6.QtBluetooth.QBluetoothDeviceInfo.setCached(cached)#
Parameters:

cached – bool

Used by the system to set the cached flag if the QBluetoothDeviceInfo is created from cached data. Cached information may not be as accurate as data read from an active device.

See also

isCached()

PySide6.QtBluetooth.QBluetoothDeviceInfo.setCoreConfigurations(coreConfigs)#
Parameters:

coreConfigs – Combination of QBluetoothDeviceInfo.CoreConfiguration

Sets the CoreConfigurations of the device to coreConfigs. This will help to make a difference between regular and Low Energy devices.

PySide6.QtBluetooth.QBluetoothDeviceInfo.setDeviceUuid(uuid)#
Parameters:

uuidPySide6.QtBluetooth.QBluetoothUuid

Sets the unique identifier uuid for Bluetooth devices, that do not have addresses. This happens on macOS and iOS, where the CoreBluetooth API hides addresses, but provides UUIDs to identify devices/peripherals.

This uuid is invalid on any other platform.

See also

deviceUuid()

PySide6.QtBluetooth.QBluetoothDeviceInfo.setManufacturerData(manufacturerId, data)#
Parameters:
Return type:

bool

Sets the advertised manufacturer data for the given manufacturerId. Returns true if it was inserted, false if it was already known.

Since Qt 5.14, different values for data and the same manufacturerId no longer replace each other but are accumulated for the duration of a device scan.

See also

manufacturerData

PySide6.QtBluetooth.QBluetoothDeviceInfo.setName(name)#
Parameters:

name – str

Sets the name of the device.

See also

name()

PySide6.QtBluetooth.QBluetoothDeviceInfo.setRssi(signal)#
Parameters:

signal – int

Set the signal strength value, used internally.

See also

rssi()

PySide6.QtBluetooth.QBluetoothDeviceInfo.setServiceData(serviceId, data)#
Parameters:
Return type:

bool

Sets the advertised service data for the given serviceId. Returns true if it was inserted, false if it was already known.

See also

serviceData

PySide6.QtBluetooth.QBluetoothDeviceInfo.setServiceUuids(uuids)#
Parameters:

uuids – .list of QBluetoothUuid

Sets the list of service UUIDs to uuids.

See also

serviceUuids()