Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QBluetoothDeviceInfo Class Reference

\inmodule QtBluetooth More...

#include <qbluetoothdeviceinfo.h>

+ Collaboration diagram for QBluetoothDeviceInfo:

Public Types

enum  MajorDeviceClass {
  MiscellaneousDevice = 0 , ComputerDevice = 1 , PhoneDevice = 2 , NetworkDevice = 3 ,
  AudioVideoDevice = 4 , PeripheralDevice = 5 , ImagingDevice = 6 , WearableDevice = 7 ,
  ToyDevice = 8 , HealthDevice = 9 , UncategorizedDevice = 31
}
 This enum describes a Bluetooth device's major device class. More...
 
enum  MinorMiscellaneousClass { UncategorizedMiscellaneous = 0 }
 This enum describes the minor device classes for miscellaneous Bluetooth devices. More...
 
enum  MinorComputerClass {
  UncategorizedComputer = 0 , DesktopComputer = 1 , ServerComputer = 2 , LaptopComputer = 3 ,
  HandheldClamShellComputer = 4 , HandheldComputer = 5 , WearableComputer = 6
}
 This enum describes the minor device classes for computer devices. More...
 
enum  MinorPhoneClass {
  UncategorizedPhone = 0 , CellularPhone = 1 , CordlessPhone = 2 , SmartPhone = 3 ,
  WiredModemOrVoiceGatewayPhone = 4 , CommonIsdnAccessPhone = 5
}
 This enum describes the minor device classes for phone devices. More...
 
enum  MinorNetworkClass {
  NetworkFullService = 0x00 , NetworkLoadFactorOne = 0x08 , NetworkLoadFactorTwo = 0x10 , NetworkLoadFactorThree = 0x18 ,
  NetworkLoadFactorFour = 0x20 , NetworkLoadFactorFive = 0x28 , NetworkLoadFactorSix = 0x30 , NetworkNoService = 0x38
}
 This enum describes the minor device classes for local area network access devices. More...
 
enum  MinorAudioVideoClass {
  UncategorizedAudioVideoDevice = 0 , WearableHeadsetDevice = 1 , HandsFreeDevice = 2 , Microphone = 4 ,
  Loudspeaker = 5 , Headphones = 6 , PortableAudioDevice = 7 , CarAudio = 8 ,
  SetTopBox = 9 , HiFiAudioDevice = 10 , Vcr = 11 , VideoCamera = 12 ,
  Camcorder = 13 , VideoMonitor = 14 , VideoDisplayAndLoudspeaker = 15 , VideoConferencing = 16 ,
  GamingDevice = 18
}
 This enum describes the minor device classes for audio/video devices. More...
 
enum  MinorPeripheralClass {
  UncategorizedPeripheral = 0 , KeyboardPeripheral = 0x10 , PointingDevicePeripheral = 0x20 , KeyboardWithPointingDevicePeripheral = 0x30 ,
  JoystickPeripheral = 0x01 , GamepadPeripheral = 0x02 , RemoteControlPeripheral = 0x03 , SensingDevicePeripheral = 0x04 ,
  DigitizerTabletPeripheral = 0x05 , CardReaderPeripheral = 0x06
}
 This enum describes the minor device classes for peripheral devices. More...
 
enum  MinorImagingClass {
  UncategorizedImagingDevice = 0 , ImageDisplay = 0x04 , ImageCamera = 0x08 , ImageScanner = 0x10 ,
  ImagePrinter = 0x20
}
 This enum describes the minor device classes for imaging devices. More...
 
enum  MinorWearableClass {
  UncategorizedWearableDevice = 0 , WearableWristWatch = 1 , WearablePager = 2 , WearableJacket = 3 ,
  WearableHelmet = 4 , WearableGlasses = 5
}
 This enum describes the minor device classes for wearable devices. More...
 
