このページでは

QBluetoothDeviceInfo Class

QBluetoothDeviceInfo クラスは、Bluetooth デバイスに関する情報を格納します。詳細...

ヘッダー: #include <QBluetoothDeviceInfo>
CMake: find_package(Qt6 REQUIRED COMPONENTS Bluetooth)
target_link_libraries(mytarget PRIVATE Qt6::Bluetooth)
qmake: QT += bluetooth

パブリック型

enum CoreConfiguration { UnknownCoreConfiguration, BaseRateCoreConfiguration, BaseRateAndLowEnergyCoreConfiguration, LowEnergyCoreConfiguration }
flags CoreConfigurations
enum class Field { None, RSSI, ManufacturerData, ServiceData, All }
flags Fields
enum MajorDeviceClass { MiscellaneousDevice, ComputerDevice, PhoneDevice, NetworkDevice, AudioVideoDevice, …, UncategorizedDevice }
enum MinorAudioVideoClass { UncategorizedAudioVideoDevice, WearableHeadsetDevice, HandsFreeDevice, Microphone, Loudspeaker, …, GamingDevice }
enum MinorComputerClass { UncategorizedComputer, DesktopComputer, ServerComputer, LaptopComputer, HandheldClamShellComputer, …, WearableComputer }
enum MinorHealthClass { UncategorizedHealthDevice, HealthBloodPressureMonitor, HealthThermometer, HealthWeightScale, HealthGlucoseMeter, …, HealthStepCounter }
enum MinorImagingClass { UncategorizedImagingDevice, ImageDisplay, ImageCamera, ImageScanner, ImagePrinter }
enum MinorMiscellaneousClass { UncategorizedMiscellaneous }
enum MinorNetworkClass { NetworkFullService, NetworkLoadFactorOne, NetworkLoadFactorTwo, NetworkLoadFactorThree, NetworkLoadFactorFour, …, NetworkNoService }
enum MinorPeripheralClass { UncategorizedPeripheral, KeyboardPeripheral, PointingDevicePeripheral, KeyboardWithPointingDevicePeripheral, JoystickPeripheral, …, CardReaderPeripheral }
enum MinorPhoneClass { UncategorizedPhone, CellularPhone, CordlessPhone, SmartPhone, WiredModemOrVoiceGatewayPhone, CommonIsdnAccessPhone }
enum MinorToyClass { UncategorizedToy, ToyRobot, ToyVehicle, ToyDoll, ToyController, ToyGame }
enum MinorWearableClass { UncategorizedWearableDevice, WearableWristWatch, WearablePager, WearableJacket, WearableHelmet, WearableGlasses }
enum ServiceClass { NoService, PositioningService, NetworkingService, RenderingService, CapturingService, …, AllServices }
flags ServiceClasses

パブリック関数

QBluetoothDeviceInfo()
QBluetoothDeviceInfo(const QBluetoothAddress &address, const QString &name, quint32 classOfDevice)
QBluetoothDeviceInfo(const QBluetoothUuid &uuid, const QString &name, quint32 classOfDevice)
QBluetoothDeviceInfo(const QBluetoothDeviceInfo &other)
~QBluetoothDeviceInfo()
QBluetoothAddress address() const
QBluetoothDeviceInfo::CoreConfigurations coreConfigurations() const
QBluetoothUuid deviceUuid() const
bool isCached() const
bool isValid() const
QBluetoothDeviceInfo::MajorDeviceClass majorDeviceClass() const
QMultiHash<quint16, QByteArray> manufacturerData() const
QByteArray manufacturerData(quint16 manufacturerId) const
QList<quint16> manufacturerIds() const
quint8 minorDeviceClass() const
QString name() const
qint16 rssi() const
QBluetoothDeviceInfo::ServiceClasses serviceClasses() const
(since 6.3) QMultiHash<QBluetoothUuid, QByteArray> serviceData() const
(since 6.3) QByteArray serviceData(const QBluetoothUuid &serviceId) const
(since 6.3) QList<QBluetoothUuid> serviceIds() const
(since 6.0) QList<QBluetoothUuid> serviceUuids() const
void setCached(bool cached)
void setCoreConfigurations(QBluetoothDeviceInfo::CoreConfigurations coreConfigs)
void setDeviceUuid(const QBluetoothUuid &uuid)
bool setManufacturerData(quint16 manufacturerId, const QByteArray &data)
(since 6.2) void setName(const QString &name)
void setRssi(qint16 signal)
(since 6.3) bool setServiceData(const QBluetoothUuid &serviceId, const QByteArray &data)
void setServiceUuids(const QList<QBluetoothUuid> &uuids)
QBluetoothDeviceInfo &operator=(const QBluetoothDeviceInfo &other)
bool operator!=(const QBluetoothDeviceInfo &a, const QBluetoothDeviceInfo &b)
bool operator==(const QBluetoothDeviceInfo &a, const QBluetoothDeviceInfo &b)

