이 페이지에서

QLowEnergyConnectionParameters Class

QLowEnergyConnectionParameters 클래스는 Bluetooth LE 연결의 매개변수 업데이트를 요청하거나 보고할 때 사용됩니다. 더 보기...

헤더: #include <QLowEnergyConnectionParameters>
CMake: find_package(Qt6 REQUIRED COMPONENTS Bluetooth)
target_link_libraries(mytarget PRIVATE Qt6::Bluetooth)
qmake: QT += bluetooth

공개 함수

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()에 대해 미리 정의된 값 집합을 의미합니다. 또한, 각 범주의 값 범위는 Android 기기마다 다를 수 있습니다. Qt는 minimumInterval()를 사용하여 다음과 같이 대상 범주를 결정합니다:

minimumInterval()Android 우선순위
간격 < 30CONNECTION_PRIORITY_HIGH
30 <= interval <= 100CONNECTION_PRIORITY_BALANCED
간격 > 100CONNECTION_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 를 반환합니다.

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