enum  MinorToyClass {
  UncategorizedToy = 0 , ToyRobot = 1 , ToyVehicle = 2 , ToyDoll = 3 ,
  ToyController = 4 , ToyGame = 5
}
 This enum describes the minor device classes for toy devices. More...
 
enum  MinorHealthClass {
  UncategorizedHealthDevice = 0 , HealthBloodPressureMonitor = 0x1 , HealthThermometer = 0x2 , HealthWeightScale = 0x3 ,
  HealthGlucoseMeter = 0x4 , HealthPulseOximeter = 0x5 , HealthDataDisplay = 0x7 , HealthStepCounter = 0x8
}
 This enum describes the minor device classes for health devices. More...
 
enum  ServiceClass {
  NoService = 0x0000 , PositioningService = 0x0001 , NetworkingService = 0x0002 , RenderingService = 0x0004 ,
  CapturingService = 0x0008 , ObjectTransferService = 0x0010 , AudioService = 0x0020 , TelephonyService = 0x0040 ,
  InformationService = 0x0080 , AllServices = 0x07ff
}
 This enum describes the service class of the Bluetooth device. More...
 
enum class  Field {
  None = 0x0000 , RSSI = 0x0001 , ManufacturerData = 0x0002 , ServiceData = 0x0004 ,
  All = 0x7fff
}
 This enum is used in conjuntion with the \l QBluetoothDeviceDiscoveryAgent::deviceUpdated() signal and indicates the field that changed. More...
 
enum  CoreConfiguration { UnknownCoreConfiguration = 0x0 , LowEnergyCoreConfiguration = 0x01 , BaseRateCoreConfiguration = 0x02 , BaseRateAndLowEnergyCoreConfiguration = 0x03 }
 

Public Member Functions

 QBluetoothDeviceInfo ()
 Constructs an invalid QBluetoothDeviceInfo object.
 
 QBluetoothDeviceInfo (const QBluetoothAddress &address, const QString &name, quint32 classOfDevice)
 Constructs a QBluetoothDeviceInfo object with Bluetooth address address, device name name and the encoded class of device classOfDevice.
 
 QBluetoothDeviceInfo (const QBluetoothUuid &uuid, const QString &name, quint32 classOfDevice)
 Constructs a QBluetoothDeviceInfo object with unique uuid, device name name and the encoded class of device classOfDevice.
 
 QBluetoothDeviceInfo (const QBluetoothDeviceInfo &other)
 Constructs a QBluetoothDeviceInfo that is a copy of other.
 
 ~QBluetoothDeviceInfo ()
 Destroys the QBluetoothDeviceInfo.
 
bool isValid () const
 Returns true if the QBluetoothDeviceInfo object is valid, otherwise returns false.
 
bool isCached () const
 Returns true if the QBluetoothDeviceInfo object is created from cached data.
 
void setCached (bool cached)
 Used by the system to set the cached flag if the QBluetoothDeviceInfo is created from cached data.
 
QBluetoothDeviceInfooperator= (const QBluetoothDeviceInfo &other)
 Makes a copy of the other and assigns it to this QBluetoothDeviceInfo object.
 
QBluetoothAddress address () const
 Returns the address of the device.
 
QString name () const
 Returns the name assigned to the device.
 
void setName (const QString &name)
 Sets the name of the device.
 
ServiceClasses serviceClasses () const
 Returns the service class of the device.
 
MajorDeviceClass majorDeviceClass () const
 Returns the major device class of the device.
 
quint8 minorDeviceClass () const
 Returns the minor device class of the device.
 
qint16 rssi () const
 Returns the signal strength when the device was last scanned.
 
void setRssi (qint16 signal)
 Set the signal strength value, used internally.
 
QList< QBluetoothUuidserviceUuids () const
 Returns the list of service UUIDs supported by the device.
 
void setServiceUuids (const QList< QBluetoothUuid > &uuids)
 Sets the list of service UUIDs to uuids.
 
QList< quint16manufacturerIds () const
 Returns all manufacturer IDs from advertisement packets attached to this device information.
 
