[][src]Type Definition libcoap_sys::coap_opt_filter_t

type coap_opt_filter_t = [u16; 6];

Fixed-size vector we use for option filtering. It is large enough to hold COAP_OPT_FILTER_SHORT entries with an option number between 0 and 255, and COAP_OPT_FILTER_LONG entries with an option number between 256 and 65535. Its internal structure is

@code struct { uint16_t mask; uint16_t long_optsCOAP_OPT_FILTER_LONG; uint8_t short_optsCOAP_OPT_FILTER_SHORT; } @endcode

The first element contains a bit vector that indicates which fields in the remaining array are used. The first COAP_OPT_FILTER_LONG bits correspond to the long option types that are stored in the elements from index 1 to COAP_OPT_FILTER_LONG. The next COAP_OPT_FILTER_SHORT bits correspond to the short option types that are stored in the elements from index COAP_OPT_FILTER_LONG + 1 to COAP_OPT_FILTER_LONG + COAP_OPT_FILTER_SHORT. The latter elements are treated as bytes.