이 페이지에서

QLowEnergyDescriptor Class

QLowEnergyDescriptor 클래스는 블루투스 저에너지 디스크립터에 대한 정보를 저장합니다. 더 보기...

헤더: #include <QLowEnergyDescriptor>
CMake: find_package(Qt6 REQUIRED COMPONENTS Bluetooth)
target_link_libraries(mytarget PRIVATE Qt6::Bluetooth)
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 특성(characteristic)에 의해 캡슐화되며, 해당 특성에 대한 추가적인 컨텍스트 정보(데이터 형식, 알림 활성화 등)를 제공합니다.

디스크립터의 값은 이 디스크립터가 속한 서비스를 관리하는 QLowEnergyService 인스턴스를 통해 기록될 수 있습니다. QLowEnergyService::writeDescriptor() 함수는 새로운 값을 기록합니다. 성공 시 QLowEnergyService::descriptorWritten() 신호가 발생합니다. 이 객체의 캐시된 value()는 이에 따라 업데이트됩니다.

QLowEnergyService 및 QLowEnergyCharacteristic도 참조하십시오 .

멤버 함수 문서

QLowEnergyDescriptor::QLowEnergyDescriptor()

새로운 QLowEnergyDescriptor를 생성합니다. 이 클래스의 기본 생성된 인스턴스는 항상 유효하지 않습니다.

QLowEnergyDescriptor::QLowEnergyDescriptor(const QLowEnergyDescriptor &other)

other 의 복사본인 새로운 QLowEnergyDescriptor를 생성합니다.

이 두 복사본은 쓰기 작업 시에도 분리되지 않는 동일한 기본 데이터를 계속 공유합니다.

[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 객체에 할당합니다. 두 복사본은 계속해서 동일한 서비스 및 컨트롤러 정보를 공유합니다.

관련 비회원

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

a 가 b 와 같지 않은 경우 true 를 반환하고, 그렇지 않은 경우 false 를 반환합니다.

두 개의 QLowEnergyDescriptor 인스턴스는 동일한 원격 Bluetooth Low Energy 장치의 동일한 디스크립터를 참조하거나, 두 인스턴스 모두 기본 생성된 경우 서로 동일한 것으로 간주됩니다.

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

a 가 b 과 같으면 true 을 반환하고, 그렇지 않으면 false 을 반환합니다.

두 개의 QLowEnergyDescriptor 인스턴스는 동일한 원격 Bluetooth Low Energy 장치의 동일한 디스크립터를 참조하거나, 두 인스턴스 모두 기본 생성된 경우 서로 동일한 것으로 간주됩니다.

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