QByteArray manufacturerData (quint16 manufacturerId) const
 Returns the data associated with the given manufacturerId.
 
bool setManufacturerData (quint16 manufacturerId, const QByteArray &data)
 Sets the advertised manufacturer data for the given manufacturerId.
 
QMultiHash< quint16, QByteArraymanufacturerData () const
 Returns the complete set of all manufacturer data from advertisement packets.
 
QList< QBluetoothUuidserviceIds () const
 Returns all service data IDs from advertisement packets attached to this device information.
 
QByteArray serviceData (const QBluetoothUuid &serviceId) const
 Returns the data associated with the given serviceId.
 
bool setServiceData (const QBluetoothUuid &serviceId, const QByteArray &data)
 Sets the advertised service data for the given serviceId.
 
QMultiHash< QBluetoothUuid, QByteArrayserviceData () const
 Returns the complete set of all service data from advertisement packets.
 
void setCoreConfigurations (QBluetoothDeviceInfo::CoreConfigurations coreConfigs)
 Sets the CoreConfigurations of the device to coreConfigs.
 
QBluetoothDeviceInfo::CoreConfigurations coreConfigurations () const
 Returns the configuration of the device.
 
void setDeviceUuid (const QBluetoothUuid &uuid)
 Sets the unique identifier uuid for Bluetooth devices, that do not have addresses.
 
QBluetoothUuid deviceUuid () const
 Returns a unique identifier for a Bluetooth device without an address.
 

Protected Attributes

QBluetoothDeviceInfoPrivated_ptr
 

Friends

bool operator== (const QBluetoothDeviceInfo &a, const QBluetoothDeviceInfo &b)
 Returns true if the two QBluetoothDeviceInfo objects a and b are equal.
 
bool operator!= (const QBluetoothDeviceInfo &a, const QBluetoothDeviceInfo &b)
 Returns true if the two QBluetoothDeviceInfo objects a and b are not equal.
 

Detailed Description

\inmodule QtBluetooth

The QBluetoothDeviceInfo class stores information about the Bluetooth device.

Since
5.2

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

Definition at line 21 of file qbluetoothdeviceinfo.h.

Member Enumeration Documentation

◆ CoreConfiguration

Since
5.4

This enum describes the configuration of the device.

\value UnknownCoreConfiguration The type of the Bluetooth device cannot be determined. \value BaseRateCoreConfiguration The device is a standard Bluetooth device. \value BaseRateAndLowEnergyCoreConfiguration The device is a Bluetooth Smart device with support for standard and Low Energy device. \value LowEnergyCoreConfiguration The device is a Bluetooth Low Energy device.

Enumerator
UnknownCoreConfiguration 
LowEnergyCoreConfiguration 
BaseRateCoreConfiguration 
BaseRateAndLowEnergyCoreConfiguration 

Definition at line 168 of file qbluetoothdeviceinfo.h.

◆ Field

enum class QBluetoothDeviceInfo::Field
strong

This enum is used in conjuntion with the \l QBluetoothDeviceDiscoveryAgent::deviceUpdated() signal and indicates the field that changed.

\value None None of the values changed. \value RSSI The \l rssi() value of the device changed. \value ManufacturerData The \l manufacturerData() field changed \value ServiceData The \l serviceData() field changed \value All Matches every possible field.

Since
5.12
Enumerator
None 
RSSI 
ManufacturerData 
ServiceData 
All 

Definition at line 159 of file qbluetoothdeviceinfo.h.

◆ MajorDeviceClass

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

\value MiscellaneousDevice A miscellaneous device. \value ComputerDevice A computer device or PDA. \value PhoneDevice A telephone device. \value NetworkDevice A device that provides access to a local area network (since Qt 5.13). \value AudioVideoDevice A device capable of playback or capture of audio and/or video. \value PeripheralDevice A peripheral device such as a keyboard, mouse, and so on. \value ImagingDevice An imaging device such as a display, printer, scanner or camera. \value WearableDevice A wearable device such as a watch or pager. \value ToyDevice A toy. \value HealthDevice A health reated device such as heart rate or temperature monitor. \value UncategorizedDevice A device that does not fit into any of the other device classes.

