QLowEnergyDescriptor Class
QLowEnergyDescriptor クラスは、Bluetooth Low Energy 記述子に関する情報を格納します。詳細...
Header: | #include <QLowEnergyDescriptor> |
qmake: | QT += bluetooth |
パブリック関数
QLowEnergyDescriptor() | |
QLowEnergyDescriptor(const QLowEnergyDescriptor &other) | |
~QLowEnergyDescriptor() | |
bool | isValid() const |
QString | name() const |
QBluetoothUuid::DescriptorType | type() const |
QBluetoothUuid | uuid() const |
QByteArray | value() const |
QLowEnergyDescriptor & | operator=(const QLowEnergyDescriptor &other) |
関連する非メンバー
bool | operator!=(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b) |
bool | operator==(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b) |
詳細説明
QLowEnergyDescriptor は、Bluetooth Low Energy 記述子のname(),uuid(),value() に関する情報を提供します。記述子は、Bluetooth Low Energy 特性によってカプセル化され、特性に関する追加のコンテキスト情報(データ形式、通知の有効化など)を提供します。
記述子値は、この記述子が属するサービスを管理するQLowEnergyService インスタンスを通じて書き込むことができる。QLowEnergyService::writeDescriptor() 関数は、新しい値を書き込む。成功するとQLowEnergyService::descriptorWritten() シグナルが発行される。それに応じて、このオブジェクトのキャッシュvalue() が更新される。
QLowEnergyService およびQLowEnergyCharacteristicも参照 。
メンバ関数ドキュメント
QLowEnergyDescriptor::QLowEnergyDescriptor()
新しい QLowEnergyDescriptor を構築します。このクラスのデフォルトで構築されたインスタンスは常に無効です。
QLowEnergyDescriptor::QLowEnergyDescriptor(const QLowEnergyDescriptor &other)
other のコピーである新しい QLowEnergyDescriptor を構築します。
2つのコピーは、書き込み時に切り離されない同じ基礎データを共有し続けます。
[noexcept]
QLowEnergyDescriptor::~QLowEnergyDescriptor()
QLowEnergyDescriptor オブジェクトを破棄する。
bool QLowEnergyDescriptor::isValid() const
QLowEnergyDescriptor オブジェクトが有効な場合はtrue
を返し、そうでない場合はfalse
を返す。
無効な記述子インスタンスは、どのサービスとも関連付けられていないか(デフォルトで構築されている)、または関連付けられたサービスが、例えば基礎となるBluetooth Low Energyデバイスとの接続が切れたために、もはや有効でない。オブジェクトが無効になると、それ以上有効になることはありません。
注: QLowEnergyDescriptor インスタンスが基礎となるデバイスからの切断によって無効になった場合、現在のインスタンスによってカプセル化された情報は、切断時のまま残ります。そのため、切断イベントの後でも情報を取得することができます。
QString QLowEnergyDescriptor::name() const
ディスクリプタの人間が読める名前を返す。
この名前は、記述子のtype() に基づいている。記述子タイプの完全なリストは、Bluetooth.org Descriptorsにあります。
type() が不明な場合、返される文字列は空である。
type() およびQBluetoothUuid::descriptorToString()も参照してください 。
QBluetoothUuid::DescriptorType QLowEnergyDescriptor::type() const
ディスクリプタの型を返す。
name()も参照 。
QBluetoothUuid QLowEnergyDescriptor::uuid() const
isValid() がtrue
を返す場合、このディスクリプタの UUID を返す ; そうでない場合、null UUID を返す。
QByteArray QLowEnergyDescriptor::value() const
ディスクリプタのキャッシュ値を返す。
キャッシュされた記述子値は、QLowEnergyService::writeDescriptor() またはQLowEnergyService::readDescriptor() を使用して更新することができる。
QLowEnergyDescriptor &QLowEnergyDescriptor::operator=(const QLowEnergyDescriptor &other)
other のコピーを作成し、このQLowEnergyDescriptor オブジェクトに割り当てる。2つのコピーは、同じサービスとコントローラの詳細を共有し続ける。
関連する非会員
bool operator!=(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b)
a がb と等しくない場合はtrue
を返し、そうでない場合はfalse
を返す。
2つのQLowEnergyDescriptor インスタンスは、同じリモートのBluetooth Low Energyデバイスの同じ記述子を参照しているか、両方のインスタンスがデフォルトで構築されている場合、等しいとみなされる。
bool operator==(const QLowEnergyDescriptor &a, const QLowEnergyDescriptor &b)
a がb と等しい場合はtrue
を返し、そうでない場合はfalse
を返す。
2つのQLowEnergyDescriptor インスタンスは、同じリモートBluetooth Low Energyデバイス上の同じ記述子を参照しているか、両方のインスタンスがデフォルトで構築されている場合、等しいとみなされる。
© 2025 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.