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) |
상세 설명
연결 매개변수는 마스터 장치와 슬레이브 장치가 서로 동기화하는 빈도에 영향을 줍니다. 일반적으로 연결 간격과 지연 시간이 짧을수록 통신 속도가 빨라지지만 전력 소비도 증가합니다. 이러한 기준을 서로 비교하여 평가하는 방법은 구체적인 사용 사례에 따라 크게 달라집니다.
Android에서는 이 매개변수 세트의 조정을 간접적으로만 허용합니다. 플랫폼은 연결 매개변수를 세 가지 범주(높음, 낮음 및 균형 우선순위)로 구분합니다. 각 카테고리는 minimumInterval(), maximumInterval() 및 latency()에 대해 미리 정의된 값 집합을 의미합니다. 또한 각 카테고리의 값 범위는 안드로이드 기기마다 다를 수 있습니다. Qt는 minimumInterval()를 사용하여 다음과 같이 대상 카테고리를 결정합니다:
minimumInterval() | 안드로이드 우선순위 |
---|---|
간격 < 30 | connection_priority_high |
30 <= 간격 <= 100 | connection_priority_balanced |
간격 > 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.