Enumerator
MiscellaneousDevice 
ComputerDevice 
PhoneDevice 
NetworkDevice 
AudioVideoDevice 
PeripheralDevice 
ImagingDevice 
WearableDevice 
ToyDevice 
HealthDevice 
UncategorizedDevice 

Definition at line 24 of file qbluetoothdeviceinfo.h.

◆ MinorAudioVideoClass

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

\value UncategorizedAudioVideoDevice An uncategorized audio/video device. \value WearableHeadsetDevice A wearable headset device. \value HandsFreeDevice A handsfree device. \value Microphone A microphone. \value Loudspeaker A loudspeaker. \value Headphones Headphones. \value PortableAudioDevice A portable audio device. \value CarAudio A car audio device. \value SetTopBox A settop box. \value HiFiAudioDevice A HiFi audio device. \value Vcr A video cassette recorder. \value VideoCamera A video camera. \value Camcorder A video camera. \value VideoMonitor A video monitor. \value VideoDisplayAndLoudspeaker A video display with built-in loudspeaker. \value VideoConferencing A video conferencing device. \value GamingDevice A gaming device.

Enumerator
UncategorizedAudioVideoDevice 
WearableHeadsetDevice 
HandsFreeDevice 
Microphone 
Loudspeaker 
Headphones 
PortableAudioDevice 
CarAudio 
SetTopBox 
HiFiAudioDevice 
Vcr 
VideoCamera 
Camcorder 
VideoMonitor 
VideoDisplayAndLoudspeaker 
VideoConferencing 
GamingDevice 

Definition at line 72 of file qbluetoothdeviceinfo.h.

◆ MinorComputerClass

This enum describes the minor device classes for computer devices.

\value UncategorizedComputer An uncategorized computer device. \value DesktopComputer A desktop computer. \value ServerComputer A server computer. \value LaptopComputer A laptop computer. \value HandheldClamShellComputer A clamshell handheld computer or PDA. \value HandheldComputer A handheld computer or PDA. \value WearableComputer A wearable computer.

Enumerator
UncategorizedComputer 
DesktopComputer 
ServerComputer 
LaptopComputer 
HandheldClamShellComputer 
HandheldComputer 
WearableComputer 

Definition at line 42 of file qbluetoothdeviceinfo.h.

◆ MinorHealthClass

This enum describes the minor device classes for health devices.

\value UncategorizedHealthDevice An uncategorized health device. \value HealthBloodPressureMonitor A blood pressure monitor. \value HealthThermometer A Thermometer. \value HealthWeightScale A scale. \value HealthGlucoseMeter A glucose meter. \value HealthPulseOximeter A blood oxygen saturation meter. \value HealthDataDisplay A data display. \value HealthStepCounter A pedometer.

Enumerator
UncategorizedHealthDevice 
HealthBloodPressureMonitor 
HealthThermometer 
HealthWeightScale 
HealthGlucoseMeter 
HealthPulseOximeter 
HealthDataDisplay 
HealthStepCounter 

Definition at line 134 of file qbluetoothdeviceinfo.h.

◆ MinorImagingClass

This enum describes the minor device classes for imaging devices.

\value UncategorizedImagingDevice An uncategorized imaging device. \value ImageDisplay A device capable of displaying images. \value ImageCamera A camera. \value ImageScanner An image scanner. \value ImagePrinter A printer.

Enumerator
UncategorizedImagingDevice 
ImageDisplay 
ImageCamera 
ImageScanner 
ImagePrinter 

Definition at line 108 of file qbluetoothdeviceinfo.h.

◆ MinorMiscellaneousClass

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

\value UncategorizedMiscellaneous An uncategorized miscellaneous device.

