mirror of
https://github.com/obgm/libcoap.git
synced 2026-11-09 02:32:53 +03:00
Commented out coap_opt_block_set_m() as it is not used anywhere, and needs to get rewritten if needed. Removed / changed references to coap_opt_const_value() Created a new struct coap_str_const_t to handle const parameters Add in 2 new functions to create / delete the new string type coap_new_str_const() coap_delete_str_const() Added in coap_make_str_const() to help create the necessary string equivalents of the ascii test string. Note that the byte array must be in the local scope. Make coap_string_equal() a macro to handle differing string types Made uri_path a pointer in coap_resource_t Made name and value a pointer in coap_attribute_t Reasoning behind this was triggerred by test t_wellknown3() creating a number of resources, all using the same string buffer, so they all ended up with the same uri-path (last update to uri-path). In the days of hashing uri-path for the lookup would have worked, but the wrong uri-path presented from the resource. Now we always allocate uri-path if application does not want it freed off - and always free it off at time or resource removal. The same is also true for coap_add_attr(). Updated coap_resource_init(), coap_add_attr() and coap_find_attr() to pass in string parameters, rather than use a pointer to data and a length. Where appropriate Replace 'unsigned char' with 'const uint8_t' Replace 'str' with 'coap_str_const_t' Replace 'str' with 'coap_string_t' Prefix with 'const' some type casts Remove 'const' prefix from some type casts