Zigbee Protocol Controller 1.6.0
attribute_resolver.h
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2021 Silicon Laboratories Inc. www.silabs.com</b>
4 ******************************************************************************
5 * The licensor of this software is Silicon Laboratories Inc. Your use of this
6 * software is governed by the terms of Silicon Labs Master Software License
7 * Agreement (MSLA) available at
8 * www.silabs.com/about-us/legal/master-software-license-agreement. This
9 * software is distributed to you in Source Code format and is governed by the
10 * sections of the MSLA applicable to Source Code.
11 *
12 *****************************************************************************/
35#ifndef ATTRIBUTE_RESOLVER_H
36#define ATTRIBUTE_RESOLVER_H
37
38#include "sl_status.h"
39#include "attribute_store.h"
40#include "clock.h"
41#include <stdbool.h>
42
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
60typedef struct {
61 void (*send_init)(void);
63 const uint8_t *frame_data,
64 uint16_t frame_data_len,
65 bool is_set);
67 // Retry timeout for get commands
69 // Number of times to retry sending a get
72
77#define MAX_FRAME_LEN 255
78
112 attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len);
113
123
131
151
169 int depth);
170
177
184
202
215
225
237
249
262
274
281
295
305
316
321
322#ifdef __cplusplus
323}
324#endif
325
326#endif //ATTRIBUTE_RESOLVER_H
uint32_t attribute_store_type_t
Definition: attribute_store.h:50
sl_status_t(* attribute_resolver_function_t)(attribute_store_node_t node, uint8_t *frame, uint16_t *frame_len)
Generator function for building PAN frames.
Definition: attribute_resolver.h:111
bool attribute_resolver_node_or_child_needs_resolution(attribute_store_node_t node)
Verifies if the provided node, or any of its child needs resolution.
void attribute_resolver_pause_node_resolution(attribute_store_node_t node)
Pause the resolution on a given node.
sl_status_t attribute_resolver_set_attribute_depth(attribute_store_type_t node_type, int depth)
Set the relative depth of an attribute in the attribute tree.
void attribute_resolver_resume_node_resolution(attribute_store_node_t node)
Resume the resolution on a given node.
void attribute_resolver_set_resolution_listener(attribute_store_node_t node, attribute_resolver_callback_t callback)
Register a listener to be called when a node and all its children has been resolved.
attribute_resolver_config_t attribute_resolver_get_config()
returns the current configuration for the attribute resolver
void attribute_resolver_clear_resolution_listener(attribute_store_node_t node, attribute_resolver_callback_t callback)
Clear a node resolve listener.
void attribute_resolver_set_resolution_resumption_listener(attribute_store_node_t node, attribute_resolver_callback_t callback)
Sets a listener for unpausing nodes.
void attribute_resolver_clear_resolution_resumption_listener(attribute_store_node_t node, attribute_resolver_callback_t callback)
Sets a listener for unpausing nodes.
sl_status_t attribute_resolver_restart_set_resolution(attribute_store_node_t node)
Instructs the resolver to try to resolve a set rule that was pending.
sl_status_t attribute_resolver_init(attribute_resolver_config_t resolver_config)
Initialize the attribute resolver. This function will clear the rulebook and reset the resolver state...
void attribute_resolver_state_log()
Log the state of the Attribute Resolver using Unify Logging system.
sl_status_t attribute_resolver_restart_get_resolution(attribute_store_node_t node)
Instructs the resolver to try to resolve a get rule that was pending.
int attribute_resolver_teardown()
Teardown the attribute resolver.
void(* attribute_resolver_callback_t)(attribute_store_node_t node)
A callback type for notifying about resolver events.
Definition: attribute_resolver.h:48
void attribute_resolver_set_resolution_give_up_listener(attribute_store_type_t node_type, attribute_resolver_callback_t callback)
Registers a listener that will be informed if we give up trying to perform a Get resolution on a node...
bool is_node_or_parent_paused(attribute_store_node_t node)
This function traverses attribute store to check if any parent of the attribute node is paused or not...
bool is_node_pending_set_resolution(attribute_store_node_t node)
Returns true if a node is pending a set resolution. i.e. command has been sent and we are waiting for...
sl_status_t attribute_resolver_register_rule(attribute_store_type_t node_type, attribute_resolver_function_t set_func, attribute_resolver_function_t get_func)
Register an attribute rule.
datastore_attribute_id_t attribute_store_node_t
Handle to identify attribute store nodes.
Definition: attribute_store.h:101
uint32_t sl_status_t
Definition: sl_status.h:139
SL Status Codes.
Definition: attribute_resolver.h:60
uint8_t get_retry_count
Definition: attribute_resolver.h:70
clock_time_t get_retry_timeout
Definition: attribute_resolver.h:68