Enumerator
UncategorizedMiscellaneous 

Definition at line 38 of file qbluetoothdeviceinfo.h.

◆ 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.

\value NetworkFullService 100% of the total bandwidth is available. \value NetworkLoadFactorOne 0 - 17% of the total bandwidth is currently being used. \value NetworkLoadFactorTwo 17 - 33% of the total bandwidth is currently being used. \value NetworkLoadFactorThree 33 - 50% of the total bandwidth is currently being used. \value NetworkLoadFactorFour 50 - 67% of the total bandwidth is currently being used. \value NetworkLoadFactorFive 67 - 83% of the total bandwidth is currently being used. \value NetworkLoadFactorSix 83 - 99% of the total bandwidth is currently being used. \value NetworkNoService No network service available.

Enumerator
NetworkFullService 
NetworkLoadFactorOne 
NetworkLoadFactorTwo 
NetworkLoadFactorThree 
NetworkLoadFactorFour 
NetworkLoadFactorFive 
NetworkLoadFactorSix 
NetworkNoService 

Definition at line 61 of file qbluetoothdeviceinfo.h.

◆ MinorPeripheralClass

This enum describes the minor device classes for peripheral devices.

\value UncategorizedPeripheral An uncategorized peripheral device. \value KeyboardPeripheral A keyboard. \value PointingDevicePeripheral A pointing device, for example a mouse. \value KeyboardWithPointingDevicePeripheral A keyboard with built-in pointing device. \value JoystickPeripheral A joystick. \value GamepadPeripheral A game pad. \value RemoteControlPeripheral A remote control. \value SensingDevicePeripheral A sensing device. \value DigitizerTabletPeripheral A digitizer tablet peripheral. \value CardReaderPeripheral A card reader peripheral.

Enumerator
UncategorizedPeripheral 
KeyboardPeripheral 
PointingDevicePeripheral 
KeyboardWithPointingDevicePeripheral 
JoystickPeripheral 
GamepadPeripheral 
RemoteControlPeripheral 
SensingDevicePeripheral 
DigitizerTabletPeripheral 
CardReaderPeripheral 

Definition at line 94 of file qbluetoothdeviceinfo.h.

◆ MinorPhoneClass

This enum describes the minor device classes for phone devices.

\value UncategorizedPhone An uncategorized phone device. \value CellularPhone A cellular phone. \value CordlessPhone A cordless phone. \value SmartPhone A smart phone. \value WiredModemOrVoiceGatewayPhone A wired modem or voice gateway. \value CommonIsdnAccessPhone A device that provides ISDN access.

Enumerator
UncategorizedPhone 
CellularPhone 
CordlessPhone 
SmartPhone 
WiredModemOrVoiceGatewayPhone 
CommonIsdnAccessPhone 

Definition at line 52 of file qbluetoothdeviceinfo.h.

◆ MinorToyClass

This enum describes the minor device classes for toy devices.

\value UncategorizedToy An uncategorized toy. \value ToyRobot A toy robot. \value ToyVehicle A toy vehicle. \value ToyDoll A toy doll or action figure. \value ToyController A controller. \value ToyGame A game.

Enumerator
UncategorizedToy 
ToyRobot 
ToyVehicle 
ToyDoll 
ToyController 
ToyGame 

Definition at line 125 of file qbluetoothdeviceinfo.h.

◆ MinorWearableClass

This enum describes the minor device classes for wearable devices.

\value UncategorizedWearableDevice An uncategorized wearable device. \value WearableWristWatch A wristwatch. \value WearablePager A pager. \value WearableJacket A jacket. \value WearableHelmet A helmet. \value WearableGlasses A pair of glasses.

Enumerator
UncategorizedWearableDevice 
WearableWristWatch 
WearablePager 
WearableJacket 
WearableHelmet 
WearableGlasses 

Definition at line 116 of file qbluetoothdeviceinfo.h.

◆ 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.

