이 페이지에서

QCoapResource Class

QCoapResource 클래스는 검색된 리소스에 대한 정보를 보관합니다. 더 보기...

헤더: #include <QCoapResource>
CMake: find_package(Qt6 REQUIRED COMPONENTS Coap)
target_link_libraries(mytarget PRIVATE Qt6::Coap)
qmake: QT += coap

참고: 이 클래스의 모든 함수는 재진입 가능합니다.

공개 함수

QCoapResource()
QCoapResource(const QCoapResource &other)
~QCoapResource()
uint contentFormat() const
QHostAddress host() const
QString interface() const
int maximumSize() const
bool observable() const
QString path() const
QString resourceType() const
void setContentFormat(uint contentFormat)
void setHost(const QHostAddress &host)
void setInterface(const QString &interface)
void setMaximumSize(int maximumSize)
void setObservable(bool observable)
void setPath(const QString &path)
void setResourceType(const QString &resourceType)
void setTitle(const QString &title)
void swap(QCoapResource &other)
QString title() const
QCoapResource &operator=(const QCoapResource &other)

상세 설명

QCoapRequest 에는 리소스의 경로 및 제목과 같은 데이터와 기타 부가 정보가 포함되어 있습니다.

QCoapResourceDiscoveryReply도 참조하십시오 .

멤버 함수 설명

QCoapResource::QCoapResource()

새로운 QCoapResource 객체를 생성합니다.

QCoapResource::QCoapResource(const QCoapResource &other)

other 의 복사본으로 새로운 CoAP 리소스를 생성하여, 두 리소스가 동일하게 만듭니다.

[noexcept] QCoapResource::~QCoapResource()

QCoapResource 를 파괴하라.

uint QCoapResource::contentFormat() const

리소스의 Content-Format 코드를 반환합니다.

Content-Format 코드는 'ct' 속성과 일치하며, 이 리소스가 반환하는 Content-Formats에 대한 정보를 제공합니다. 이는 RFC 7252에 명시되어 있습니다.

setContentFormat()도 참조하십시오 .

QHostAddress QCoapResource::host() const

리소스의 호스트를 반환합니다.

setHost()도 참조하십시오 .

QString QCoapResource::interface() const

리소스의 인터페이스 설명을 반환합니다.

인터페이스 설명의 'if' 속성은 대상 리소스와 상호 작용하는 데 사용되는 특정 인터페이스 정의를 나타내는 이름 또는 URI를 제공하기 위해 사용되는 불투명한 문자열입니다. 이는 RFC 6690에 명시되어 있습니다.

setInterface()도 참조하십시오 .

int QCoapResource::maximumSize() const

리소스의 최대 크기를 반환합니다.

최대 크기 추정 속성 'sz'는 대상 URI에 대해 GET 요청을 수행했을 때 반환되는 리소스 표현의 최대 크기를 나타냅니다. 이는 RFC 6690에 명시되어 있습니다.

setMaximumSize()도 참조하십시오 .

bool QCoapResource::observable() const

리소스가 관찰 가능한 경우 true 를 반환합니다.

setObservable()도 참조하십시오 .

QString QCoapResource::path() const

리소스의 경로를 반환합니다.

setPath()도 참조하십시오 .

QString QCoapResource::resourceType() const

리소스의 유형을 반환합니다.

setResourceType()도 참조하십시오 .

void QCoapResource::setContentFormat(uint contentFormat)

리소스의 콘텐츠 형식을 contentFormat 로 설정합니다. 콘텐츠 형식은 CoAP 콘텐츠 형식 레지스트리에 정의된 콘텐츠 형식 중 하나일 수 있습니다.

참고: CoAP는 XML, JSON 등과 같은 일반적인 콘텐츠 형식을 지원하지만, 이러한 형식은 텍스트 기반이므로 페이로드와 처리 양쪽 모두에서 부하가 큽니다. CoAP와 함께 사용하기에 권장되는 콘텐츠 형식 중 하나는 CBOR이며, 이는 이러한 환경에서 사용되도록 설계되었습니다.

또한 contentFormat(), QCborStreamWriter 및 QCborStreamReader 를참조하십시오 .

void QCoapResource::setHost(const QHostAddress &host)

리소스의 호스트를 host 로 설정합니다.

host()도 참조하십시오 .

void QCoapResource::setInterface(const QString &interface)

리소스의 인터페이스를 interface 로 설정합니다.

interface()도 참조하십시오 .

void QCoapResource::setMaximumSize(int maximumSize)

리소스의 최대 크기를 maximumSize 로 설정합니다.

maximumSize()도 참조하십시오 .

void QCoapResource::setObservable(bool observable)

observable 매개변수가 true 인 경우, 해당 리소스를 관찰 가능하게 만듭니다.

observable()도 참조하십시오 .

void QCoapResource::setPath(const QString &path)

리소스의 경로를 path 로 설정합니다.

path()도 참조하십시오 .

void QCoapResource::setResourceType(const QString &resourceType)

리소스 유형을 resourceType 로 설정합니다.

resourceType()도 참조하십시오 .

void QCoapResource::setTitle(const QString &title)

리소스의 제목을 title 로 설정합니다.

title()도 참조하십시오 .

[noexcept] void QCoapResource::swap(QCoapResource &other)

이 리소스를 other 와 교환합니다. 이 작업은 매우 빠르며 실패하는 일이 없습니다.

QString QCoapResource::title() const

리소스의 제목을 반환합니다.

setTitle()도 참조하십시오 .

QCoapResource &QCoapResource::operator=(const QCoapResource &other)

other 를 이 리소스로 복사하여 두 리소스를 동일하게 만듭니다. 이 QCoapResource 에 대한 참조를 반환합니다.

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