mirror of
https://github.com/obgm/libcoap.git
synced 2026-10-30 22:45:49 +03:00
option.[hc]: remove unused function coap_opt_delta()
This commit is contained in:
1 parent
b1ee9c8912
commit
605f990ef6
2 files changed
-41
No files matched your search
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user