diff --git a/include/coap2/option.h b/include/coap2/option.h index 9691a53b..cb2f9c60 100644 --- a/include/coap2/option.h +++ b/include/coap2/option.h @@ -349,18 +349,6 @@ size_t coap_opt_encode(coap_opt_t *opt, const uint8_t *val, size_t length); -/** - * Decodes the delta value of the next option. This function returns the number - * of bytes read or @c 0 on error. The caller of this function must ensure that - * it does not read over the boundaries of @p opt (e.g. by calling - * coap_opt_check_delta(). - * - * @param opt The option to examine. - * - * @return The number of bytes read or @c 0 on error. - */ -uint16_t coap_opt_delta(const coap_opt_t *opt); - /** * Returns the length of the given option. @p opt must point to an option jump * or the beginning of the option. This function returns @c 0 when @p opt is not diff --git a/src/option.c b/src/option.c index 766d68e3..53918799 100644 --- a/src/option.c +++ b/src/option.c @@ -205,35 +205,6 @@ coap_check_option(coap_pdu_t *pdu, uint16_t type, return coap_option_next(oi); } -uint16_t -coap_opt_delta(const coap_opt_t *opt) { - uint16_t n; - - n = (*opt++ & 0xf0) >> 4; - - switch (n) { - case 15: /* error */ - coap_log(LOG_WARNING, "coap_opt_delta: illegal option delta\n"); - - /* This case usually should not happen, hence we do not have a - * proper way to indicate an error. */ - return 0; - case 14: - /* Handle two-byte value: First, the MSB + 269 is stored as delta value. - * After that, the option pointer is advanced to the LSB which is handled - * just like case delta == 13. */ - n = ((*opt++ & 0xff) << 8) + 269; - /* fall through */ - case 13: - n += *opt & 0xff; - break; - default: /* n already contains the actual delta value */ - ; - } - - return n; -} - uint32_t coap_opt_length(const coap_opt_t *opt) { uint32_t length;