|
| #define | COAP_MALLOC_TYPE(Type) ((coap_##Type##_t *)coap_malloc(sizeof(coap_##Type##_t))) |
| |
| #define | COAP_FREE_TYPE(Type, Object) coap_free(Object) |
| |
| #define | COAP_PRINT_STATUS_MAX (~COAP_PRINT_STATUS_MASK) |
| |
| #define | min(a, b) ((a) < (b) ? (a) : (b)) |
| |
| #define | PRINT_WITH_OFFSET(Buf, Offset, Char) |
| | Adds Char to Buf if Offset is zero. More...
|
| |
| #define | PRINT_COND_WITH_OFFSET(Buf, Bufend, Offset, Char, Result) |
| | Adds Char to Buf if Offset is zero and Buf is less than Bufend. More...
|
| |
| #define | COPY_COND_WITH_OFFSET(Buf, Bufend, Offset, Str, Length, Result) |
| | Copies at most Length characters of Str to Buf. More...
|
| |
| #define | MATCH_URI 0x01 |
| |
| #define | MATCH_PREFIX 0x02 |
| |
| #define | MATCH_SUBSTRING 0x04 |
| |
| #define | INET6_ADDRSTRLEN 40 |
| |
|
| static int | match (const coap_str_const_t *text, const coap_str_const_t *pattern, int match_prefix, int match_substring) |
| |
| coap_print_status_t | coap_print_wellknown (coap_context_t *context, unsigned char *buf, size_t *buflen, size_t offset, coap_opt_t *query_filter) |
| | Prints the names of all known resources to buf. More...
|
| |
| coap_resource_t * | coap_resource_init (coap_str_const_t *uri_path, int flags) |
| | Creates a new resource object and initializes the link field to the string uri_path. More...
|
| |
| coap_resource_t * | coap_resource_unknown_init (coap_method_handler_t put_handler) |
| | Creates a new resource object for the unknown resource handler with support for PUT. More...
|
| |
| coap_resource_t * | coap_resource_proxy_uri_init (coap_method_handler_t handler, size_t host_name_count, const char *host_name_list[]) |
| | Creates a new resource object for handling proxy URIs. More...
|
| |
| coap_attr_t * | coap_add_attr (coap_resource_t *resource, coap_str_const_t *name, coap_str_const_t *val, int flags) |
| | Registers a new attribute with the given resource. More...
|
| |
| coap_attr_t * | coap_find_attr (coap_resource_t *resource, coap_str_const_t *name) |
| | Returns resource's coap_attr_t object with given name if found, NULL otherwise. More...
|
| |
| coap_str_const_t * | coap_attr_get_value (coap_attr_t *attr) |
| | Returns attribute's value. More...
|
| |
| void | coap_delete_attr (coap_attr_t *attr) |
| | Deletes an attribute. More...
|
| |
| static void | coap_notify_observers (coap_context_t *context, coap_resource_t *r, coap_deleting_resource_t deleting) |
| |
| static void | coap_free_resource (coap_resource_t *resource) |
| |
| void | coap_add_resource (coap_context_t *context, coap_resource_t *resource) |
| | Registers the given resource for context. More...
|
| |
| int | coap_delete_resource (coap_context_t *context, coap_resource_t *resource) |
| | Deletes a resource identified by resource. More...
|
| |
| void | coap_delete_all_resources (coap_context_t *context) |
| | Deletes all resources from given context and frees their storage. More...
|
| |
| coap_resource_t * | coap_get_resource_from_uri_path (coap_context_t *context, coap_str_const_t *uri_path) |
| | Returns the resource identified by the unique string uri_path. More...
|
| |
| coap_print_status_t | coap_print_link (const coap_resource_t *resource, unsigned char *buf, size_t *len, size_t *offset) |
| | Writes a description of this resource in link-format to given text buffer. More...
|
| |
| void | coap_register_handler (coap_resource_t *resource, coap_request_t method, coap_method_handler_t handler) |
| | Registers the specified handler as message handler for the request type method. More...
|
| |
| coap_subscription_t * | coap_find_observer (coap_resource_t *resource, coap_session_t *session, const coap_binary_t *token) |
| | Returns a subscription object for given peer. More...
|
| |
| static coap_subscription_t * | coap_find_observer_cache_key (coap_resource_t *resource, coap_session_t *session, const coap_cache_key_t *cache_key) |
| |
| coap_subscription_t * | coap_add_observer (coap_resource_t *resource, coap_session_t *session, const coap_binary_t *token, const coap_pdu_t *request) |
| | Adds the specified peer as observer for resource. More...
|
| |
| void | coap_touch_observer (coap_context_t *context, coap_session_t *session, const coap_binary_t *token) |
| | Flags that data is ready to be sent to observers. More...
|
| |
| int | coap_delete_observer (coap_resource_t *resource, coap_session_t *session, const coap_binary_t *token) |
| | Removes any subscription for observer from resource and releases the allocated storage. More...
|
| |
| void | coap_delete_observers (coap_context_t *context, coap_session_t *session) |
| | Removes any subscription for session and releases the allocated storage. More...
|
| |
| int | coap_resource_set_dirty (coap_resource_t *r, const coap_string_t *query) |
| |
| int | coap_resource_notify_observers (coap_resource_t *r, const coap_string_t *query COAP_UNUSED) |
| |
| void | coap_resource_set_mode (coap_resource_t *resource, int mode) |
| | Sets the notification message type of resource resource to given mode. More...
|
| |
| void | coap_resource_set_userdata (coap_resource_t *resource, void *data) |
| | Sets the user_data. More...
|
| |
| void * | coap_resource_get_userdata (coap_resource_t *resource) |
| | Gets the user_data. More...
|
| |
| void | coap_resource_release_userdata_handler (coap_context_t *context, coap_resource_release_userdata_handler_t callback) |
| | Defines the context wide callback to use to when the resource is deleted to release the data held in the resource's user_data. More...
|
| |
| void | coap_resource_set_get_observable (coap_resource_t *resource, int mode) |
| | Set whether a resource is observable. More...
|
| |
| coap_str_const_t * | coap_resource_get_uri_path (coap_resource_t *resource) |
| | Get the uri_path from a resource. More...
|
| |
| void | coap_check_notify (coap_context_t *context) |
| | Checks all known resources to see if they are dirty and then notifies subscribed observers. More...
|
| |
| static void | coap_remove_failed_observers (coap_context_t *context, coap_resource_t *resource, coap_session_t *session, const coap_binary_t *token) |
| | Checks the failure counter for (peer, token) and removes peer from the list of observers for the given resource when COAP_OBS_MAX_FAIL is reached. More...
|
| |
| void | coap_handle_failed_notify (coap_context_t *context, coap_session_t *session, const coap_binary_t *token) |
| | Handles a failed observe notify. More...
|
| |