詳細な説明

QBluetoothDeviceInfo は、Bluetooth デバイスの名前、アドレス、およびデバイスクラスに関する情報を提供します。

メンバ型のドキュメント

enum QBluetoothDeviceInfo::CoreConfiguration
flags QBluetoothDeviceInfo::CoreConfigurations

この列挙型は、デバイスの設定を表します。

定数値説明
QBluetoothDeviceInfo::UnknownCoreConfiguration0x0Bluetooth デバイスのタイプを特定できません。
QBluetoothDeviceInfo::BaseRateCoreConfiguration0x02Bluetooth デバイスの種類を判別できません。このデバイスは、標準の Bluetooth デバイスです。
QBluetoothDeviceInfo::BaseRateAndLowEnergyCoreConfiguration0x03デバイスは、標準および Low Energy デバイスをサポートする Bluetooth Smart デバイスです。
QBluetoothDeviceInfo::LowEnergyCoreConfiguration0x01このデバイスは Bluetooth Low Energy デバイスです。

CoreConfigurations 型は、QFlags<CoreConfiguration> の typedef です。CoreConfiguration 値の OR 組み合わせを格納します。

enum class QBluetoothDeviceInfo::Field
flags QBluetoothDeviceInfo::Fields

この列挙型は、QBluetoothDeviceDiscoveryAgent::deviceUpdated() シグナルと組み合わせて使用され、変更されたフィールドを示します。

定数値説明
QBluetoothDeviceInfo::Field::None0x0000どの値も変更されませんでした。
QBluetoothDeviceInfo::Field::RSSI0x0001デバイスのrssi() の値が変更されました。
QBluetoothDeviceInfo::Field::ManufacturerData0x0002manufacturerData() フィールドが変更されました
QBluetoothDeviceInfo::Field::ServiceData0x0004serviceData() フィールドが変更されました
QBluetoothDeviceInfo::Field::All0x7fffすべての可能なフィールドに一致します。

Fields 型は、QFlags<Field> の typedef です。Field 値の OR 組み合わせを格納します。

enum QBluetoothDeviceInfo::MajorDeviceClass

この列挙型は、Bluetoothデバイスのメジャーデバイスクラスを表します。

定数値説明
QBluetoothDeviceInfo::MiscellaneousDevice0その他のデバイス。
QBluetoothDeviceInfo::ComputerDevice1コンピュータデバイスまたは PDA。
QBluetoothDeviceInfo::PhoneDevice2電話端末。
QBluetoothDeviceInfo::NetworkDevice3ローカルエリアネットワークへのアクセスを提供するデバイス(Qt 5.13以降)。
QBluetoothDeviceInfo::AudioVideoDevice4オーディオおよび/またはビデオの再生またはキャプチャが可能なデバイス。
QBluetoothDeviceInfo::PeripheralDevice5キーボード、マウスなどの周辺機器。
QBluetoothDeviceInfo::ImagingDevice6ディスプレイ、プリンタ、スキャナ、カメラなどの画像出力デバイス。
QBluetoothDeviceInfo::WearableDevice7時計やポケットベルなどのウェアラブルデバイス。
QBluetoothDeviceInfo::ToyDevice8おもちゃ。
QBluetoothDeviceInfo::HealthDevice9心拍数や体温のモニターなどの健康関連デバイス。
QBluetoothDeviceInfo::UncategorizedDevice31他のどのデバイス分類にも該当しないデバイス。

