QLowEnergyConnectionParameters Class
QLowEnergyConnectionParameters クラスは、Bluetooth LE 接続のパラメータの更新を要求または報告する際に使用します。詳細...
Header: | #include <QLowEnergyConnectionParameters> |
qmake: | QT += bluetooth |
- 継承されたメンバーを含む全メンバーのリスト
- QLowEnergyConnectionParameters は暗黙の共有クラスに属しています。
パブリック関数
QLowEnergyConnectionParameters() | |
QLowEnergyConnectionParameters(const QLowEnergyConnectionParameters &other) | |
~QLowEnergyConnectionParameters() | |
int | latency() const |
double | maximumInterval() const |
double | minimumInterval() const |
void | setIntervalRange(double minimum, double maximum) |
void | setLatency(int latency) |
void | setSupervisionTimeout(int timeout) |
int | supervisionTimeout() const |
void | swap(QLowEnergyConnectionParameters &other) |
QLowEnergyConnectionParameters & | operator=(const QLowEnergyConnectionParameters &other) |
関連する非メンバー
bool | operator!=(const QLowEnergyConnectionParameters &p1, const QLowEnergyConnectionParameters &p2) |
bool | operator==(const QLowEnergyConnectionParameters &p1, const QLowEnergyConnectionParameters &p2) |
詳細説明
接続パラメータは、マスターとスレーブデバイスが互いに同期する頻度に影響します。一般的に、接続間隔とレイテンシが低いほど通信は速くなりますが、消費電力も高くなります。これらの基準をどのように天秤にかけるべきかは、具体的なユースケースに大きく依存する。
アンドロイドは、このパラメーターセットの調整を間接的にしか許可していない。プラットフォームは、接続パラメーターを3つのカテゴリー(高優先度、低優先度、バランス優先度)に分けている。各カテゴリは、minimumInterval ()、maximumInterval ()、latency ()の値の事前定義セットを意味します。さらに、各カテゴリの値の範囲は、Android デバイスによって異なる場合があります。Qtは、minimumInterval()を使用して、以下のようにターゲット・カテゴリーを決定します:
minimumInterval() | Androidの優先度 |
---|---|
インターバル < 30 | connection_priority_high |
30 <= 間隔 <= 100 | コネクション・プライオリティ・バランス |
インターバル > 100 | connection_priority_low_power |
supervisionTimeout() はAndroidでは変更できないため、無視される。
QLowEnergyController::requestConnectionUpdate およびQLowEnergyController::connectionUpdatedも参照のこと 。
メンバー関数ドキュメント
QLowEnergyConnectionParameters::QLowEnergyConnectionParameters()
このクラスの新しいオブジェクトを構築します。すべての値は有効なデフォルト値に初期化されます。
QLowEnergyConnectionParameters::QLowEnergyConnectionParameters(const QLowEnergyConnectionParameters &other)
other のコピーである、このクラスの新しいオブジェクトを構築する。
[noexcept]
QLowEnergyConnectionParameters::~QLowEnergyConnectionParameters()
このオブジェクトを破壊する。
int QLowEnergyConnectionParameters::latency() const
接続のスレーブ待ち時間を返す。
setLatency()も参照 。
double QLowEnergyConnectionParameters::maximumInterval() const
最大接続間隔をミリ秒単位で返します。デフォルトは 4000。
注意: このオブジェクトがQLowEnergyController::connectionUpdated() 経由で発行された場合、この値はminimumInterval() と同じであり、実際の接続間隔を指す。
setIntervalRange()も参照 。
double QLowEnergyConnectionParameters::minimumInterval() const
最小接続間隔をミリ秒単位で返します。デフォルトは 7.5。
注意: このオブジェクトがQLowEnergyController::connectionUpdated() 経由で発行された場合は、この値はmaximumInterval() と同じであり、実際の接続間隔を指す。
setIntervalRange()も参照 。
void QLowEnergyConnectionParameters::setIntervalRange(double minimum, double maximum)
接続間隔の範囲を設定します。実際の値はコントローラが決定する。minimum とmaximum の両方がミリ秒単位で指定される。maximum がminimum よりも小さい場合、minimum の値が設定される。 可能な接続間隔の最小値は7.5ミリ秒、最大値は4000ミリ秒である。
minimumInterval() およびmaximumInterval()も参照の こと。
void QLowEnergyConnectionParameters::setLatency(int latency)
接続のスレーブ・レイテンシ(つまり、スレーブ・デバイスが無視することを許される接続イベントの数)をlatency に設定する。 最小値は 0 で、最大値は 499 である。
latency()も参照 。
void QLowEnergyConnectionParameters::setSupervisionTimeout(int timeout)
リンク監視のタイムアウトをtimeout ミリ秒に設定する。この値にはいくつかの制約がある:100,32000]の範囲でなければならず、(1 +latency()) * 2 *maximumInterval() よりも大きくなければならない。
Androidでは、このタイムアウトは調整できないため、無視される。
supervisionTimeout()も参照のこと 。
int QLowEnergyConnectionParameters::supervisionTimeout() const
接続のリンク監視タイムアウトをミリ秒単位で返します。
setSupervisionTimeout()も参照 。
[noexcept]
void QLowEnergyConnectionParameters::swap(QLowEnergyConnectionParameters &other)
このオブジェクトをother と交換する。
QLowEnergyConnectionParameters &QLowEnergyConnectionParameters::operator=(const QLowEnergyConnectionParameters &other)
このオブジェクトをother のコピーとし、このオブジェクトの新しい値を返す。
関連する非会員
bool operator!=(const QLowEnergyConnectionParameters &p1, const QLowEnergyConnectionParameters &p2)
p1 とp2 が公開状態に関して等しくなければtrue
を返し、そうでなければfalse
を返す。
bool operator==(const QLowEnergyConnectionParameters &p1, const QLowEnergyConnectionParameters &p2)
p1 とp2 が公開状態に関して等しい場合はtrue
を返し、そうでない場合はfalse
を返す。
© 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.