coap_option.h File Reference

Formatting and parsing of CoAP options. More...

#include "core/net.h"
#include "coap/coap_common.h"
#include "coap/coap_message.h"

Go to the source code of this file.

Data Structures

struct  CoapOption
 CoAP option. More...
 
struct  CoapOptionParameters
 CoAP option parameters. More...
 

Macros

#define COAP_OPT_DELTA_8_BITS   13
 
#define COAP_OPT_DELTA_16_BITS   14
 
#define COAP_OPT_DELTA_RESERVED   15
 
#define COAP_OPT_DELTA_MINUS_8_BITS   13
 
#define COAP_OPT_DELTA_MINUS_16_BITS   269
 
#define COAP_OPT_LEN_8_BITS   13
 
#define COAP_OPT_LEN_16_BITS   14
 
#define COAP_OPT_LEN_RESERVED   15
 
#define COAP_OPT_LEN_MINUS_8_BITS   13
 
#define COAP_OPT_LEN_MINUS_16_BITS   269
 
#define COAP_DEFAULT_MAX_AGE   60
 
#define COAP_IS_OPTION_CRITICAL(num)   (((num) & 0x01U) ? TRUE : FALSE)
 
#define COAP_IS_OPTION_UNSAFE(num)   (((num) & 0x02U) ? TRUE : FALSE)
 
#define COAP_SET_BLOCK_NUM(value, n)   value = ((value) & 0x0FU) | ((n) << 4U)
 
#define COAP_SET_BLOCK_M(value, m)   value = ((value) & ~0x08U) | (((m) << 3U) & 0x08U)
 
#define COAP_SET_BLOCK_SZX(value, s)   value = ((value) & ~0x07U) | ((s) & 0x07U)
 
#define COAP_GET_BLOCK_NUM(value)   ((value) >> 4U)
 
#define COAP_GET_BLOCK_M(value)   (((value) >> 3U) & 0x01U)
 
#define COAP_GET_BLOCK_SZX(value)   ((value) & 0x07U)
 
#define COAP_GET_BLOCK_SIZE(value)   (16U << ((value) & 0x07U))
 
#define COAP_GET_BLOCK_POS(value)   (((value) & ~0x0FU) << ((value) & 0x07U))
 

Enumerations

enum  CoapOptionNumber {
  COAP_OPT_IF_MATCH = 1 , COAP_OPT_URI_HOST = 3 , COAP_OPT_ETAG = 4 , COAP_OPT_IF_NONE_MATCH = 5 ,
  COAP_OPT_OBSERVE = 6 , COAP_OPT_URI_PORT = 7 , COAP_OPT_LOCATION_PATH = 8 , COAP_OPT_URI_PATH = 11 ,
  COAP_OPT_CONTENT_FORMAT = 12 , COAP_OPT_MAX_AGE = 14 , COAP_OPT_URI_QUERY = 15 , COAP_OPT_ACCEPT = 17 ,
  COAP_OPT_LOCATION_QUERY = 20 , COAP_OPT_BLOCK2 = 23 , COAP_OPT_BLOCK1 = 27 , COAP_OPT_SIZE2 = 28 ,
  COAP_OPT_PROXY_URI = 35 , COAP_OPT_PROXY_SCHEME = 39 , COAP_OPT_SIZE1 = 60 , COAP_OPT_ECHO = 252 ,
  COAP_OPT_NO_RESPONSE = 258 , COAP_OPT_REQUEST_TAG = 292
}
 CoAP options. More...
 
enum  CoapOptionFormat { COAP_OPT_FORMAT_EMPTY = 0 , COAP_OPT_FORMAT_OPAQUE = 1 , COAP_OPT_FORMAT_UINT = 2 , COAP_OPT_FORMAT_STRING = 3 }
 CoAP option formats. More...
 
enum  CoapObserveOption { COAP_OBSERVE_REGISTER = 0 , COAP_OBSERVE_DEREGISTER = 1 }
 Observe option. More...
 