enum QBluetoothDeviceInfo::MinorAudioVideoClass

この列挙型は、オーディオ/ビデオデバイスのマイナーデバイスクラスを定義します。

定数値説明
QBluetoothDeviceInfo::UncategorizedAudioVideoDevice0分類されていないオーディオ/ビデオデバイス。
QBluetoothDeviceInfo::WearableHeadsetDevice1ウェアラブルヘッドセットデバイス。
QBluetoothDeviceInfo::HandsFreeDevice2ハンズフリーデバイス。
QBluetoothDeviceInfo::Microphone4マイク。
QBluetoothDeviceInfo::Loudspeaker5スピーカー。
QBluetoothDeviceInfo::Headphones6ヘッドホン。
QBluetoothDeviceInfo::PortableAudioDevice7ポータブルオーディオ機器。
QBluetoothDeviceInfo::CarAudio8カーオーディオ機器。
QBluetoothDeviceInfo::SetTopBox9セットトップボックス。
QBluetoothDeviceInfo::HiFiAudioDevice10Hi-Fiオーディオ機器。
QBluetoothDeviceInfo::Vcr11ビデオカセットレコーダー。
QBluetoothDeviceInfo::VideoCamera12ビデオカメラ。
QBluetoothDeviceInfo::Camcorder13ビデオカメラ。
QBluetoothDeviceInfo::VideoMonitor14ビデオモニター。
QBluetoothDeviceInfo::VideoDisplayAndLoudspeaker15スピーカー内蔵のビデオディスプレイ。
QBluetoothDeviceInfo::VideoConferencing16テレビ会議装置。
QBluetoothDeviceInfo::GamingDevice18ゲーム機。

enum QBluetoothDeviceInfo::MinorComputerClass

この列挙型は、コンピュータデバイスのマイナーデバイスクラスを定義します。

定数値説明
QBluetoothDeviceInfo::UncategorizedComputer0分類されていないコンピュータデバイス。
QBluetoothDeviceInfo::DesktopComputer1デスクトップコンピュータ。
QBluetoothDeviceInfo::ServerComputer2サーバーコンピュータ。
QBluetoothDeviceInfo::LaptopComputer3ノートパソコン。
QBluetoothDeviceInfo::HandheldClamShellComputer4クラムシェル型のハンドヘルドコンピュータ、またはPDA。
QBluetoothDeviceInfo::HandheldComputer5ハンドヘルドコンピュータまたはPDA。
QBluetoothDeviceInfo::WearableComputer6ウェアラブルコンピュータ。

enum QBluetoothDeviceInfo::MinorHealthClass

この列挙型は、健康関連デバイスのマイナーデバイスクラスを定義するものです。

定数値説明
QBluetoothDeviceInfo::UncategorizedHealthDevice0分類されていないヘルスケアデバイス。
QBluetoothDeviceInfo::HealthBloodPressureMonitor0x1血圧計。
QBluetoothDeviceInfo::HealthThermometer0x2体温計。
QBluetoothDeviceInfo::HealthWeightScale0x3体重計。
QBluetoothDeviceInfo::HealthGlucoseMeter0x4血糖値測定器。
QBluetoothDeviceInfo::HealthPulseOximeter0x5血中酸素飽和度計。
QBluetoothDeviceInfo::HealthDataDisplay0x7データ表示器。
QBluetoothDeviceInfo::HealthStepCounter0x8歩数計。

enum QBluetoothDeviceInfo::MinorImagingClass

この列挙型は、画像処理デバイスのマイナーデバイスクラスを定義するものです。

定数値説明
QBluetoothDeviceInfo::UncategorizedImagingDevice0分類されていないイメージングデバイス。
QBluetoothDeviceInfo::ImageDisplay0x04画像を表示できるデバイス。
QBluetoothDeviceInfo::ImageCamera0x08カメラ。
QBluetoothDeviceInfo::ImageScanner0x10イメージスキャナー。
QBluetoothDeviceInfo::ImagePrinter0x20プリンター。

enum QBluetoothDeviceInfo::MinorMiscellaneousClass

この列挙型は、その他のBluetoothデバイスに対するマイナーデバイスクラスを定義するものです。

