CoAP
이 모듈에는 CoAP 통신을 제어하는 함수가 포함됩니다.
요약
이 모듈의 함수는 CoAP API 기능 (OPENTHREAD_CONFIG_COAP_API_ENABLE
)이 사용 설정된 경우 사용할 수 있습니다.
Typedef |
|
---|---|
otCoapBlockSzx
|
typedefenum otCoapBlockSzx
CoAP 블록 크기 지수입니다. |
otCoapBlockwiseReceiveHook)(void *aContext, const uint8_t *aBlock, uint32_t aPosition, uint16_t aBlockLength, bool aMore, uint32_t aTotalLength)
|
typedefotError(*
이 함수 포인터는 블록별 전송 옵션이 있는 CoAP 메시지를 수신할 때 호출됩니다. |
otCoapBlockwiseResource
|
typedefstruct otCoapBlockwiseResource
이 구조는 블록별 전송을 사용하는 CoAP 리소스를 나타냅니다. |
otCoapBlockwiseTransmitHook)(void *aContext, uint8_t *aBlock, uint32_t aPosition, uint16_t *aBlockLength, bool *aMore)
|
typedefotError(*
이 함수 포인터는 블록별 전송의 다음 블록이 전송되기 전에 호출됩니다. |
otCoapCode
|
typedefenum otCoapCode
CoAP 코드 값 |
otCoapOption
|
typedefstruct otCoapOption
이 구조는 CoAP 옵션을 나타냅니다. |
otCoapOptionContentFormat
|
typedef CoAP 콘텐츠 형식 코드입니다. |
otCoapOptionIterator
|
typedefstruct otCoapOptionIterator
이 구조는 CoAP 옵션의 반복자 역할을 합니다. |
otCoapOptionType
|
typedefenum otCoapOptionType
CoAP 옵션 번호 |
otCoapRequestHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
typedefvoid(*
지정된 Uri-Path가 있는 CoAP 요청이 수신되면 이 함수 포인터가 호출됩니다. |
otCoapResource
|
typedefstruct otCoapResource
이 구조는 CoAP 리소스를 나타냅니다. |
otCoapResponseHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
|
typedefvoid(*
이 함수 포인터는 CoAP 응답이 수신되거나 요청 시간 초과 시 호출됩니다. |
otCoapTxParameters
|
typedefstruct otCoapTxParameters
이 구조는 CoAP 전송 매개변수를 나타냅니다. |
otCoapType
|
typedefenum otCoapType
CoAP 유형 값 (2비트 부호 없는 정수) |
함수 |
|
---|---|
otCoapAddBlockWiseResource(otInstance *aInstance, otCoapBlockwiseResource *aResource)
|
void
이 함수는 CoAP 서버에 블록별 리소스를 추가합니다.
|
otCoapAddResource(otInstance *aInstance, otCoapResource *aResource)
|
void
이 함수는 CoAP 서버에 리소스를 추가합니다.
|
otCoapBlockSizeFromExponent(otCoapBlockSzx aSize)
|
uint16_t
이 함수는 CoAP 차단 옵션 SZX 필드를 실제 블록 크기로 변환합니다.
|
otCoapMessageAppendBlock1Option(otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize)
|
이 함수는 Block1 옵션을 추가합니다.
|
otCoapMessageAppendBlock2Option(otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize)
|
이 함수는 Block2 옵션을 추가합니다.
|
otCoapMessageAppendContentFormatOption(otMessage *aMessage, otCoapOptionContentFormat aContentFormat)
|
이 함수는 https://tools.ietf.org/html/rfc7252#page-92에 지정된 대로 Content Format CoAP 옵션을 추가합니다.
|
otCoapMessageAppendMaxAgeOption(otMessage *aMessage, uint32_t aMaxAge)
|
이 함수는 Max-Age 옵션을 추가합니다.
|
otCoapMessageAppendObserveOption(otMessage *aMessage, uint32_t aObserve)
|
이 함수는 관측 옵션을 추가합니다.
|
otCoapMessageAppendOption(otMessage *aMessage, uint16_t aNumber, uint16_t aLength, const void *aValue)
|
이 함수는 헤더에 CoAP 옵션을 추가합니다.
|
otCoapMessageAppendProxyUriOption(otMessage *aMessage, const char *aUriPath)
|
이 함수는 Proxy-Uri 옵션을 추가합니다.
|
otCoapMessageAppendUintOption(otMessage *aMessage, uint16_t aNumber, uint32_t aValue)
|
이 함수는 https://tools.ietf.org/html/rfc7252#section-3.2에 지정된 대로 부호 없는 정수 CoAP 옵션을 추가합니다.
|
otCoapMessageAppendUriPathOptions(otMessage *aMessage, const char *aUriPath)
|
이 함수는 Uri-Path 옵션을 추가합니다.
|
otCoapMessageAppendUriQueryOption(otMessage *aMessage, const char *aUriQuery)
|
이 함수는 단일 Uri-Query 옵션을 추가합니다.
|
otCoapMessageCodeToString(const otMessage *aMessage)
|
const char *
이 메서드는 CoAP 코드를 사람이 읽을 수 있는 문자열로 반환합니다.
|
otCoapMessageGenerateToken(otMessage *aMessage, uint8_t aTokenLength)
|
void
이 함수는 토큰 길이를 설정하고 해당 값을 무작위로 지정합니다.
|
otCoapMessageGetCode(const otMessage *aMessage)
|
이 함수는 코드 값을 반환합니다.
|
otCoapMessageGetMessageId(const otMessage *aMessage)
|
uint16_t
이 함수는 메시지 ID 값을 반환합니다.
|
otCoapMessageGetToken(const otMessage *aMessage)
|
const uint8_t *
이 함수는 토큰 값에 대한 포인터를 반환합니다.
|
otCoapMessageGetTokenLength(const otMessage *aMessage)
|
uint8_t
이 함수는 토큰 길이를 반환합니다.
|
otCoapMessageGetType(const otMessage *aMessage)
|
이 함수는 Type 값을 반환합니다.
|
otCoapMessageInit(otMessage *aMessage, otCoapType aType, otCoapCode aCode)
|
void
이 함수는 CoAP 헤더를 초기화합니다.
|
otCoapMessageInitResponse(otMessage *aResponse, const otMessage *aRequest, otCoapType aType, otCoapCode aCode)
|
이 함수는 응답 메시지를 초기화합니다.
|
otCoapMessageSetCode(otMessage *aMessage, otCoapCode aCode)
|
void
이 함수는 코드 값을 설정합니다.
|
otCoapMessageSetPayloadMarker(otMessage *aMessage)
|
이 함수는 CoAP 헤더에 페이로드의 시작을 나타내는 페이로드 마커를 추가합니다.
|
otCoapMessageSetToken(otMessage *aMessage, const uint8_t *aToken, uint8_t aTokenLength)
|
이 함수는 헤더의 토큰 값과 길이를 설정합니다.
|
otCoapNewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
|
이 함수는 새 CoAP 메시지를 만듭니다.
|
otCoapOptionIteratorGetFirstOption(otCoapOptionIterator *aIterator)
|
const otCoapOption *
이 함수는 첫 번째 옵션을 가리키는 포인터를 반환합니다.
|
otCoapOptionIteratorGetFirstOptionMatching(otCoapOptionIterator *aIterator, uint16_t aOption)
|
const otCoapOption *
이 함수는 지정된 옵션 번호와 일치하는 첫 번째 옵션을 가리키는 포인터를 반환합니다.
|
otCoapOptionIteratorGetNextOption(otCoapOptionIterator *aIterator)
|
const otCoapOption *
이 함수는 다음 옵션을 가리키는 포인터를 반환합니다.
|
otCoapOptionIteratorGetNextOptionMatching(otCoapOptionIterator *aIterator, uint16_t aOption)
|
const otCoapOption *
이 함수는 지정된 옵션 번호와 일치하는 다음 옵션에 관한 포인터를 반환합니다.
|
otCoapOptionIteratorGetOptionUintValue(otCoapOptionIterator *aIterator, uint64_t *aValue)
|
현재 값이 https://tools.ietf.org/html/rfc7252#section-3.2에 따라 인코딩된 부호 없는 정수라고 가정하면 이 함수는
aValue 에 현재 옵션 값을 입력합니다. |
otCoapOptionIteratorGetOptionValue(otCoapOptionIterator *aIterator, void *aValue)
|
이 함수는 현재 옵션 값을
aValue 에 채웁니다. |
otCoapOptionIteratorInit(otCoapOptionIterator *aIterator, const otMessage *aMessage)
|
이 함수는 특정 메일의 옵션 반복자를 초기화합니다.
|
otCoapRemoveBlockWiseResource(otInstance *aInstance, otCoapBlockwiseResource *aResource)
|
void
이 함수는 CoAP 서버에서 블록별 리소스를 삭제합니다.
|
otCoapRemoveResource(otInstance *aInstance, otCoapResource *aResource)
|
void
이 함수는 CoAP 서버에서 리소스를 삭제합니다.
|
otCoapSendRequest(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext)
|
이 함수는 CoAP 요청을 보냅니다.
|
otCoapSendRequestBlockWise(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook)
|
이 함수는 CoAP 요청을 블록별로 전송합니다.
|
otCoapSendRequestBlockWiseWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook)
|
이 함수는 커스텀 전송 매개변수와 함께 CoAP 요청을 블록별로 전송합니다.
|
otCoapSendRequestWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters)
|
이 함수는 맞춤 전송 매개변수와 함께 CoAP 요청을 전송합니다.
|
otCoapSendResponse(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo)
|
이 함수는 서버에서 CoAP 응답을 전송합니다.
|
otCoapSendResponseBlockWise(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook)
|
이 함수는 서버에서 블록별로 CoAP 응답을 전송합니다.
|
otCoapSendResponseBlockWiseWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook)
|
이 함수는 커스텀 전송 매개변수를 사용하여 서버에서 CoAP 응답을 블록별로 전송합니다.
|
otCoapSendResponseWithParameters(otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters)
|
이 함수는 커스텀 전송 매개변수와 함께 서버에서 CoAP 응답을 전송합니다.
|
otCoapSetDefaultHandler(otInstance *aInstance, otCoapRequestHandler aHandler, void *aContext)
|
void
이 함수는 처리되지 않은 CoAP 요청의 기본 핸들러를 설정합니다.
|
otCoapStart(otInstance *aInstance, uint16_t aPort)
|
이 함수는 CoAP 서버를 시작합니다.
|
otCoapStop(otInstance *aInstance)
|
이 함수는 CoAP 서버를 중지합니다.
|
구조체 |
|
---|---|
otCoapBlockwiseResource |
이 구조는 블록별 전송을 사용하는 CoAP 리소스를 나타냅니다. |
otCoapOption |
이 구조는 CoAP 옵션을 나타냅니다. |
otCoapOptionIterator를 참조하세요. |
이 구조는 CoAP 옵션의 반복자 역할을 합니다. |
otCoapResource |
이 구조는 CoAP 리소스를 나타냅니다. |
otCoapTxParameters |
이 구조는 CoAP 전송 매개변수를 나타냅니다. |
열거
otCoapBlockSzx
otCoapBlockSzx
CoAP 블록 크기 지수입니다.
otCoapCode
otCoapCode
CoAP 코드 값
otCoapOptionContentFormat
otCoapOptionContentFormat
CoAP 콘텐츠 형식 코드입니다.
전체 목록은 https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats에 설명되어 있습니다.
속성 | |
---|---|
OT_COAP_OPTION_CONTENT_FORMAT_CBOR
|
application/cbor: [RFC7049] |
OT_COAP_OPTION_CONTENT_FORMAT_COAP_GROUP_JSON
|
application/coap-group+json: [RFC7390] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_ENCRYPT
|
애플리케이션/코스 cose-type="cose-encrypt": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_ENCRYPT0
|
애플리케이션/코스 cose-type="cose-encrypt0": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_KEY
|
애플리케이션/코스 키: [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_KEY_SET
|
application/cose-key-set: [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_MAC
|
애플리케이션/코스 cose-type="cose-mac": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_MAC0
|
애플리케이션/코스 cose-type="cose-mac0": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_SIGN
|
애플리케이션/코스 cose-type="cose-sign": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_COSE_SIGN1
|
애플리케이션/코스 cose-type="cose-sign1": [RFC8152] |
OT_COAP_OPTION_CONTENT_FORMAT_CWT
|
application/cwt: [RFC8392] |
OT_COAP_OPTION_CONTENT_FORMAT_EXI
|
application/exi: ["Efficient XML Interchange (EXI) Format 1.0 (second Edition)", 2014년 2월] |
OT_COAP_OPTION_CONTENT_FORMAT_JSON
|
application/json: [RFC7159] |
OT_COAP_OPTION_CONTENT_FORMAT_JSON_PATCH_JSON
|
application/json-patch+json: [RFC6902] |
OT_COAP_OPTION_CONTENT_FORMAT_LINK_FORMAT
|
애플리케이션/링크 형식: [RFC6690] |
OT_COAP_OPTION_CONTENT_FORMAT_MERGE_PATCH_JSON
|
application/merge-patch+json: [RFC7396] |
OT_COAP_OPTION_CONTENT_FORMAT_OCTET_STREAM
|
application/octet-stream: [RFC2045][RFC2046] |
OT_COAP_OPTION_CONTENT_FORMAT_SENML_CBOR
|
application/senml+cbor: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENML_EXI
|
application/senml-exi: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENML_JSON
|
application/senml+json: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENML_XML
|
application/senml+xml: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENSML_CBOR
|
application/sensml+cbor: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENSML_EXI
|
application/sensml-exi: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENSML_JSON
|
application/sensml+json: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_SENSML_XML
|
application/sensml+xml: [RFC8428] |
OT_COAP_OPTION_CONTENT_FORMAT_TEXT_PLAIN
|
text/plain; charset=utf-8: [RFC2046][RFC3676][RFC5147] |
OT_COAP_OPTION_CONTENT_FORMAT_XML
|
application/xml: [RFC3023] |
otCoapOptionType
otCoapOptionType
CoAP 옵션 번호
속성 | |
---|---|
OT_COAP_OPTION_ACCEPT
|
동의합니다. |
OT_COAP_OPTION_BLOCK1
|
Block1 (RFC7959) |
OT_COAP_OPTION_BLOCK2
|
Block2 (RFC7959) |
OT_COAP_OPTION_CONTENT_FORMAT
|
콘텐츠 형식. |
OT_COAP_OPTION_E_TAG
|
ETag |
OT_COAP_OPTION_IF_MATCH
|
If-Match |
OT_COAP_OPTION_IF_NONE_MATCH
|
If-None-Match |
OT_COAP_OPTION_LOCATION_PATH
|
위치 경로. |
OT_COAP_OPTION_LOCATION_QUERY
|
위치-쿼리 |
OT_COAP_OPTION_MAX_AGE
|
최대 기간 |
OT_COAP_OPTION_OBSERVE
|
[RFC7641]을 준수합니다. |
OT_COAP_OPTION_PROXY_SCHEME
|
프록시 스키마. |
OT_COAP_OPTION_PROXY_URI
|
Proxy-Uri. |
OT_COAP_OPTION_SIZE1
|
크기1. |
OT_COAP_OPTION_SIZE2
|
Size2 (RFC7959) |
OT_COAP_OPTION_URI_HOST
|
URI-호스트 |
OT_COAP_OPTION_URI_PATH
|
Uri-Path입니다. |
OT_COAP_OPTION_URI_PORT
|
URI-포트. |
OT_COAP_OPTION_URI_QUERY
|
Uri-Query |
otCoapType
otCoapType
CoAP 유형 값 (2비트 부호 없는 정수)
속성 | |
---|---|
OT_COAP_TYPE_ACKNOWLEDGMENT
|
확인. |
OT_COAP_TYPE_CONFIRMABLE
|
확인 가능. |
OT_COAP_TYPE_NON_CONFIRMABLE
|
확인되지 않음 |
OT_COAP_TYPE_RESET
|
재설정을 탭합니다. |
Typedef
otCoapBlockwiseReceiveHook
otError(* otCoapBlockwiseReceiveHook)(void *aContext, const uint8_t *aBlock, uint32_t aPosition, uint16_t aBlockLength, bool aMore, uint32_t aTotalLength)
이 함수 포인터는 블록별 전송 옵션이 있는 CoAP 메시지를 수신할 때 호출됩니다.
이 함수는 OPENWARNING_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 사용 설정된 경우 사용할 수 있습니다.
세부정보 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||||
반환 값 |
|
otCoapBlockwiseResource
struct otCoapBlockwiseResource otCoapBlockwiseResource
이 구조는 블록별 전송을 사용하는 CoAP 리소스를 나타냅니다.
otCoapBlockwiseTransmitHook
otError(* otCoapBlockwiseTransmitHook)(void *aContext, uint8_t *aBlock, uint32_t aPosition, uint16_t *aBlockLength, bool *aMore)
이 함수 포인터는 블록별 전송의 다음 블록이 전송되기 전에 호출됩니다.
이 함수는 OPENWARNING_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 사용 설정된 경우 사용할 수 있습니다.
aBlockLength 값을 변경하면 전체 거래소의 블록 크기가 재협상됩니다. 이후에 변경하면 다른 CoAP 구현에 문제가 발생할 수 있으므로 첫 번째 블록을 수신한 후에 이 작업을 수행하는 것이 좋습니다.
세부정보 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||
반환 값 |
|
otCoapOptionContentFormat
enum otCoapOptionContentFormat otCoapOptionContentFormat
CoAP 콘텐츠 형식 코드입니다.
전체 목록은 https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats에 설명되어 있습니다.
otCoapOptionIterator를 참고하세요.
struct otCoapOptionIterator otCoapOptionIterator
이 구조는 CoAP 옵션의 반복자 역할을 합니다.
otCoapRequestHandler
void(* otCoapRequestHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
지정된 Uri-Path가 있는 CoAP 요청이 수신되면 이 함수 포인터가 호출됩니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
otCoapResponseHandler
void(* otCoapResponseHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
이 함수 포인터는 CoAP 응답이 수신되거나 요청 시간 초과 시 호출됩니다.
세부정보 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||
반환 값 |
|
otCoapTxParameters
struct otCoapTxParameters otCoapTxParameters
이 구조는 CoAP 전송 매개변수를 나타냅니다.
에서 삭제할 수 있습니다.함수
otCoapAddBlockWiseResource
void otCoapAddBlockWiseResource( otInstance *aInstance, otCoapBlockwiseResource *aResource )
이 함수는 CoAP 서버에 블록별 리소스를 추가합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
otCoapAddResource
void otCoapAddResource( otInstance *aInstance, otCoapResource *aResource )
이 함수는 CoAP 서버에 리소스를 추가합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
otCoapBlockSizeFrom지수
uint16_t otCoapBlockSizeFromExponent( otCoapBlockSzx aSize )
이 함수는 CoAP 차단 옵션 SZX 필드를 실제 블록 크기로 변환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 |
실제 크기 지수 값입니다.
|
otCoapMessageAppendBlock1Option
otError otCoapMessageAppendBlock1Option( otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize )
이 함수는 Block1 옵션을 추가합니다.
세부정보 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||
반환 값 |
|
otCoapMessageAppendBlock2Option
otError otCoapMessageAppendBlock2Option( otMessage *aMessage, uint32_t aNum, bool aMore, otCoapBlockSzx aSize )
이 함수는 Block2 옵션을 추가합니다.
세부정보 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||
반환 값 |
|
otCoapMessageAppendContentFormatOption
otError otCoapMessageAppendContentFormatOption( otMessage *aMessage, otCoapOptionContentFormat aContentFormat )
이 함수는 https://tools.ietf.org/html/rfc7252#page-92에 지정된 대로 Content Format CoAP 옵션을 추가합니다.
페이로드가 메시지에 포함될 경우 otCoapMessageSetPayloadMarker를 설정하기 전에 반드시 호출해야 합니다.
이 함수는 otCoapMessageAppendUintOption의 편의 래퍼이며 원하는 형식 유형 코드가 otCoapOptionContentFormat에 포함되어 있지 않으면 대신 이 기본 함수를 사용해야 합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageAppendMaxAgeOption
otError otCoapMessageAppendMaxAgeOption( otMessage *aMessage, uint32_t aMaxAge )
이 함수는 Max-Age 옵션을 추가합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageAppendObserveOption입니다.
otError otCoapMessageAppendObserveOption( otMessage *aMessage, uint32_t aObserve )
이 함수는 관측 옵션을 추가합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageAppendOption
otError otCoapMessageAppendOption( otMessage *aMessage, uint16_t aNumber, uint16_t aLength, const void *aValue )
이 함수는 헤더에 CoAP 옵션을 추가합니다.
세부정보 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||
반환 값 |
|
otCoapMessageAppendProxyUriOption입니다.
otError otCoapMessageAppendProxyUriOption( otMessage *aMessage, const char *aUriPath )
이 함수는 Proxy-Uri 옵션을 추가합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageAppendUintOption
otError otCoapMessageAppendUintOption( otMessage *aMessage, uint16_t aNumber, uint32_t aValue )
이 함수는 https://tools.ietf.org/html/rfc7252#section-3.2에 지정된 대로 부호 없는 정수 CoAP 옵션을 추가합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageGetOptionUintValue
otCoapMessageAppendUriPathOptions
otError otCoapMessageAppendUriPathOptions( otMessage *aMessage, const char *aUriPath )
이 함수는 Uri-Path 옵션을 추가합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageAppendUriQueryOption
otError otCoapMessageAppendUriQueryOption( otMessage *aMessage, const char *aUriQuery )
이 함수는 단일 Uri-Query 옵션을 추가합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageCodeToString
const char * otCoapMessageCodeToString( const otMessage *aMessage )
이 메서드는 CoAP 코드를 사람이 읽을 수 있는 문자열로 반환합니다.
@ 는 CoAP 코드를 문자열로 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
otCoapMessageGenerateToken
void otCoapMessageGenerateToken( otMessage *aMessage, uint8_t aTokenLength )
이 함수는 토큰 길이를 설정하고 해당 값을 무작위로 지정합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
otCoapMessageGetCode
otCoapCode otCoapMessageGetCode( const otMessage *aMessage )
이 함수는 코드 값을 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 |
코드 값입니다.
|
otCoapMessageGetMessageId입니다.
uint16_t otCoapMessageGetMessageId( const otMessage *aMessage )
이 함수는 메시지 ID 값을 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 |
메시지 ID 값입니다.
|
otCoapMessageGetToken
const uint8_t * otCoapMessageGetToken( const otMessage *aMessage )
이 함수는 토큰 값에 대한 포인터를 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 |
토큰 값을 가리키는 포인터입니다.
|
otCoapMessageGetTokenLength
uint8_t otCoapMessageGetTokenLength( const otMessage *aMessage )
이 함수는 토큰 길이를 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 |
토큰 길이
|
otCoapMessageGetType
otCoapType otCoapMessageGetType( const otMessage *aMessage )
이 함수는 Type 값을 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 |
유형 값입니다.
|
otCoapMessageInit
void otCoapMessageInit( otMessage *aMessage, otCoapType aType, otCoapCode aCode )
이 함수는 CoAP 헤더를 초기화합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
otCoapMessageInitResponse
otError otCoapMessageInitResponse( otMessage *aResponse, const otMessage *aRequest, otCoapType aType, otCoapCode aCode )
이 함수는 응답 메시지를 초기화합니다.
세부정보 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||
반환 값 |
|
otCoapMessageSetCode 코드
void otCoapMessageSetCode( otMessage *aMessage, otCoapCode aCode )
이 함수는 코드 값을 설정합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
otCoapMessageSetPayloadMarker
otError otCoapMessageSetPayloadMarker( otMessage *aMessage )
이 함수는 CoAP 헤더에 페이로드의 시작을 나타내는 페이로드 마커를 추가합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 값 |
|
otCoapMessageSetToken
otError otCoapMessageSetToken( otMessage *aMessage, const uint8_t *aToken, uint8_t aTokenLength )
이 함수는 헤더의 토큰 값과 길이를 설정합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapNewMessage
otMessage * otCoapNewMessage( otInstance *aInstance, const otMessageSettings *aSettings )
이 함수는 새 CoAP 메시지를 만듭니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 |
메시지 버퍼 포인터 또는 사용 가능한 메시지 버퍼가 없거나 매개변수가 유효하지 않은 경우 NULL.
|
otCoapOptionIteratorGetFirstOption
const otCoapOption * otCoapOptionIteratorGetFirstOption( otCoapOptionIterator *aIterator )
이 함수는 첫 번째 옵션을 가리키는 포인터를 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 |
첫 번째 옵션을 가리키는 포인터입니다. 옵션이 없으면 NULL 포인터가 반환됩니다.
|
otCoapOptionIteratorGetFirstOptionMatching
const otCoapOption * otCoapOptionIteratorGetFirstOptionMatching( otCoapOptionIterator *aIterator, uint16_t aOption )
이 함수는 지정된 옵션 번호와 일치하는 첫 번째 옵션을 가리키는 포인터를 반환합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 |
첫 번째 일치 옵션을 가리키는 포인터입니다. 일치하는 옵션이 없으면 NULL 포인터가 반환됩니다.
|
otCoapOptionIteratorGetNextOption
const otCoapOption * otCoapOptionIteratorGetNextOption( otCoapOptionIterator *aIterator )
이 함수는 다음 옵션을 가리키는 포인터를 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 |
다음 옵션을 가리키는 포인터입니다. 더 이상 옵션이 없으면 NULL 포인터가 반환됩니다.
|
otCoapOptionIteratorGetNextOptionMatching
const otCoapOption * otCoapOptionIteratorGetNextOptionMatching( otCoapOptionIterator *aIterator, uint16_t aOption )
이 함수는 지정된 옵션 번호와 일치하는 다음 옵션에 관한 포인터를 반환합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 |
다음 일치 옵션을 가리키는 포인터입니다. 더 이상 일치하는 옵션이 없으면 NULL 포인터가 반환됩니다.
|
otCoapOptionIteratorGetOptionUintValue
otError otCoapOptionIteratorGetOptionUintValue( otCoapOptionIterator *aIterator, uint64_t *aValue )
현재 값이 https://tools.ietf.org/html/rfc7252#section-3.2에 따라 인코딩된 부호 없는 정수라고 가정하면 이 함수는 aValue
에 현재 옵션 값을 입력합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageAppendUintOption
otCoapOptionIteratorGetOptionValue
otError otCoapOptionIteratorGetOptionValue( otCoapOptionIterator *aIterator, void *aValue )
이 함수는 현재 옵션 값을 aValue
에 채웁니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 값 |
|
otCoapOptionIteratorInit
otError otCoapOptionIteratorInit( otCoapOptionIterator *aIterator, const otMessage *aMessage )
이 함수는 특정 메일의 옵션 반복자를 초기화합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 값 |
|
otCoapRemoveBlockWiseResource
void otCoapRemoveBlockWiseResource( otInstance *aInstance, otCoapBlockwiseResource *aResource )
이 함수는 CoAP 서버에서 블록별 리소스를 삭제합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
otCoapRemoveResource
void otCoapRemoveResource( otInstance *aInstance, otCoapResource *aResource )
이 함수는 CoAP 서버에서 리소스를 삭제합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
otCoapSendRequest 요청
otError otCoapSendRequest( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext )
이 함수는 CoAP 요청을 보냅니다.
요청에 대한 응답이 예상되는 경우 각 함수와 컨텍스트 정보를 제공해야 합니다. 응답이 예상되지 않는 경우 이 인수는 NULL 포인터여야 합니다.
세부정보 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||
반환 값 |
|
otCoapSendRequestBlockWise
otError otCoapSendRequestBlockWise( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook )
이 함수는 CoAP 요청을 블록별로 전송합니다.
이 함수는 OPENWARNING_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 사용 설정된 경우 사용할 수 있습니다.
요청에 대한 응답이 예상되는 경우 각 함수와 컨텍스트 정보를 제공해야 합니다. 응답이 블록 방식의 것으로 예상되는 경우 각 후크 함수를 제공해야 합니다. 응답이 예상되지 않는 경우 이 인수는 NULL 포인터여야 합니다.
세부정보 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||||||
반환 값 |
|
otCoapSendRequestBlockWiseWithParameters
otError otCoapSendRequestBlockWiseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters, otCoapBlockwiseTransmitHook aTransmitHook, otCoapBlockwiseReceiveHook aReceiveHook )
이 함수는 커스텀 전송 매개변수와 함께 CoAP 요청을 블록별로 전송합니다.
이 함수는 OPENWARNING_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 사용 설정된 경우 사용할 수 있습니다.
요청에 대한 응답이 예상되는 경우 각 함수와 컨텍스트 정보를 제공해야 합니다. 응답이 블록 방식의 것으로 예상되는 경우 각 후크 함수를 제공해야 합니다. 응답이 예상되지 않는 경우 이 인수는 NULL 포인터여야 합니다.
세부정보 | |||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||||||||
반환 값 |
|
otCoapSendRequestWithParameters
otError otCoapSendRequestWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, otCoapResponseHandler aHandler, void *aContext, const otCoapTxParameters *aTxParameters )
이 함수는 맞춤 전송 매개변수와 함께 CoAP 요청을 전송합니다.
요청에 대한 응답이 예상되는 경우 각 함수와 컨텍스트 정보를 제공해야 합니다. 응답이 예상되지 않는 경우 이 인수는 NULL 포인터여야 합니다.
세부정보 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||||
반환 값 |
|
otCoapSendResponse
otError otCoapSendResponse( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo )
이 함수는 서버에서 CoAP 응답을 전송합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapSendResponseBlockWise
otError otCoapSendResponseBlockWise( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook )
이 함수는 서버에서 블록별로 CoAP 응답을 전송합니다.
이 함수는 OPENWARNING_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 사용 설정된 경우 사용할 수 있습니다.
세부정보 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||
반환 값 |
|
otCoapSendResponseBlockWiseWithParameters
otError otCoapSendResponseBlockWiseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook )
이 함수는 커스텀 전송 매개변수를 사용하여 서버에서 CoAP 응답을 블록별로 전송합니다.
이 함수는 OPENWARNING_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 사용 설정된 경우 사용할 수 있습니다.
세부정보 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||||
반환 값 |
|
otCoapSendResponseWithParameters
otError otCoapSendResponseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters )
이 함수는 커스텀 전송 매개변수와 함께 서버에서 CoAP 응답을 전송합니다.
세부정보 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||
반환 값 |
|
otCoapSetDefaultHandler
void otCoapSetDefaultHandler( otInstance *aInstance, otCoapRequestHandler aHandler, void *aContext )
이 함수는 처리되지 않은 CoAP 요청의 기본 핸들러를 설정합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
otCoapStart
otError otCoapStart( otInstance *aInstance, uint16_t aPort )
이 함수는 CoAP 서버를 시작합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 값 |
|
otCoapStop
otError otCoapStop( otInstance *aInstance )
이 함수는 CoAP 서버를 중지합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 값 |
|
매크로
OT_COAP_CODE(OT_코드)
OT_COAP_CODE ((((c)&0x7) << 5) | ((d)&0x1f))
CoAP 코드 값을 정의하는 도우미 매크로입니다.
OT_COAP_DEFAULT_TOKEN_LENGTH
OT_COAP_DEFAULT_TOKEN_LENGTH 2
기본 토큰 길이입니다.
OT_COAP_MAX_RETRANSMIT
OT_COAP_MAX_RETRANSMIT 20
OpenThread에서 지원되는 최대 재전송.
연장_COAP_MAX_TOKEN_LENGTH
OT_COAP_MAX_TOKEN_LENGTH 8
지정된 최대 토큰 길이 (RFC 7252)
OT_COAP_MIN_ACK_TIMEOUT
OT_COAP_MIN_ACK_TIMEOUT 1000
OpenThread에서 지원하는 밀리초 단위의 최소 ACK 제한 시간입니다.
OT_DEFAULT_COAP_PORT(OT_기본값_COAP_PORT)
OT_DEFAULT_COAP_PORT 5683
RFC 7252에 지정된 기본 CoAP 포트입니다.
리소스
OpenThread API 참조 주제는 GitHub에서 제공되는 소스 코드에서 시작됩니다. 자세한 내용을 알아보거나 문서에 기여하려면 리소스를 참조하세요.