enum  CoapContentFormat {
  COAP_CONTENT_FORMAT_TEXT_PLAIN = 0 , COAP_CONTENT_FORMAT_APP_COSE_ENCRYPT0 = 16 , COAP_CONTENT_FORMAT_APP_COSE_MAC0 = 17 , COAP_CONTENT_FORMAT_APP_COSE_SIGN1 = 18 ,
  COAP_CONTENT_FORMAT_APP_LINK_FORMAT = 40 , COAP_CONTENT_FORMAT_APP_XML = 41 , COAP_CONTENT_FORMAT_APP_OCTET_STREAM = 42 , COAP_CONTENT_FORMAT_APP_EXI = 47 ,
  COAP_CONTENT_FORMAT_APP_JSON = 50 , COAP_CONTENT_FORMAT_APP_JSON_PATCH_JSON = 51 , COAP_CONTENT_FORMAT_APP_MERGE_PATCH_JSON = 52 , COAP_CONTENT_FORMAT_APP_CBOR = 60 ,
  COAP_CONTENT_FORMAT_APP_CWT = 61 , COAP_CONTENT_FORMAT_APP_MULTIPART_CORE = 62 , COAP_CONTENT_FORMAT_APP_CBOR_SEQ = 63 , COAP_CONTENT_FORMAT_APP_COSE_ENCRYPT = 96 ,
  COAP_CONTENT_FORMAT_APP_COSE_MAC = 97 , COAP_CONTENT_FORMAT_APP_COSE_SIGN = 98 , COAP_CONTENT_FORMAT_APP_COSE_KEY = 101 , COAP_CONTENT_FORMAT_APP_COSE_KEY_SET = 102 ,
  COAP_CONTENT_FORMAT_APP_SENML_JSON = 110 , COAP_CONTENT_FORMAT_APP_SENSML_JSON = 111 , COAP_CONTENT_FORMAT_APP_SENML_CBOR = 112 , COAP_CONTENT_FORMAT_APP_SENSML_CBOR = 113 ,
  COAP_CONTENT_FORMAT_APP_SENML_EXI = 114 , COAP_CONTENT_FORMAT_APP_SENSML_EXI = 115 , COAP_CONTENT_FORMAT_APP_COAP_GROUP_JSON = 256 , COAP_CONTENT_FORMAT_APP_PKCS7_MIME_SERVER_KEY = 280 ,
  COAP_CONTENT_FORMAT_APP_PKCS7_MIME_CERTS_ONLY = 281 , COAP_CONTENT_FORMAT_APP_PKCS7_MIME_CMC_REQ = 282 , COAP_CONTENT_FORMAT_APP_PKCS7_MIME_CMC_RESP = 283 , COAP_CONTENT_FORMAT_APP_PKCS8 = 284 ,
  COAP_CONTENT_FORMAT_APP_CSRATTRS = 285 , COAP_CONTENT_FORMAT_APP_PKCS10 = 286 , COAP_CONTENT_FORMAT_APP_PKIX_CERT = 287 , COAP_CONTENT_FORMAT_APP_SENML_XML = 310 ,
  COAP_CONTENT_FORMAT_APP_SENSML_XML = 311 , COAP_CONTENT_FORMAT_SENML_ETCH_JSON = 320 , COAP_CONTENT_FORMAT_SENML_ETCH_CBOR = 322 , COAP_CONTENT_FORMAT_APP_VND_OCF_CBOR = 10000 ,
  COAP_CONTENT_FORMAT_APP_OSCORE = 10001 , COAP_CONTENT_FORMAT_APP_JSON_DEFLATE = 11050 , COAP_CONTENT_FORMAT_APP_CBOR_DEFLATE = 11060 , COAP_CONTENT_FORMAT_APP_VND_OMA_LWM2M_TLV = 11542 ,
  COAP_CONTENT_FORMAT_APP_VND_OMA_LWM2M_JSON = 11543
}
 Content-Format option. More...
 