定数値説明
QBluetoothDeviceInfo::UncategorizedMiscellaneous0分類されていないその他のデバイス。

enum QBluetoothDeviceInfo::MinorNetworkClass

この列挙型は、ローカルエリアネットワークアクセスデバイスのマイナーデバイスクラスを定義します。ローカルエリアネットワークアクセスデバイスは、このマイナーデバイスクラスを使用して、現在のネットワーク使用状況を指定します。

定数値説明
QBluetoothDeviceInfo::NetworkFullService0x00総帯域幅の 100% が利用可能です。
QBluetoothDeviceInfo::NetworkLoadFactorOne0x08現在、総帯域幅の 0 ~ 17% が使用されています。
QBluetoothDeviceInfo::NetworkLoadFactorTwo0x10現在、総帯域幅の 17~33% が使用されています。
QBluetoothDeviceInfo::NetworkLoadFactorThree0x18現在、総帯域幅の 33 ~ 50% が使用されています。
QBluetoothDeviceInfo::NetworkLoadFactorFour0x20現在、総帯域幅の 50~67% が使用されています。
QBluetoothDeviceInfo::NetworkLoadFactorFive0x28現在、総帯域幅の 67~83% が使用されています。
QBluetoothDeviceInfo::NetworkLoadFactorSix0x30現在、総帯域幅の 83~99% が使用されています。
QBluetoothDeviceInfo::NetworkNoService0x38ネットワークサービスが利用できません。

enum QBluetoothDeviceInfo::MinorPeripheralClass

この列挙型は、周辺機器のマイナーデバイスクラスを定義するものです。

定数値説明
QBluetoothDeviceInfo::UncategorizedPeripheral0分類されていない周辺機器。
QBluetoothDeviceInfo::KeyboardPeripheral0x10キーボード。
QBluetoothDeviceInfo::PointingDevicePeripheral0x20ポインティングデバイス。例えばマウスなど。
QBluetoothDeviceInfo::KeyboardWithPointingDevicePeripheral0x30ポインティングデバイスが内蔵されたキーボード。
QBluetoothDeviceInfo::JoystickPeripheral0x01ジョイスティック。
QBluetoothDeviceInfo::GamepadPeripheral0x02ゲームパッド。
QBluetoothDeviceInfo::RemoteControlPeripheral0x03リモコン。
QBluetoothDeviceInfo::SensingDevicePeripheral0x04センシングデバイス。
QBluetoothDeviceInfo::DigitizerTabletPeripheral0x05デジタイザタブレットの周辺機器。
QBluetoothDeviceInfo::CardReaderPeripheral0x06カードリーダー周辺機器。

enum QBluetoothDeviceInfo::MinorPhoneClass

この列挙型は、電話端末のマイナーデバイスクラスを定義するものです。

定数値説明
QBluetoothDeviceInfo::UncategorizedPhone0分類されていない電話デバイス。
QBluetoothDeviceInfo::CellularPhone1携帯電話。
QBluetoothDeviceInfo::CordlessPhone2コードレス電話。
QBluetoothDeviceInfo::SmartPhone3スマートフォン。
QBluetoothDeviceInfo::WiredModemOrVoiceGatewayPhone4有線モデムまたは音声ゲートウェイ。
QBluetoothDeviceInfo::CommonIsdnAccessPhone5ISDNアクセスを提供するデバイス。

enum QBluetoothDeviceInfo::MinorToyClass

この列挙型は、おもちゃ用デバイスのマイナー・デバイス・クラスを定義するものです。

定数値説明
QBluetoothDeviceInfo::UncategorizedToy0分類されていないおもちゃ。
QBluetoothDeviceInfo::ToyRobot1おもちゃのロボット。
QBluetoothDeviceInfo::ToyVehicle2おもちゃの乗り物。
QBluetoothDeviceInfo::ToyDoll3おもちゃの人形またはアクションフィギュア。
QBluetoothDeviceInfo::ToyController4コントローラー。
QBluetoothDeviceInfo::ToyGame5ゲーム。

enum QBluetoothDeviceInfo::MinorWearableClass

