mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-05 09:22:54 +03:00
The implementation of option filters based on coap_opt_filter_t has changed to improve support for long option numbers. An option filter is now a sparse field of a fixed size that can hold up to COAP_OPT_FILTER_LONG options with a number larger than 255, and up to COAP_OPT_FILTER_SHORT options with a number of 255 or less. The space taken by coap_opt_filter_t is 2 * ((((COAP_OPT_FILTER_SHORT + 1) >> 1) + COAP_OPT_FILTER_LONG) + 1), or 12 bytes with the default settings for COAP_OPT_FILTER_SHORT == 6 and COAP_OPT_FILTER_LONG == 2. Three new functions have been added to the option filter API: * coap_option_filter_set() to store an option number in a filter, * coap_option_filter_get() to check if a filter contains a given option number, and * coap_option_filter_unset() to remove an option number from a filter. The previously existing functions coap_option_setb(), coap_option_getb(), and coap_option_clrb() continue to work on the new option filter unchanged but now are deprecated.