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 경로가 있는 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 Block 옵션 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에 지정된 대로 콘텐츠 형식 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 경로 옵션을 추가합니다.
|
otCoapMessageAppendUriQueryOption(otMessage *aMessage, const char *aUriQuery)
|
이 함수는 단일 URI 쿼리 옵션을 추가합니다.
|
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)
|
이 함수는 유형 값을 반환합니다.
|
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 서버를 중지합니다.
|
구조체 |
|
---|---|
otCoapBlockwardResource |
이 구조는 블록별 전송을 사용하는 CoAP 리소스를 나타냅니다. |
otCoapOption |
이 구조는 CoAP 옵션을 나타냅니다. |
otCoapOptionIterator: |
이 구조는 CoAP 옵션의 반복기 역할을 합니다. |
otCoapResource |
이 구조는 CoAP 리소스를 나타냅니다. |
otCoapTxParameters |
이 구조는 CoAP 전송 매개변수를 나타냅니다. |
열거형
otCoaBlockBlockSzx
otCoapBlockSzx
CoAP 블록 크기 지수입니다.
OTCoaCode
otCoapCode
CoAP 코드 값입니다.
otCoapOptionContentFormat
otCoapOptionContentFormat
CoAP 콘텐츠 형식 코드입니다.
전체 목록은 https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats에 문서화됩니다.
OTCoaOptionOption
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
|
일치 항목 |
OT_COAP_OPTION_IF_NONE_MATCH
|
if-None-Match |
OT_COAP_OPTION_LOCATION_PATH
|
위치-경로입니다. |
OT_COAP_OPTION_LOCATION_QUERY
|
위치 쿼리 |
OT_COAP_OPTION_MAX_AGE
|
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-경로 |
OT_COAP_OPTION_URI_PORT
|
URI 포트 |
OT_COAP_OPTION_URI_QUERY
|
URI 쿼리입니다. |
OTCoaType
otCoapType
CoAP 유형 값 (2비트 부호 없는 정수)
속성 | |
---|---|
OT_COAP_TYPE_ACKNOWLEDGMENT
|
인정. |
OT_COAP_TYPE_CONFIRMABLE
|
확인 가능. |
OT_COAP_TYPE_NON_CONFIRMABLE
|
확인할 수 없습니다. |
OT_COAP_TYPE_RESET
|
초기화를 탭합니다. |
Typedef
otCoaBlockBlockwardReceiveHook
otError(* otCoapBlockwiseReceiveHook)(void *aContext, const uint8_t *aBlock, uint32_t aPosition, uint16_t aBlockLength, bool aMore, uint32_t aTotalLength)
이 함수 포인터는 차단별 전송 옵션이 있는 CoAP 메시지가 수신될 때 호출됩니다.
이 함수는 OPENINVALID_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 사용 설정된 경우 사용할 수 있습니다.
세부정보 | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||||
반환 값 |
|
otCoaBlockBlockwardResource
struct otCoapBlockwiseResource otCoapBlockwiseResource
이 구조는 블록별 전송을 사용하는 CoAP 리소스를 나타냅니다.
ota
otError(* otCoapBlockwiseTransmitHook)(void *aContext, uint8_t *aBlock, uint32_t aPosition, uint16_t *aBlockLength, bool *aMore)
이 함수 포인터는 블록별 전송의 다음 블록이 전송되기 전에 호출됩니다.
이 함수는 OPENINVALID_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 사용 설정된 경우 사용할 수 있습니다.
aBlockLength 값을 변경하면 전체 거래소의 블록 크기가 재협상됩니다. 이후 변경사항을 적용하면 다른 CoAP 구현에 문제가 발생할 수 있으므로 첫 번째 블록을 수신한 후에 이 작업을 수행하는 것이 좋습니다.
세부정보 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||
반환 값 |
|
otCoapOptionContentFormat
enum otCoapOptionContentFormat otCoapOptionContentFormat
CoAP 콘텐츠 형식 코드입니다.
전체 목록은 https://www.iana.org/assignments/core-parameters/core-parameters.xhtml#content-formats에 문서화됩니다.
otCoapRequestHandler
void(* otCoapRequestHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo)
이 함수 포인터는 지정된 URI 경로가 있는 CoAP 요청이 수신될 때 호출됩니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
otCoapResponseHandler
void(* otCoapResponseHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
이 함수 포인터는 CoAP 응답이 수신되거나 요청 제한 시간에 발생할 때 호출됩니다.
세부정보 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||
반환 값 |
|
함수
OTCoapAddBlockWiseResource
void otCoapAddBlockWiseResource( otInstance *aInstance, otCoapBlockwiseResource *aResource )
이 함수는 CoAP 서버에 블록별 리소스를 추가합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
OTCoaAddAddResource
void otCoapAddResource( otInstance *aInstance, otCoapResource *aResource )
이 함수는 CoAP 서버에 리소스를 추가합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
otCoapBlockSizeFromExponent
uint16_t otCoapBlockSizeFromExponent( otCoapBlockSzx aSize )
이 함수는 CoAP Block 옵션 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에 지정된 대로 콘텐츠 형식 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 경로 옵션을 추가합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageAppendUriQueryOption
otError otCoapMessageAppendUriQueryOption( otMessage *aMessage, const char *aUriQuery )
이 함수는 단일 URI 쿼리 옵션을 추가합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
otCoapMessageCodeToString
const char * otCoapMessageCodeToString( const otMessage *aMessage )
이 메서드는 CoAP 코드를 사람이 읽을 수 있는 문자열로 반환합니다.
@ 기호는 문자열로 CoAP 코드를 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
otCoapMessageGenerateToken
void otCoapMessageGenerateToken( otMessage *aMessage, uint8_t aTokenLength )
이 함수는 토큰 길이를 설정하고 값을 무작위로 지정합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
OTCoaMessageMessageCode
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 )
이 함수는 유형 값을 반환합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 |
유형 값입니다.
|
OTCoaMessageInit
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 )
이 함수는 헤더에 토큰 값과 길이를 설정합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
||||||
반환 값 |
|
OTCoaNewMessage
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
에 채웁니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 값 |
|
otCoaOptionOptionIteratorInit
otError otCoapOptionIteratorInit( otCoapOptionIterator *aIterator, const otMessage *aMessage )
이 함수는 지정된 메시지의 옵션에 대해 반복기를 초기화합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 값 |
|
OTCoaRemoveRemoveBlockWiseResource
void otCoapRemoveBlockWiseResource( otInstance *aInstance, otCoapBlockwiseResource *aResource )
이 함수는 CoAP 서버에서 블록별 리소스를 삭제합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
리소스 삭제
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 요청을 블록 단위로 전송합니다.
이 함수는 OPENINVALID_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 요청을 블록별로 전송합니다.
이 함수는 OPENINVALID_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 응답을 블록 단위로 전송합니다.
이 함수는 OPENINVALID_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 사용 설정된 경우 사용할 수 있습니다.
세부정보 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
매개변수 |
|
||||||||||
반환 값 |
|
otCoapSendResponseBlockWiseWithParameters
otError otCoapSendResponseBlockWiseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook )
이 함수는 서버에서 맞춤 전송 매개변수와 함께 CoAP 응답을 블록 단위로 전송합니다.
이 함수는 OPENINVALID_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 요청에 대한 기본 핸들러를 설정합니다.
세부정보 | |||||||
---|---|---|---|---|---|---|---|
매개변수 |
|
OTCoaStart
otError otCoapStart( otInstance *aInstance, uint16_t aPort )
이 함수는 CoAP 서버를 시작합니다.
세부정보 | |||||
---|---|---|---|---|---|
매개변수 |
|
||||
반환 값 |
|
OTCoAStop
otError otCoapStop( otInstance *aInstance )
이 함수는 CoAP 서버를 중지합니다.
세부정보 | |||
---|---|---|---|
매개변수 |
|
||
반환 값 |
|
매크로
OT_COAP_CODE
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에서 지원되는 최대 재전송
OT_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_DEFAULT_COAP_PORT 5683
RFC 7252에 지정된 기본 CoAP 포트입니다.
리소스
OpenThread API 참조 주제는 GitHub에서 제공되는 소스 코드에서 비롯됩니다. 자세한 내용을 보거나 문서에 참여하려면 리소스를 참조하세요.