QBluetoothDeviceInfo¶
The QBluetoothDeviceInfo
class stores information about the Bluetooth device. More…
Synopsis¶
Functions¶
def
__eq__
(b)def
__ne__
(b)def
address
()def
coreConfigurations
()def
deviceUuid
()def
isCached
()def
isValid
()def
majorDeviceClass
()def
manufacturerData
()def
manufacturerData
(manufacturerId)def
manufacturerIds
()def
minorDeviceClass
()def
name
()def
rssi
()def
serviceClasses
()def
serviceUuids
()def
setCached
(cached)def
setCoreConfigurations
(coreConfigs)def
setDeviceUuid
(uuid)def
setManufacturerData
(manufacturerId, data)def
setName
(name)def
setRssi
(signal)def
setServiceUuids
(uuids)
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
address –
PySide6.QtBluetooth.QBluetoothAddress
classOfDevice – int
name – str
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¶
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¶
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 changedQBluetoothDeviceInfo.Field.All
Matches every possible field.
- PySide6.QtBluetooth.QBluetoothDeviceInfo.CoreConfiguration¶
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
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
- PySide6.QtBluetooth.QBluetoothDeviceInfo.coreConfigurations()¶
- Return type
CoreConfigurations
Returns the configuration of the device. If device configuration is not set, basic rate device configuration will be returned.
See also
- PySide6.QtBluetooth.QBluetoothDeviceInfo.deviceUuid()¶
- Return type
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
- 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
Returns the major device class of the device.
- PySide6.QtBluetooth.QBluetoothDeviceInfo.manufacturerData()¶
- Return type
Returns the complete set of all manufacturer data.
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.
See also
- PySide6.QtBluetooth.QBluetoothDeviceInfo.manufacturerData(manufacturerId)
- Parameters
manufacturerId –
quint16
- Return type
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.
See also
- PySide6.QtBluetooth.QBluetoothDeviceInfo.manufacturerIds()¶
- Return type
Returns all manufacturer ids attached to this device information.
See also
- PySide6.QtBluetooth.QBluetoothDeviceInfo.minorDeviceClass()¶
- Return type
quint8
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
- PySide6.QtBluetooth.QBluetoothDeviceInfo.__ne__(b)¶
- Parameters
- Return type
bool
- PySide6.QtBluetooth.QBluetoothDeviceInfo.__eq__(b)¶
- Parameters
- Return type
bool
- PySide6.QtBluetooth.QBluetoothDeviceInfo.rssi()¶
- Return type
qint16
Returns the signal strength when the device was last scanned
See also
- PySide6.QtBluetooth.QBluetoothDeviceInfo.serviceClasses()¶
- Return type
ServiceClasses
Returns the service class of the device.
- PySide6.QtBluetooth.QBluetoothDeviceInfo.serviceUuids()¶
- Return type
Returns the list of service UUIDS supported by the device. Most commonly this list of uuids represents custom uuids or a uuid value specified by ServiceClassUuid
.
See also
- 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
- PySide6.QtBluetooth.QBluetoothDeviceInfo.setCoreConfigurations(coreConfigs)¶
- Parameters
coreConfigs –
CoreConfigurations
Sets the CoreConfigurations
of the device to coreConfigs
. This will help to make a difference between regular and Low Energy devices.
See also
- PySide6.QtBluetooth.QBluetoothDeviceInfo.setDeviceUuid(uuid)¶
- Parameters
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
- PySide6.QtBluetooth.QBluetoothDeviceInfo.setManufacturerData(manufacturerId, data)¶
- Parameters
manufacturerId –
quint16
data –
PySide6.QtCore.QByteArray
- 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
- PySide6.QtBluetooth.QBluetoothDeviceInfo.setName(name)¶
- Parameters
name – str
Sets the name
of the device.
See also
- PySide6.QtBluetooth.QBluetoothDeviceInfo.setRssi(signal)¶
- Parameters
signal –
qint16
Set the signal
strength value, used internally.
See also
- PySide6.QtBluetooth.QBluetoothDeviceInfo.setServiceUuids(uuids)¶
- Parameters
uuids –
Sets the list of service UUIDs to uuids
.
See also
© 2022 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.