\value NoService The device does not provide any services. \value PositioningService The device provides positioning services. \value NetworkingService The device provides networking services. \value RenderingService The device provides rendering services. \value CapturingService The device provides capturing services. \value ObjectTransferService The device provides object transfer services. \value AudioService The device provides audio services. \value TelephonyService The device provides telephony services. \value InformationService The device provides information services. \value AllServices The device provides services of all types.

Enumerator
NoService 
PositioningService 
NetworkingService 
RenderingService 
CapturingService 
ObjectTransferService 
AudioService 
TelephonyService 
InformationService 
AllServices 

Definition at line 145 of file qbluetoothdeviceinfo.h.

Constructor & Destructor Documentation

◆ QBluetoothDeviceInfo() [1/4]

QBluetoothDeviceInfo::QBluetoothDeviceInfo ( )

Constructs an invalid QBluetoothDeviceInfo object.

Definition at line 241 of file qbluetoothdeviceinfo.cpp.

◆ QBluetoothDeviceInfo() [2/4]

QBluetoothDeviceInfo::QBluetoothDeviceInfo ( const QBluetoothAddress & address,
const QString & name,
quint32 classOfDevice )

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

\table \header

  • Bits
  • Size
  • Description \row
  • 0 - 1
  • 2
  • Unused, set to 0. \row
  • 2 - 7
  • 6
  • Minor device class. \row
  • 8 - 12
  • 5
  • Major device class. \row
  • 13 - 23
  • 11
  • Service class. \endtable

Definition at line 260 of file qbluetoothdeviceinfo.cpp.

References address(), d, and name().

+ Here is the call graph for this function:

◆ QBluetoothDeviceInfo() [3/4]

QBluetoothDeviceInfo::QBluetoothDeviceInfo ( const QBluetoothUuid & uuid,
const QString & name,
quint32 classOfDevice )

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.

Since
5.5

Definition at line 289 of file qbluetoothdeviceinfo.cpp.

References d, and name().

+ Here is the call graph for this function:

◆ QBluetoothDeviceInfo() [4/4]

QBluetoothDeviceInfo::QBluetoothDeviceInfo ( const QBluetoothDeviceInfo & other)

Constructs a QBluetoothDeviceInfo that is a copy of other.

Definition at line 310 of file qbluetoothdeviceinfo.cpp.

References other().

+ Here is the call graph for this function:

◆ ~QBluetoothDeviceInfo()

QBluetoothDeviceInfo::~QBluetoothDeviceInfo ( )

Destroys the QBluetoothDeviceInfo.

Definition at line 319 of file qbluetoothdeviceinfo.cpp.

References d_ptr.

Member Function Documentation

◆ address()

QBluetoothAddress QBluetoothDeviceInfo::address ( ) const

Returns the address of the device.

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

Definition at line 434 of file qbluetoothdeviceinfo.cpp.

References d.

Referenced by QBluetoothDeviceInfo(), and QBluetoothServiceDiscoveryAgentPrivate::startServiceDiscovery().

+ Here is the caller graph for this function:

◆ coreConfigurations()

QBluetoothDeviceInfo::CoreConfigurations QBluetoothDeviceInfo::coreConfigurations ( ) const

Returns the configuration of the device.

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

See also
setCoreConfigurations()
Since
5.4

Definition at line 701 of file qbluetoothdeviceinfo.cpp.

References d.

◆ deviceUuid()

QBluetoothUuid QBluetoothDeviceInfo::deviceUuid ( ) const

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 \l address() instead.

See also
setDeviceUuid()
Since
5.5

Definition at line 757 of file qbluetoothdeviceinfo.cpp.

References d.

◆ isCached()

bool QBluetoothDeviceInfo::isCached ( ) const

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

Definition at line 711 of file qbluetoothdeviceinfo.cpp.

References d.

◆ isValid()

bool QBluetoothDeviceInfo::isValid ( ) const

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

Definition at line 327 of file qbluetoothdeviceinfo.cpp.