この列挙型は、ウェアラブルデバイスのマイナーデバイスクラスを定義します。

定数値説明
QBluetoothDeviceInfo::UncategorizedWearableDevice0分類されていないウェアラブルデバイス。
QBluetoothDeviceInfo::WearableWristWatch1腕時計。
QBluetoothDeviceInfo::WearablePager2ポケットベル。
QBluetoothDeviceInfo::WearableJacket3ジャケット。
QBluetoothDeviceInfo::WearableHelmet4ヘルメット。
QBluetoothDeviceInfo::WearableGlasses5メガネ。

enum QBluetoothDeviceInfo::ServiceClass
flags QBluetoothDeviceInfo::ServiceClasses

この列挙型は、Bluetooth デバイスのサービスクラスを表します。サービスクラスは、サービス検出の基礎的な形式として使用されます。これは、デバイスが提供しうるサービスの種類の一覧を示すことを目的としています。

定数値説明
QBluetoothDeviceInfo::NoService0x0000デバイスはサービスを提供しません。
QBluetoothDeviceInfo::PositioningService0x0001デバイスは位置情報サービスを提供します。
QBluetoothDeviceInfo::NetworkingService0x0002このデバイスは、ネットワークサービスを提供します。
QBluetoothDeviceInfo::RenderingService0x0004このデバイスは、レンダリングサービスを提供します。
QBluetoothDeviceInfo::CapturingService0x0008このデバイスは、キャプチャサービスを提供します。
QBluetoothDeviceInfo::ObjectTransferService0x0010このデバイスは、オブジェクト転送サービスを提供します。
QBluetoothDeviceInfo::AudioService0x0020このデバイスは、オーディオサービスを提供します。
QBluetoothDeviceInfo::TelephonyService0x0040このデバイスは、電話サービスを提供します。
QBluetoothDeviceInfo::InformationService0x0080このデバイスは、情報サービスを提供します。
QBluetoothDeviceInfo::AllServices0x07ffこのデバイスは、すべての種類のサービスを提供します。

ServiceClasses 型は、QFlags<ServiceClass> の typedef です。これは、ServiceClass 値の OR 組み合わせを格納します。

メンバ関数のドキュメント

QBluetoothDeviceInfo::QBluetoothDeviceInfo()

無効な QBluetoothDeviceInfo オブジェクトを生成します。

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

Bluetoothアドレスaddress 、デバイス名name 、およびデバイスのエンコード済みクラスclassOfDevice を指定して、QBluetoothDeviceInfo オブジェクトを構築します。

classOfDevice パラメータは、以下の形式でエンコードされます。

ビットサイズ説明
0 - 12未使用。0に設定。
2 ~ 76マイナーデバイスクラス。
8 - 125主要デバイスクラス。
13~2311サービスクラス。

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

一意のuuid 、デバイス名name 、およびデバイスのエンコード済みクラスclassOfDevice を持つQBluetoothDeviceInfoオブジェクトを構築します。

このコンストラクタは、macOS および iOS 上の Low Energy デバイスに必須です。CoreBluetooth API はアドレスを非表示にし、デバイスを識別するための一意の UUID を提供します。この UUID はサービス UUID とは異なり、後で CoreBluetooth API や検出されたデバイスを操作するために必要です。

QBluetoothDeviceInfo::QBluetoothDeviceInfo(const QBluetoothDeviceInfo &other)

other のコピーである QBluetoothDeviceInfo を生成します。

[noexcept] QBluetoothDeviceInfo::~QBluetoothDeviceInfo()

QBluetoothDeviceInfo を削除します。

QBluetoothAddress QBluetoothDeviceInfo::address() const

デバイスのアドレスを返します。

注: iOS および macOSでは 、このアドレスは無効です。代わりに `deviceUuid()` を使用してください。これら 2 つのプラットフォームでは、検出された Bluetooth デバイスの Bluetooth アドレスは公開されておらず、一意のデバイス識別子が使用されています。

deviceUuid()も参照してください 。

QBluetoothDeviceInfo::CoreConfigurations QBluetoothDeviceInfo::coreConfigurations() const

デバイスの設定を返します。デバイスの設定が指定されていない場合は、基本レートのデバイス設定が返されます。