enum  CoapBlockSize {
  COAP_BLOCK_SIZE_16 = 0 , COAP_BLOCK_SIZE_32 = 1 , COAP_BLOCK_SIZE_64 = 2 , COAP_BLOCK_SIZE_128 = 3 ,
  COAP_BLOCK_SIZE_256 = 4 , COAP_BLOCK_SIZE_512 = 5 , COAP_BLOCK_SIZE_1024 = 6 , COAP_BLOCK_SIZE_RESERVED = 7
}
 Block size parameter. More...
 

Functions

error_t coapParseOptions (const uint8_t *p, size_t length, size_t *consumed)
 Parse the list of CoAP options. More...
 
error_t coapParseOption (const uint8_t *p, size_t length, uint16_t prevOptionNum, CoapOption *option, size_t *consumed)
 Parse CoAP option. More...
 
error_t coapFormatOption (uint8_t *p, uint16_t prevOptionNum, CoapOption *option, size_t *written)
 Format CoAP option. More...
 
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. More...
 
error_t coapSetUintOption (CoapMessage *message, uint16_t optionNum, uint_t optionIndex, uint32_t optionValue)
 Add a uint option to the specified CoAP message. More...
 
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. More...
 
error_t coapGetUintOption (const CoapMessage *message, uint16_t optionNum, uint_t optionIndex, uint32_t *optionValue)
 Get the value of the specified uint option. More...
 
error_t coapDeleteOption (CoapMessage *message, uint16_t optionNum, uint_t optionIndex)
 Remove an option from the specified CoAP message. More...
 
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. More...
 
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. More...
 
const CoapOptionParameterscoapGetOptionParameters (uint16_t optionNum)
 Retrieve parameters for a given option number. More...
 

Detailed Description

Formatting and parsing of CoAP options.

License

SPDX-License-Identifier: GPL-2.0-or-later

Copyright (C) 2010-2024 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
2.4.0

Definition in file coap_option.h.

Macro Definition Documentation

◆ COAP_DEFAULT_MAX_AGE

#define COAP_DEFAULT_MAX_AGE   60

Definition at line 54 of file coap_option.h.

◆ COAP_GET_BLOCK_M

#define COAP_GET_BLOCK_M (   value)    (((value) >> 3U) & 0x01U)

Definition at line 71 of file coap_option.h.

◆ COAP_GET_BLOCK_NUM

#define COAP_GET_BLOCK_NUM (   value)    ((value) >> 4U)

Definition at line 69 of file coap_option.h.

◆ COAP_GET_BLOCK_POS

#define COAP_GET_BLOCK_POS (   value)    (((value) & ~0x0FU) << ((value) & 0x07U))

Definition at line 78 of file coap_option.h.

◆ COAP_GET_BLOCK_SIZE

#define COAP_GET_BLOCK_SIZE (   value)    (16U << ((value) & 0x07U))

Definition at line 76 of file coap_option.h.

◆ COAP_GET_BLOCK_SZX

#define COAP_GET_BLOCK_SZX (   value)    ((value) & 0x07U)

Definition at line 73 of file coap_option.h.

◆ COAP_IS_OPTION_CRITICAL

#define COAP_IS_OPTION_CRITICAL (   num)    (((num) & 0x01U) ? TRUE : FALSE)

Definition at line 57 of file coap_option.h.

◆ COAP_IS_OPTION_UNSAFE

#define COAP_IS_OPTION_UNSAFE (   num)    (((num) & 0x02U) ? TRUE : FALSE)

Definition at line 59 of file coap_option.h.

◆ COAP_OPT_DELTA_16_BITS

#define COAP_OPT_DELTA_16_BITS   14

Definition at line 41 of file coap_option.h.

◆ COAP_OPT_DELTA_8_BITS

#define COAP_OPT_DELTA_8_BITS   13

Definition at line 40 of file coap_option.h.

◆ COAP_OPT_DELTA_MINUS_16_BITS

#define COAP_OPT_DELTA_MINUS_16_BITS   269

Definition at line 44 of file coap_option.h.

