CoAP block transfer options encoding and decoding interface and definitions.
More...
CoAP block transfer options encoding and decoding interface and definitions.
|
#define COAP_BLOCK_OPT_BLOCK_MORE_BIT_SET 1
|
Value when more flag is not set.
|
#define COAP_BLOCK_OPT_BLOCK_MORE_BIT_UNSET 0
|
Value when more flag is set.
Decode block1 option from a uint to its structure counter part.
-
Parameters
-
|
[out]
|
p_opt
|
Pointer to block1 option structure to be filled by the function. Must not be NULL.
|
|
[in]
|
encoded
|
Encoded version of the coap block1 option value.
|
-
Return values
-
|
NRF_SUCCESS
|
If decoding of the option was successful.
|
|
NRF_ERROR_NULL
|
If p_opt parameter is NULL.
|
|
NRF_ERROR_INVALID_PARAM
|
If the block number is higher then allowed by spec (more than 20 bits).
|
|
NRF_ERROR_INVALID_DATA
|
If the size has the value of the reserved 2048 value (7).
|
Encode block1 option into its uint binary counter part.
-
Parameters
-
|
[out]
|
p_encoded
|
Encoded version of the coap block1 option value. Must not be NULL.
|
|
[in]
|
p_opt
|
Pointer to block1 option structure to be decoded into uint format. Must not be NULL.
|
-
Return values
-
|
NRF_SUCCESS
|
If encoding of option was successful.
|
|
NRF_ERROR_NULL
|
If one of the parameters supplied is a null pointer.
|
|
NRF_ERROR_INVALID_PARAM
|
If one of the fields in the option structure has an illegal value.
|
Decode block2 option from a uint to its structure counter part.
-
Parameters
-
|
[out]
|
p_opt
|
Pointer to block2 option structure to be filled by the function. Must not be NULL.
|
|
[in]
|
encoded
|
Encoded version of the coap block2 option value.
|
-
Return values
-
|
NRF_SUCCESS
|
If decoding of the option was successful.
|
|
NRF_ERROR_NULL
|
If p_opt parameter is NULL.
|
|
NRF_ERROR_INVALID_PARAM
|
If the block number is higher then allowed by spec (more than 20 bits).
|
|
NRF_ERROR_INVALID_DATA
|
If the size has the value of the reserved 2048 value (7).
|
Encode block2 option into its uint binary counter part.
-
Parameters
-
|
[out]
|
p_encoded
|
Encoded version of the coap block2 option value. Must not be NULL.
|
|
[in]
|
p_opt
|
Pointer to block2 option structure to be decoded into uint format. Must not be NULL.
|
-
Return values
-
|
NRF_SUCCESS
|
If encoding of option was successful.
|
|
NRF_ERROR_NULL
|
If one of the parameters supplied is a null pointer.
|
|
NRF_ERROR_INVALID_PARAM
|
If one of the fields in the option structure has an illegal value.
|