setCoreConfigurations()も参照してください 。

QBluetoothUuid QBluetoothDeviceInfo::deviceUuid() const

アドレスを持たないBluetoothデバイスに対する一意の識別子を返します。

一般的に、この UUID は macOS および iOS 以外のすべてのプラットフォームでは無効です。これは、これら 2 つのプラットフォームが検出された Bluetooth Low Energy デバイスに対して Bluetooth アドレスを提供しないため、その回避策として使用されます。その他のすべてのプラットフォームでは、代わりに `address()` を使用します。

setDeviceUuid()も参照してください 。

bool QBluetoothDeviceInfo::isCached() const

QBluetoothDeviceInfo オブジェクトがキャッシュされたデータから作成された場合、trueを返します。

bool QBluetoothDeviceInfo::isValid() const

QBluetoothDeviceInfo オブジェクトが有効な場合はtrueを返し、そうでない場合はfalseを返します。

QBluetoothDeviceInfo::MajorDeviceClass QBluetoothDeviceInfo::majorDeviceClass() const

そのデバイスの主要なデバイスクラスを返します。

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

アドバタイズメントパケットから、すべてのメーカーデータの完全なセットを返します。

デバイスによっては、1つのメーカーIDに対して複数のメーカーデータエントリを提供する場合があります。例として、アドバタイズメントパケットとスキャン応答パケットでそれぞれ異なるメーカーデータを送信するBluetooth Low Energyデバイスなどが挙げられます。そのため、返されるハッシュテーブルには、1つのメーカーIDまたはハッシュキーにつき複数のエントリが含まれる場合があります。

setManufacturerDataも参照してください 。

QByteArray QBluetoothDeviceInfo::manufacturerData(quint16 manufacturerId) const

指定されたmanufacturerId に関連付けられたデータを返します。

メーカーデータは、「Bluetoothコア仕様の補足」で定義されており、次の2つのセグメントで構成されます。

  • 「Assigned NumbersCompany Identifiers」文書に記載されたメーカー固有識別子コード
  • 任意のデータオクテットのシーケンス

データオクテットの解釈は、会社識別子によって指定されたメーカーによって定義されます。

注:リモートデバイスは 、1つの manufacturerId に対して複数のデータエントリを提供する場合があります。この関数は最初のエントリのみを返します。すべてのエントリが必要な場合は、マルチハッシュを返すmanufacturerData() を使用してください。

manufacturerIds() およびsetManufacturerData()も参照してください 。

QList<quint16> QBluetoothDeviceInfo::manufacturerIds() const

このデバイス情報に添付されたアドバタイズメントパケットから、すべてのメーカーIDを取得します。

manufacturerData() およびsetManufacturerData()も参照してください 。

quint8 QBluetoothDeviceInfo::minorDeviceClass() const

デバイスのマイナーデバイスクラスを返します。実際の情報は、majorDeviceClass() の値によって異なります。

関連項目: MinorAudioVideoClass 、MinorComputerClass 、MinorHealthClass 、MinorImagingClass 、MinorMiscellaneousClass 、MinorNetworkClass 、MinorPeripheralClass 、MinorPhoneClass 、MinorToyClass 、およびMinorWearableClass 。

QString QBluetoothDeviceInfo::name() const

デバイスに割り当てられた名前を返します。

setName()も参照してください 。

qint16 QBluetoothDeviceInfo::rssi() const

デバイスが最後にスキャンされた時点の信号強度を返します

setRssi()も参照してください 。

QBluetoothDeviceInfo::ServiceClasses QBluetoothDeviceInfo::serviceClasses() const

デバイスのサービスクラスを返します。

[since 6.3] QMultiHash<QBluetoothUuid, QByteArray> QBluetoothDeviceInfo::serviceData() const

アドバタイズメントパケットから取得したすべてのサービスデータの完全なセットを返します。

デバイスによっては、1つのサービスデータIDに対して複数のサービスデータエントリを提供する場合があります。例として、アドバタイズメントパケットとスキャン応答パケットでそれぞれ異なるサービスデータを送信するBluetooth Low Energyデバイスが挙げられます。そのため、返されるハッシュテーブルには、1つのサービスデータIDまたはハッシュキーにつき複数のエントリが含まれる場合があります。