References d.

◆ majorDeviceClass()

QBluetoothDeviceInfo::MajorDeviceClass QBluetoothDeviceInfo::majorDeviceClass ( ) const

Returns the major device class of the device.

Definition at line 476 of file qbluetoothdeviceinfo.cpp.

References d.

◆ manufacturerData() [1/2]

QMultiHash< quint16, QByteArray > QBluetoothDeviceInfo::manufacturerData ( ) const

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.

See also
setManufacturerData
Since
5.12

Definition at line 599 of file qbluetoothdeviceinfo.cpp.

References d.

◆ manufacturerData() [2/2]

QByteArray QBluetoothDeviceInfo::manufacturerData ( quint16 manufacturerId) const

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:

\list

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 \l manufacturerData() which returns a multi hash.
See also
manufacturerIds(), setManufacturerData()
Since
5.12

Definition at line 558 of file qbluetoothdeviceinfo.cpp.

References d.

◆ manufacturerIds()

QList< quint16 > QBluetoothDeviceInfo::manufacturerIds ( ) const

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

See also
manufacturerData(), setManufacturerData()
Since
5.12

Definition at line 529 of file qbluetoothdeviceinfo.cpp.

References d.

◆ minorDeviceClass()

quint8 QBluetoothDeviceInfo::minorDeviceClass ( ) const

Returns the minor device class of the device.

The actual information is context dependent on the value of \l majorDeviceClass().

See also
MinorAudioVideoClass, MinorComputerClass, MinorHealthClass, MinorImagingClass, MinorMiscellaneousClass, MinorNetworkClass, MinorPeripheralClass, MinorPhoneClass, MinorToyClass, MinorWearableClass

Definition at line 491 of file qbluetoothdeviceinfo.cpp.

References d.

◆ name()

QString QBluetoothDeviceInfo::name ( ) const

Returns the name assigned to the device.

Definition at line 444 of file qbluetoothdeviceinfo.cpp.

References d.

Referenced by QBluetoothDeviceInfo(), QBluetoothDeviceInfo(), and setName().

+ Here is the caller graph for this function:

◆ operator=()

QBluetoothDeviceInfo & QBluetoothDeviceInfo::operator= ( const QBluetoothDeviceInfo & other)

Makes a copy of the other and assigns it to this QBluetoothDeviceInfo object.

Definition at line 356 of file qbluetoothdeviceinfo.cpp.

References d, and other().

+ Here is the call graph for this function:

◆ rssi()

qint16 QBluetoothDeviceInfo::rssi ( ) const

Returns the signal strength when the device was last scanned.

Definition at line 337 of file qbluetoothdeviceinfo.cpp.

References d.

◆ serviceClasses()

QBluetoothDeviceInfo::ServiceClasses QBluetoothDeviceInfo::serviceClasses ( ) const

Returns the service class of the device.

Definition at line 466 of file qbluetoothdeviceinfo.cpp.

References d.

◆ serviceData() [1/2]

QMultiHash< QBluetoothUuid, QByteArray > QBluetoothDeviceInfo::serviceData ( ) const

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
Since
6.3

Definition at line 673 of file qbluetoothdeviceinfo.cpp.

References d.

◆ serviceData() [2/2]

QByteArray QBluetoothDeviceInfo::serviceData ( const QBluetoothUuid & serviceId) const

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:

\list

  • Service UUID
  • Sequence of arbitrary data octets \endlist
Note
The remote device may provide multiple data entries per serviceId. This function only returns the first entry. If all entries are needed use \l serviceData() which returns a multi hash.
See also
serviceIds(), setServiceData()
Since
6.3

Definition at line 635 of file qbluetoothdeviceinfo.cpp.

References d.

◆ serviceIds()

QList< QBluetoothUuid > QBluetoothDeviceInfo::serviceIds ( ) const

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

See also
serviceData(), setServiceData()
Since
6.3

