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에 지정된대로 콘텐츠 형식 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) | 이 함수는 유형 값을 반환합니다. |
otCoapMessageInit ( otMessage *aMessage, otCoapType aType, otCoapCode aCode) | void 이 함수는 CoAP 헤더를 초기화합니다. |
otCoapMessageInitResponse ( otMessage *aResponse, const otMessage *aRequest, otCoapType aType, otCoapCode aCode) | 이 함수는 응답 메시지를 초기화합니다. |
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에 문서화되어 있습니다.
otCoapOptionType
otCoapOptionType
CoAP 옵션 번호.
otCoapType
otCoapType
Typedef
otCoapBlockwiseReceiveHook
otError(* otCoapBlockwiseReceiveHook)(void *aContext, const uint8_t *aBlock, uint32_t aPosition, uint16_t aBlockLength, bool aMore, uint32_t aTotalLength)
이 함수 포인터는 블록 단위 전송 옵션이있는 CoAP 메시지가 수신 될 때 호출됩니다.
이 기능은 OPENTHREAD_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)
이 함수 포인터는 블록 단위 전송에서 다음 블록이 전송되기 전에 호출됩니다.
이 기능은 OPENTHREAD_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-Path가있는 CoAP 요청이 수신 될 때 호출됩니다.
세부 | |||||||
---|---|---|---|---|---|---|---|
매개 변수 |
|
otCoapResponseHandler
void(* otCoapResponseHandler)(void *aContext, otMessage *aMessage, const otMessageInfo *aMessageInfo, otError aResult)
이 함수 포인터는 CoAP 응답이 수신되거나 요청 시간 초과시 호출됩니다.
세부 | |||||||||
---|---|---|---|---|---|---|---|---|---|
매개 변수 |
| ||||||||
반환 값 |
|
기능
otCoapAddBlockWiseResource
void otCoapAddBlockWiseResource( otInstance *aInstance, otCoapBlockwiseResource *aResource )
이 함수는 CoAP 서버에 블록 단위 리소스를 추가합니다.
세부 | |||||
---|---|---|---|---|---|
매개 변수 |
|
otCoapAddResource
void otCoapAddResource( otInstance *aInstance, otCoapResource *aResource )
이 기능은 CoAP 서버에 리소스를 추가합니다.
세부 | |||||
---|---|---|---|---|---|
매개 변수 |
|
otCoapBlockSizeFromExponent
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에 지정된대로 콘텐츠 형식 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 )
이 함수는 유형 값을 반환합니다.
세부 | |||
---|---|---|---|
매개 변수 |
| ||
보고 | 유형 값입니다. |
otCoapMessageInit
void otCoapMessageInit( otMessage *aMessage, otCoapType aType, otCoapCode aCode )
이 함수는 CoAP 헤더를 초기화합니다.
세부 | |||||||
---|---|---|---|---|---|---|---|
매개 변수 |
|
otCoapMessageInitResponse
otError otCoapMessageInitResponse( otMessage *aResponse, const otMessage *aRequest, otCoapType aType, 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 요청을 보냅니다.
이 기능은 OPENTHREAD_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 요청을 보냅니다.
이 기능은 OPENTHREAD_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 응답을 보냅니다.
이 기능은 OPENTHREAD_CONFIG_COAP_BLOCKWISE_TRANSFER_ENABLE 구성이 활성화 된 경우 사용할 수 있습니다.
세부 | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
매개 변수 |
| ||||||||||
반환 값 |
|
otCoapSendResponseBlockWiseWithParameters
otError otCoapSendResponseBlockWiseWithParameters( otInstance *aInstance, otMessage *aMessage, const otMessageInfo *aMessageInfo, const otCoapTxParameters *aTxParameters, void *aContext, otCoapBlockwiseTransmitHook aTransmitHook )
이 함수는 사용자 지정 전송 매개 변수를 사용하여 서버에서 블록 단위로 CoAP 응답을 보냅니다.
이 기능은 OPENTHREAD_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_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 포트.