31#ifndef _COAP_CLIENT_REQUEST_H
32#define _COAP_CLIENT_REQUEST_H
51 COAP_REQ_STATE_UNUSED = 0,
52 COAP_REQ_STATE_INIT = 1,
53 COAP_REQ_STATE_TRANSMIT = 2,
54 COAP_REQ_STATE_RECEIVE = 3,
55 COAP_REQ_STATE_SEPARATE = 4,
56 COAP_REQ_STATE_OBSERVE = 5,
57 COAP_REQ_STATE_DONE = 6,
58 COAP_REQ_STATE_RESET = 7,
59 COAP_REQ_STATE_TIMEOUT = 8,
60 COAP_REQ_STATE_CANCELED = 9
70 COAP_REQUEST_STATUS_SUCCESS = 0,
71 COAP_REQUEST_STATUS_FAILURE = 1,
72 COAP_REQUEST_STATUS_RESET = 2,
73 COAP_REQUEST_STATUS_TIMEOUT = 3,
74 COAP_REQUEST_STATUS_CANCELED = 4
99#if (COAP_CLIENT_OBSERVE_SUPPORT == ENABLED)
102#if (COAP_CLIENT_BLOCK_SUPPORT == ENABLED)
113CoapClientRequest *coapClientCreateRequest(CoapClientContext *context);
115error_t coapClientSetRequestTimeout(CoapClientRequest *request,
118error_t coapClientSendRequest(CoapClientRequest *request,
121error_t coapClientCancelRequest(CoapClientRequest *request);
122void coapClientDeleteRequest(CoapClientRequest *request);
124CoapMessage *coapClientGetRequestMessage(CoapClientRequest *request);
125CoapMessage *coapClientGetResponseMessage(CoapClientRequest *request);
149 char_t *queryString,
size_t maxLen);
152 uint_t optionIndex,
const uint8_t *optionValue,
size_t optionLen);
155 uint_t optionIndex,
const char_t *optionValue);
158 uint_t optionIndex, uint32_t optionValue);
161 uint_t optionIndex,
const uint8_t **optionValue,
size_t *optionLen);
164 uint_t optionIndex,
const char_t **optionValue,
size_t *optionLen);
167 uint_t optionIndex, uint32_t *optionValue);
error_t(* CoapRequestCallback)(CoapClientContext *context, CoapClientRequest *request, CoapRequestStatus status, void *param)
Request completed callback.
Definition coap_client_request.h:82
CoapRequestState
CoAP request states.
Definition coap_client_request.h:50
CoapRequestStatus
Request status.
Definition coap_client_request.h:69
CoapMessageType
CoAP message types.
Definition coap_common.h:88
CoapCode
CoAP method and response codes.
Definition coap_common.h:113
CoAP option formatting and parsing.
CoapBlockSize
Block size parameter.
Definition coap_option.h:200
error_t
Error codes.
Definition error.h:43
uint32_t systime_t
System time.
Definition os_port_none.h:90
CoAP message.
Definition coap_message.h:56
CoAP request.
Definition coap_client_request.h:91
systime_t timeout
Request timeout.
Definition coap_client_request.h:95
systime_t retransmitStartTime
Time at which the last message was sent.
Definition coap_client_request.h:96
CoapBlockSize txBlockSzx
TX block size.
Definition coap_client_request.h:103
systime_t startTime
Request start time.
Definition coap_client_request.h:94
uint_t retransmitCount
Retransmission counter.
Definition coap_client_request.h:98
uint32_t observeSeqNum
Sequence number for reordering detection.
Definition coap_client_request.h:100
void * param
Callback function parameter.
Definition coap_client_request.h:108
systime_t retransmitTimeout
Retransmission timeout.
Definition coap_client_request.h:97
CoapRequestState state
CoAP request state.
Definition coap_client_request.h:92
CoapBlockSize rxBlockSzx
RX block size.
Definition coap_client_request.h:104
CoapClientContext * context
CoAP client context.
Definition coap_client_request.h:93
CoapRequestCallback callback
Callback function to invoke when the request completes.
Definition coap_client_request.h:107
CoapMessage message
CoAP request message.
Definition coap_client_request.h:106