◆ COAP_OPT_DELTA_MINUS_8_BITS

#define COAP_OPT_DELTA_MINUS_8_BITS   13

Definition at line 43 of file coap_option.h.

◆ COAP_OPT_DELTA_RESERVED

#define COAP_OPT_DELTA_RESERVED   15

Definition at line 42 of file coap_option.h.

◆ COAP_OPT_LEN_16_BITS

#define COAP_OPT_LEN_16_BITS   14

Definition at line 48 of file coap_option.h.

◆ COAP_OPT_LEN_8_BITS

#define COAP_OPT_LEN_8_BITS   13

Definition at line 47 of file coap_option.h.

◆ COAP_OPT_LEN_MINUS_16_BITS

#define COAP_OPT_LEN_MINUS_16_BITS   269

Definition at line 51 of file coap_option.h.

◆ COAP_OPT_LEN_MINUS_8_BITS

#define COAP_OPT_LEN_MINUS_8_BITS   13

Definition at line 50 of file coap_option.h.

◆ COAP_OPT_LEN_RESERVED

#define COAP_OPT_LEN_RESERVED   15

Definition at line 49 of file coap_option.h.

◆ COAP_SET_BLOCK_M

#define COAP_SET_BLOCK_M (   value,
  m 
)    value = ((value) & ~0x08U) | (((m) << 3U) & 0x08U)

Definition at line 64 of file coap_option.h.

◆ COAP_SET_BLOCK_NUM

#define COAP_SET_BLOCK_NUM (   value,
  n 
)    value = ((value) & 0x0FU) | ((n) << 4U)

Definition at line 62 of file coap_option.h.

◆ COAP_SET_BLOCK_SZX

#define COAP_SET_BLOCK_SZX (   value,
  s 
)    value = ((value) & ~0x07U) | ((s) & 0x07U)

Definition at line 66 of file coap_option.h.

Enumeration Type Documentation

◆ CoapBlockSize

Block size parameter.

Enumerator
COAP_BLOCK_SIZE_16 
COAP_BLOCK_SIZE_32 
COAP_BLOCK_SIZE_64 
COAP_BLOCK_SIZE_128 
COAP_BLOCK_SIZE_256 
COAP_BLOCK_SIZE_512 
COAP_BLOCK_SIZE_1024 
COAP_BLOCK_SIZE_RESERVED 

Definition at line 199 of file coap_option.h.

◆ CoapContentFormat

Content-Format option.