Definition at line 611 of file qbluetoothdeviceinfo.cpp.

References d.

◆ serviceUuids()

QList< QBluetoothUuid > QBluetoothDeviceInfo::serviceUuids ( ) const

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 \l QBluetoothUuid::ServiceClassUuid.

See also
serviceUuids()
Since
6.0

Definition at line 516 of file qbluetoothdeviceinfo.cpp.

References d.

◆ setCached()

void QBluetoothDeviceInfo::setCached ( bool cached)

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.

Definition at line 722 of file qbluetoothdeviceinfo.cpp.

References d.

◆ setCoreConfigurations()

void QBluetoothDeviceInfo::setCoreConfigurations ( QBluetoothDeviceInfo::CoreConfigurations coreConfigs)

Sets the CoreConfigurations of the device to coreConfigs.

This will help to make a difference between regular and Low Energy devices.

See also
coreConfigurations()
Since
5.4

Definition at line 686 of file qbluetoothdeviceinfo.cpp.

References d.

Referenced by createDeviceInfoFromBluez5Device().

+ Here is the caller graph for this function:

◆ setDeviceUuid()

void QBluetoothDeviceInfo::setDeviceUuid ( const QBluetoothUuid & uuid)

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()
Since
5.5

Definition at line 739 of file qbluetoothdeviceinfo.cpp.

References d.

◆ setManufacturerData()

bool QBluetoothDeviceInfo::setManufacturerData ( quint16 manufacturerId,
const QByteArray & data )

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
Since
5.12

Definition at line 574 of file qbluetoothdeviceinfo.cpp.

References QSet< T >::cend(), QSet< T >::constFind(), d, QSet< T >::insert(), and it.

Referenced by createDeviceInfoFromBluez5Device().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setName()

void QBluetoothDeviceInfo::setName ( const QString & name)

Sets the name of the device.

Since
6.2

Definition at line 456 of file qbluetoothdeviceinfo.cpp.

References d, and name().

+ Here is the call graph for this function:

◆ setRssi()

void QBluetoothDeviceInfo::setRssi ( qint16 signal)

Set the signal strength value, used internally.

Definition at line 347 of file qbluetoothdeviceinfo.cpp.

References d, and signal.

Referenced by createDeviceInfoFromBluez5Device().

+ Here is the caller graph for this function:

◆ setServiceData()

bool QBluetoothDeviceInfo::setServiceData ( const QBluetoothUuid & serviceId,
const QByteArray & data )

Sets the advertised service data for the given serviceId.

Returns true if it was inserted, false if it was already known.

See also
serviceData
Since
6.3

Definition at line 648 of file qbluetoothdeviceinfo.cpp.

References QSet< T >::cend(), QSet< T >::constFind(), d, QSet< T >::insert(), and it.

Referenced by createDeviceInfoFromBluez5Device().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setServiceUuids()

void QBluetoothDeviceInfo::setServiceUuids ( const QList< QBluetoothUuid > & uuids)

Sets the list of service UUIDs to uuids.

Since
5.13

Definition at line 502 of file qbluetoothdeviceinfo.cpp.

References d.

Referenced by createDeviceInfoFromBluez5Device().

+ Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ operator!=

bool QBluetoothDeviceInfo::operator!= ( const QBluetoothDeviceInfo & a,
const QBluetoothDeviceInfo & b )
friend

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

Definition at line 194 of file qbluetoothdeviceinfo.h.

◆ operator==

bool QBluetoothDeviceInfo::operator== ( const QBluetoothDeviceInfo & a,
const QBluetoothDeviceInfo & b )
friend

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

Definition at line 190 of file qbluetoothdeviceinfo.h.

Member Data Documentation

◆ d_ptr

QBluetoothDeviceInfoPrivate* QBluetoothDeviceInfo::d_ptr
protected

Definition at line 230 of file qbluetoothdeviceinfo.h.

Referenced by ~QBluetoothDeviceInfo().


The documentation for this class was generated from the following files: