coap_client_request.c
error_t coapClientSetPayload(CoapMessage *message, const void *payload, size_t payloadLen)
Set message payload.
Definition: coap_client_request.c:828
error_t coapSetCode(CoapMessage *message, CoapCode code)
Set method or response code.
Definition: coap_message.c:201
error_t coapClientGetLocationPath(const CoapMessage *message, char_t *path, size_t maxLen)
Get Location-Path option.
Definition: coap_client_request.c:624
CoAP request handling.
error_t coapSetUintOption(CoapMessage *message, uint16_t optionNum, uint_t optionIndex, uint32_t optionValue)
Add a uint option to the specified CoAP message.
Definition: coap_option.c:543
error_t coapGetPayload(const CoapMessage *message, const uint8_t **payload, size_t *payloadLen)
Get CoAP message payload.
Definition: coap_message.c:324
error_t coapSetType(CoapMessage *message, CoapMessageType type)
Set message type.
Definition: coap_message.c:151
error_t coapGetUintOption(const CoapMessage *message, uint16_t optionNum, uint_t optionIndex, uint32_t *optionValue)
Get the value of the specified uint option.
Definition: coap_option.c:651
CoapMessage * coapClientGetRequestMessage(CoapClientRequest *request)
Get request message.
Definition: coap_client_request.c:370
error_t coapClientSendRequest(CoapClientRequest *request, CoapRequestCallback callback, void *param)
Send a CoAP request.
Definition: coap_client_request.c:157
error_t coapDeleteOption(CoapMessage *message, uint16_t optionNum, uint_t optionIndex)
Remove an option from the specified CoAP message.
Definition: coap_option.c:688
error_t coapClientSetUriQuery(CoapMessage *message, const char_t *queryString)
Set Uri-Query option.
Definition: coap_client_request.c:583
error_t coapJoinRepeatableOption(const CoapMessage *message, uint16_t optionNum, char_t *optionValue, size_t maxLen, char_t separator)
Decode a path or query component from multiple repeatable options.
Definition: coap_option.c:877
CoapClientRequest * coapClientCreateRequest(CoapClientContext *context)
Initialize a new CoAP request.
Definition: coap_client_request.c:53
error_t coapClientChangeRequestState(CoapClientRequest *request, CoapRequestState newState)
Update CoAP request state.
Definition: coap_client_misc.c:342
error_t coapClientGetUriQuery(const CoapMessage *message, char_t *queryString, size_t maxLen)
Get Uri-Query option.
Definition: coap_client_request.c:603
CoapMessage * coapClientGetResponseMessage(CoapClientRequest *request)
Get response message.
Definition: coap_client_request.c:414
error_t coapClientSetOpaqueOption(CoapMessage *message, uint16_t optionNum, uint_t optionIndex, const uint8_t *optionValue, size_t optionLen)
Add an opaque option to the CoAP message.
Definition: coap_client_request.c:668
error_t coapClientSetRequestTimeout(CoapClientRequest *request, systime_t timeout)
Set request timeout.
Definition: coap_client_request.c:130
error_t coapClientGetMethodCode(const CoapMessage *message, CoapCode *code)
Get request method.
Definition: coap_client_request.c:508
error_t coapClientSetUriPath(CoapMessage *message, const char_t *path)
Set Uri-Path option.
Definition: coap_client_request.c:544
error_t coapClientGetOpaqueOption(const CoapMessage *message, uint16_t optionNum, uint_t optionIndex, const uint8_t **optionValue, size_t *optionLen)
Read an opaque option from the CoAP message.
Definition: coap_client_request.c:743
error_t coapClientSetMethodCode(CoapMessage *message, CoapCode code)
Set request method.
Definition: coap_client_request.c:490
error_t coapGetType(const CoapMessage *message, CoapMessageType *type)
Get message type.
Definition: coap_message.c:176
error_t coapSetOption(CoapMessage *message, uint16_t optionNum, uint_t optionIndex, const uint8_t *optionValue, size_t optionLen)
Add an option to the specified CoAP message.
Definition: coap_option.c:388
error_t coapClientGetStringOption(const CoapMessage *message, uint16_t optionNum, uint_t optionIndex, const char_t **optionValue, size_t *optionLen)
Read a string option from the CoAP message.
Definition: coap_client_request.c:766
error_t coapClientGetPayload(const CoapMessage *message, const uint8_t **payload, size_t *payloadLen)
Get message payload.
Definition: coap_client_request.c:852
CoAP client.
error_t coapClientSetType(CoapMessage *message, CoapMessageType type)
Set message type.
Definition: coap_client_request.c:454
error_t coapClientProcessEvents(CoapClientContext *context, systime_t timeout)
Process CoAP client events.
Definition: coap_client_misc.c:56
CoapBlockSize coapClientGetMaxBlockSize(void)
Get maximum block size.
Definition: coap_client_block.c:600
error_t coapClientGetUriPath(const CoapMessage *message, char_t *path, size_t maxLen)
Get Uri-Path option.
Definition: coap_client_request.c:563
error_t coapClientReadPayload(CoapMessage *message, void *data, size_t size, size_t *length)
Read payload data.
Definition: coap_client_request.c:893
error_t coapSplitRepeatableOption(CoapMessage *message, uint16_t optionNum, const char_t *optionValue, char_t separator)
Encode a path or query component into multiple repeatable options.
Definition: coap_option.c:822
error_t coapClientGetLocationQuery(const CoapMessage *message, char_t *queryString, size_t maxLen)
Get Location-Query option.
Definition: coap_client_request.c:645
error_t coapClientSetStringOption(CoapMessage *message, uint16_t optionNum, uint_t optionIndex, const char_t *optionValue)
Add a string option to the CoAP message.
Definition: coap_client_request.c:694
void coapClientGenerateToken(CoapClientContext *context, CoapMessageHeader *header)
Generate a new token.
Definition: coap_client_misc.c:786
Helper functions for CoAP client.
void coapClientGenerateMessageId(CoapClientContext *context, CoapMessageHeader *header)
Generate a new message identifier.
Definition: coap_client_misc.c:768
error_t coapGetCode(const CoapMessage *message, CoapCode *code)
Get method or response code.
Definition: coap_message.c:226
CoAP block-wise transfer.
void coapClientDeleteRequest(CoapClientRequest *request)
Release the resources associated with a CoAP request.
Definition: coap_client_request.c:349
error_t coapClientGetType(const CoapMessage *message, CoapMessageType *type)
Get message type.
Definition: coap_client_request.c:472
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
Definition: os_port_chibios.c:396
error_t coapWritePayload(CoapMessage *message, const void *data, size_t length)
Write payload data.
Definition: coap_message.c:386
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
Definition: os_port_chibios.c:408
error_t coapClientWritePayload(CoapMessage *message, const void *data, size_t length)
Write payload data.
Definition: coap_client_request.c:872
error_t coapGetOption(const CoapMessage *message, uint16_t optionNum, uint_t optionIndex, const uint8_t **optionValue, size_t *optionLen)
Get the value of the specified option.
Definition: coap_option.c:571
error_t coapClientGetUintOption(const CoapMessage *message, uint16_t optionNum, uint_t optionIndex, uint32_t *optionValue)
Read an uint option from the CoAP message.
Definition: coap_client_request.c:788
error_t coapClientCancelRequest(CoapClientRequest *request)
Cancel an outstanding CoAP request.
Definition: coap_client_request.c:275
error_t(* CoapRequestCallback)(CoapClientContext *context, CoapClientRequest *request, CoapRequestStatus status, void *param)
Request completed callback.
Definition: coap_client_request.h:82
error_t coapClientSetUintOption(CoapMessage *message, uint16_t optionNum, uint_t optionIndex, uint32_t optionValue)
Add a uint option to the CoAP message.
Definition: coap_client_request.c:721
TCP/IP stack core.
error_t coapClientDeleteOption(CoapMessage *message, uint16_t optionNum, uint_t optionIndex)
Remove an option from the CoAP message.
Definition: coap_client_request.c:808
error_t coapReadPayload(CoapMessage *message, void *data, size_t size, size_t *length)
Read payload data.
Definition: coap_message.c:468
error_t coapClientGetResponseCode(const CoapMessage *message, CoapCode *code)
Get response code.
Definition: coap_client_request.c:526
Debugging facilities.
error_t coapSetPayload(CoapMessage *message, const void *payload, size_t payloadLen)
Set CoAP message payload.
Definition: coap_message.c:252