Enumerator
COAP_CONTENT_FORMAT_TEXT_PLAIN 
COAP_CONTENT_FORMAT_APP_COSE_ENCRYPT0 
COAP_CONTENT_FORMAT_APP_COSE_MAC0 
COAP_CONTENT_FORMAT_APP_COSE_SIGN1 
COAP_CONTENT_FORMAT_APP_LINK_FORMAT 
COAP_CONTENT_FORMAT_APP_XML 
COAP_CONTENT_FORMAT_APP_OCTET_STREAM 
COAP_CONTENT_FORMAT_APP_EXI 
COAP_CONTENT_FORMAT_APP_JSON 
COAP_CONTENT_FORMAT_APP_JSON_PATCH_JSON 
COAP_CONTENT_FORMAT_APP_MERGE_PATCH_JSON 
COAP_CONTENT_FORMAT_APP_CBOR 
COAP_CONTENT_FORMAT_APP_CWT 
COAP_CONTENT_FORMAT_APP_MULTIPART_CORE 
COAP_CONTENT_FORMAT_APP_CBOR_SEQ 
COAP_CONTENT_FORMAT_APP_COSE_ENCRYPT 
COAP_CONTENT_FORMAT_APP_COSE_MAC 
COAP_CONTENT_FORMAT_APP_COSE_SIGN 
COAP_CONTENT_FORMAT_APP_COSE_KEY 
COAP_CONTENT_FORMAT_APP_COSE_KEY_SET 
COAP_CONTENT_FORMAT_APP_SENML_JSON 
COAP_CONTENT_FORMAT_APP_SENSML_JSON 
COAP_CONTENT_FORMAT_APP_SENML_CBOR 
COAP_CONTENT_FORMAT_APP_SENSML_CBOR 
COAP_CONTENT_FORMAT_APP_SENML_EXI 
COAP_CONTENT_FORMAT_APP_SENSML_EXI 
COAP_CONTENT_FORMAT_APP_COAP_GROUP_JSON 
COAP_CONTENT_FORMAT_APP_PKCS7_MIME_SERVER_KEY 
COAP_CONTENT_FORMAT_APP_PKCS7_MIME_CERTS_ONLY 
COAP_CONTENT_FORMAT_APP_PKCS7_MIME_CMC_REQ 
COAP_CONTENT_FORMAT_APP_PKCS7_MIME_CMC_RESP 
COAP_CONTENT_FORMAT_APP_PKCS8 
COAP_CONTENT_FORMAT_APP_CSRATTRS 
COAP_CONTENT_FORMAT_APP_PKCS10 
COAP_CONTENT_FORMAT_APP_PKIX_CERT 
COAP_CONTENT_FORMAT_APP_SENML_XML 
COAP_CONTENT_FORMAT_APP_SENSML_XML 
COAP_CONTENT_FORMAT_SENML_ETCH_JSON 
COAP_CONTENT_FORMAT_SENML_ETCH_CBOR 
COAP_CONTENT_FORMAT_APP_VND_OCF_CBOR 
COAP_CONTENT_FORMAT_APP_OSCORE 
COAP_CONTENT_FORMAT_APP_JSON_DEFLATE 
COAP_CONTENT_FORMAT_APP_CBOR_DEFLATE 
COAP_CONTENT_FORMAT_APP_VND_OMA_LWM2M_TLV 
COAP_CONTENT_FORMAT_APP_VND_OMA_LWM2M_JSON 

Definition at line 145 of file coap_option.h.

◆ CoapObserveOption

Observe option.

Enumerator
COAP_OBSERVE_REGISTER 
COAP_OBSERVE_DEREGISTER 

Definition at line 134 of file coap_option.h.

◆ CoapOptionFormat

CoAP option formats.

Enumerator
COAP_OPT_FORMAT_EMPTY 

Zero-length sequence of bytes.

COAP_OPT_FORMAT_OPAQUE 

Opaque sequence of bytes.

COAP_OPT_FORMAT_UINT 

Non-negative integer.

COAP_OPT_FORMAT_STRING 

UTF-8 string.

Definition at line 121 of file coap_option.h.

◆ CoapOptionNumber

CoAP options.

Enumerator
COAP_OPT_IF_MATCH 
COAP_OPT_URI_HOST 
COAP_OPT_ETAG 
COAP_OPT_IF_NONE_MATCH 
COAP_OPT_OBSERVE 
COAP_OPT_URI_PORT 
COAP_OPT_LOCATION_PATH 
COAP_OPT_URI_PATH 
COAP_OPT_CONTENT_FORMAT 
COAP_OPT_MAX_AGE 
COAP_OPT_URI_QUERY 
COAP_OPT_ACCEPT 
COAP_OPT_LOCATION_QUERY 
COAP_OPT_BLOCK2 
COAP_OPT_BLOCK1 
COAP_OPT_SIZE2 
COAP_OPT_PROXY_URI 
COAP_OPT_PROXY_SCHEME 
COAP_OPT_SIZE1 
COAP_OPT_ECHO 
COAP_OPT_NO_RESPONSE 
COAP_OPT_REQUEST_TAG 

Definition at line 90 of file coap_option.h.

Function Documentation

◆ coapDeleteOption()

error_t coapDeleteOption ( CoapMessage message,
uint16_t  optionNum,
uint_t  optionIndex 
)

Remove an option from the specified CoAP message.

Parameters
[in]messagePointer to the CoAP message
[in]optionNumOption number
[in]optionIndexOccurrence index (for repeatable options only)
Returns
Error code