この関数は Qt 6.3 で導入されました。

setServiceDataも参照してください 。

[since 6.3] QByteArray QBluetoothDeviceInfo::serviceData(const QBluetoothUuid &serviceId) const

指定されたserviceId に関連付けられたデータを返します。

サービスデータは、「Bluetoothコア仕様補足」で定義されており、次の2つのセグメントで構成されます。

  • サービスUUID
  • 任意のデータオクテットのシーケンス

注:リモートデバイスは 、serviceId ごとに複数のデータエントリを提供する場合があります。この関数は最初のエントリのみを返します。すべてのエントリが必要な場合は、マルチハッシュを返すserviceData()を使用してください。

この関数は Qt 6.3 で導入されました。

serviceIds() およびsetServiceData()も参照してください 。

[since 6.3] QList<QBluetoothUuid> QBluetoothDeviceInfo::serviceIds() const

このデバイス情報に紐付けられたアドバタイズメント・パケットから、すべてのサービスデータIDを返します。

この関数は Qt 6.3 で導入されました。

serviceData() およびsetServiceData()も参照してください 。

[since 6.0] QList<QBluetoothUuid> QBluetoothDeviceInfo::serviceUuids() const

そのデバイスがサポートするサービスのUUIDのリストを返します。通常、このUUIDのリストは、カスタムサービスのUUID、またはQBluetoothUuid::ServiceClassUuid で指定されたサービスのUUID値を表します。

この関数は Qt 6.0 で導入されました。

setServiceUuids() および serviceUuids()も参照してください 。

void QBluetoothDeviceInfo::setCached(bool cached)

QBluetoothDeviceInfo がキャッシュされたデータから作成された場合、システムがこのフラグを使用してcached フラグを設定します。キャッシュされた情報は、稼働中のデバイスから読み込まれたデータほど正確ではない場合があります。

isCached()も参照してください 。

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

デバイスのCoreConfigurations をcoreConfigs に設定します。これにより、通常のデバイスとLow Energyデバイスを区別しやすくなります。

coreConfigurations()も参照してください 。

void QBluetoothDeviceInfo::setDeviceUuid(const QBluetoothUuid &uuid)

アドレスを持たないBluetoothデバイスに対して、一意の識別子uuid を設定します。これは、CoreBluetooth APIがアドレスを非表示にし、代わりにデバイスや周辺機器を識別するためのUUIDを提供するmacOSおよびiOSで発生します。

この UUID は、他のプラットフォームでは無効です。

deviceUuid()も参照してください 。

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

指定されたmanufacturerId に対して、広告されるメーカーのdata を設定します。 が挿入された場合はtrue を、すでに認識されていた場合はfalse を返します。

Qt 5.11以降、同じmanufacturerId に対してdata の値が異なる場合、それらは互いに置き換えられることはなく、デバイススキャンが実行されている間、累積されるようになりました。

manufacturerDataも参照してください 。

[since 6.2] void QBluetoothDeviceInfo::setName(const QString &name)

デバイスのname を設定します。

この関数は Qt 6.2 で導入されました。

name()も参照してください 。

void QBluetoothDeviceInfo::setRssi(qint16 signal)

内部で使用されるsignal の強度値を設定します。

rssi()も参照してください 。

[since 6.3] bool QBluetoothDeviceInfo::setServiceData(const QBluetoothUuid &serviceId, const QByteArray &data)

指定されたserviceId に対して、data というサービスを公開するように設定します。サービスが追加された場合はtrue を、すでに登録されていた場合はfalse を返します。

この関数は Qt 6.3 で導入されました。

「serviceData」も参照してください 。

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

サービス UUID のリストを「uuids 」に設定します。

serviceUuids()も参照してください 。

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

other のコピーを作成し、それをこのQBluetoothDeviceInfo オブジェクトに割り当てます。

関連する非メンバー

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

2つのQBluetoothDeviceInfo オブジェクトa とb が等しくない場合、true を返します。

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

2つのQBluetoothDeviceInfo オブジェクトa とb が等しい場合、true を返します。

© 2026 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.