Merge pull request #756 from mrdeep1/coap_pdu_parse

coap_pdu_parse: Add to public API
This commit is contained in:
obgm authored and GitHub committed 2021-10-01 09:33:55 +02:00
commit 5d9b29ce65
4 files changed
+21 -19

No files matched your search

-19
View File
@@ -201,25 +201,6 @@ int coap_pdu_parse_header(coap_pdu_t *pdu, coap_proto_t proto);
*/
int coap_pdu_parse_opt(coap_pdu_t *pdu);
/**
* Parses @p data into the CoAP PDU structure given in @p result.
* The target pdu must be large enough to
* This function returns @c 0 on error or a number greater than zero on success.
*
* @param proto Session's protocol
* @param data The raw data to parse as CoAP PDU.
* @param length The actual size of @p data.
* @param pdu The PDU structure to fill. Note that the structure must
* provide space to hold at least the token and options
* part of the message.
*
* @return 1 on success or @c 0 on error.
*/
int coap_pdu_parse(coap_proto_t proto,
const uint8_t *data,
size_t length,
coap_pdu_t *pdu);
/**
* Clears any contents from @p pdu and resets @c used_size,
* and @c data pointers. @c max_size is set to @p size, any
+19
View File
@@ -394,6 +394,25 @@ coap_pdu_duplicate(const coap_pdu_t *old_pdu,
const uint8_t *token,
coap_opt_filter_t *drop_options);
/**
* Parses @p data into the CoAP PDU structure given in @p result.
* The target pdu must be large enough to hold the token, options and data.
* This function returns @c 0 on error or a number greater than zero on success.
*
* @param proto Session's protocol
* @param data The raw data to parse as CoAP PDU.
* @param length The actual size of @p data.
* @param pdu The PDU structure to fill. Note that the structure must
* provide space to hold the token, optional options and
* optional data.
*
* @return 1 on success or @c 0 on error.
*/
int coap_pdu_parse(coap_proto_t proto,
const uint8_t *data,
size_t length,
coap_pdu_t *pdu);
/**
* Adds token of length @p len to @p pdu.
* Adding the token destroys any following contents of the pdu. Hence options
+1
View File
@@ -142,6 +142,7 @@ global:
coap_pdu_get_token;
coap_pdu_get_type;
coap_pdu_init;
coap_pdu_parse;
coap_pdu_set_code;
coap_pdu_set_mid;
coap_pdu_set_type;
+1
View File
@@ -140,6 +140,7 @@ coap_pdu_get_mid
coap_pdu_get_token
coap_pdu_get_type
coap_pdu_init
coap_pdu_parse
coap_pdu_set_code
coap_pdu_set_mid
coap_pdu_set_type