Definition at line 688 of file coap_option.c.

◆ coapFormatOption()

error_t coapFormatOption ( uint8_t *  p,
uint16_t  prevOptionNum,
CoapOption option,
size_t *  written 
)

Format CoAP option.

Parameters
[in]pBuffer where to format the CoAP option (optional parameter)
[in]prevOptionNumOption number of the previous instance
[in]optionCoAP option content
[out]writtenTotal number of bytes that have been written
Returns
Error code

Definition at line 262 of file coap_option.c.

◆ coapGetOption()

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.

Parameters
[in]messagePointer to the CoAP message
[in]optionNumOption number
[in]optionIndexOccurrence index (for repeatable options only)
[out]optionValuePointer to the first byte of the option value
[out]optionLenLength of the option, in bytes
Returns
Error code

Definition at line 571 of file coap_option.c.

◆ coapGetOptionParameters()

const CoapOptionParameters* coapGetOptionParameters ( uint16_t  optionNum)

Retrieve parameters for a given option number.

Parameters
[in]optionNumOption number
Returns
Option parameters

Definition at line 950 of file coap_option.c.

◆ coapGetUintOption()

error_t coapGetUintOption ( const CoapMessage message,
uint16_t  optionNum,
uint_t  optionIndex,
uint32_t *  optionValue 
)

Get the value of the specified uint option.

Parameters
[in]messagePointer to the CoAP message
[in]optionNumOption number to search for
[in]optionIndexOccurrence index (for repeatable options only)
[out]optionValueOption value (unsigned integer)
Returns
Error code

Definition at line 651 of file coap_option.c.

◆ coapJoinRepeatableOption()

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.

Parameters
[in]messagePointer to the CoAP message
[in]optionNumOption number
[out]optionValueBuffer where to copy the path or query component
[in]maxLenMaximum number of characters the buffer can hold
[in]separatorDelimiting character
Returns
Error code

Definition at line 877 of file coap_option.c.

◆ coapParseOption()

error_t coapParseOption ( const uint8_t *  p,
size_t  length,
uint16_t  prevOptionNum,
CoapOption option,
size_t *  consumed 
)

Parse CoAP option.

Parameters
[in]pInput stream where to read the CoAP option
[in]lengthNumber of bytes available in the input stream
[in]prevOptionNumOption number of the previous instance
[out]optionCoAP option content
[out]consumedTotal number of bytes that have been consumed
Returns
Error code

Definition at line 133 of file coap_option.c.

◆ coapParseOptions()

error_t coapParseOptions ( const uint8_t *  p,
size_t  length,
size_t *  consumed 
)

Parse the list of CoAP options.

Parameters
[in]pInput stream where to read the CoAP options
[in]lengthNumber of bytes available in the input stream
[out]consumedTotal number of bytes that have been consumed
Returns
Error code

Definition at line 81 of file coap_option.c.

◆ coapSetOption()

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.

Parameters
[in]messagePointer to the CoAP message
[in]optionNumOption number
[in]optionIndexOccurrence index (for repeatable options only)
[in]optionValuePointer to the first byte of the option value
[in]optionLenLength of the option, in bytes
Returns
Error code

Definition at line 388 of file coap_option.c.

◆ coapSetUintOption()

error_t coapSetUintOption ( CoapMessage message,
uint16_t  optionNum,
uint_t  optionIndex,
uint32_t  optionValue 
)

Add a uint option to the specified CoAP message.

Parameters
[in]messagePointer to the CoAP message
[in]optionNumOption number
[in]optionIndexOccurrence index (for repeatable options only)
[in]optionValueOption value (unsigned integer)
Returns
Error code

Definition at line 543 of file coap_option.c.

◆ coapSplitRepeatableOption()

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.

Parameters
[in]messagePointer to the CoAP message
[in]optionNumOption number
[in]optionValuePath or a query component to be encoded
[in]separatorDelimiting character
Returns
Error code

Definition at line 822 of file coap_option.c.