Zigbee Protocol Controller 1.6.0
attribute_resolver_rule.h File Reference

This module defines necessary API for using resolver. More...

#include "attribute_store.h"
#include "attribute_resolver.h"
#include "clock.h"

Go to the source code of this file.

enum  resolver_send_status_t {
  RESOLVER_SEND_STATUS_OK , RESOLVER_SEND_STATUS_OK_EXECUTION_PENDING , RESOLVER_SEND_STATUS_FAIL , RESOLVER_SEND_STATUS_OK_EXECUTION_VERIFIED ,
  RESOLVER_SEND_STATUS_OK_EXECUTION_FAILED , RESOLVER_SEND_STATUS_ALREADY_HANDLED , RESOLVER_SEND_STATUS_ABORTED
}
 Status code for the frame transmission. More...
 
enum  resolver_rule_type_t { RESOLVER_SET_RULE , RESOLVER_GET_RULE }
 Status code for the frame transmission. More...
 
typedef void(* resolver_on_set_rule_registered_t) (attribute_store_type_t)
 Function prototype for getting notified of set rules. More...
 
void attribute_resolver_register_set_rule_listener (resolver_on_set_rule_registered_t function)
 Registers a callback/listening function for the known set rules. This function will be invoked for each known attribute store type that can be set. More...
 
attribute_resolver_function_t attribute_resolver_get_function (attribute_store_type_t node_type)
 Return the get function for a given attribute type. More...
 
attribute_resolver_function_t attribute_resolver_set_function (attribute_store_type_t node_type)
 Return the set function for a given attribute type. More...
 
bool attribute_resolver_has_set_rule (attribute_store_type_t node_type)
 Returns if the Rule Book can resolve a Set Rule for the attribute type. More...
 
bool attribute_resolver_has_get_rule (attribute_store_type_t node_type)
 Returns if the Rule Book can resolve a Get Rule for the attribute type. More...
 
void on_resolver_send_data_complete (resolver_send_status_t status, clock_time_t transmit_time, attribute_store_node_t node, resolver_rule_type_t rule_type)
 Callback function which must be called when frame tranmission is done. More...
 

Detailed Description

This module defines necessary API for using resolver.

Typedef Documentation

◆ resolver_on_set_rule_registered_t

typedef void(* resolver_on_set_rule_registered_t) (attribute_store_type_t)

Function prototype for getting notified of set rules.

Enumeration Type Documentation

◆ resolver_rule_type_t

Status code for the frame transmission.

Enumerator
RESOLVER_SET_RULE 

Rule type is a set.

RESOLVER_GET_RULE 

Rule type is a get.

◆ resolver_send_status_t

Status code for the frame transmission.

Enumerator
RESOLVER_SEND_STATUS_OK 

Frame was delivered to the target, but we don't know if the command was executed on application level

RESOLVER_SEND_STATUS_OK_EXECUTION_PENDING 

Frame delivery to target succeeded but the target needs time to Reach the Desired value.

RESOLVER_SEND_STATUS_FAIL 

Frame delivery to target failed

RESOLVER_SEND_STATUS_OK_EXECUTION_VERIFIED 

Frame was delivered to target and we know for sure that the operation has been accepted, ie. the light is actually on now

RESOLVER_SEND_STATUS_OK_EXECUTION_FAILED 

Frame was delivered to target and it either does not support the operation or it failed trying

RESOLVER_SEND_STATUS_ALREADY_HANDLED 

A custom handler took care of parsing the status and adjusting the attribute store values.

RESOLVER_SEND_STATUS_ABORTED 

The resolution was aborted and we should move on.

Function Documentation

◆ attribute_resolver_get_function()

attribute_resolver_function_t attribute_resolver_get_function ( attribute_store_type_t  node_type)

Return the get function for a given attribute type.

Parameters
node_type
Returns
NULL if this attribute type cannot be resolved. Else the attribute_resolver_function_t that can resolve this particular attribute

◆ attribute_resolver_has_get_rule()

bool attribute_resolver_has_get_rule ( attribute_store_type_t  node_type)

Returns if the Rule Book can resolve a Get Rule for the attribute type.

Parameters
node_typeThe attribute Store node type for which we want to know if there is a Get rule registered.
Returns
true if a Get rule is registered false if no Get rule is registered

◆ attribute_resolver_has_set_rule()

bool attribute_resolver_has_set_rule ( attribute_store_type_t  node_type)

Returns if the Rule Book can resolve a Set Rule for the attribute type.

Parameters
node_typeThe attribute Store node type for which we want to know if there is a Set rule registered.
Returns
true if a set rule is registered false if no set rule is registered

◆ attribute_resolver_register_set_rule_listener()

void attribute_resolver_register_set_rule_listener ( resolver_on_set_rule_registered_t  function)

Registers a callback/listening function for the known set rules. This function will be invoked for each known attribute store type that can be set.

Parameters
functionThe function to call to notify of new set rules

◆ attribute_resolver_set_function()

attribute_resolver_function_t attribute_resolver_set_function ( attribute_store_type_t  node_type)

Return the set function for a given attribute type.

Parameters
node_type
Returns
NULL if this attribute type cannot be resolved. Else the attribute_resolver_function_t that can resolve this particular attribute

◆ on_resolver_send_data_complete()

void on_resolver_send_data_complete ( resolver_send_status_t  status,
clock_time_t  transmit_time,
attribute_store_node_t  node,
resolver_rule_type_t  rule_type 
)

Callback function which must be called when frame tranmission is done.

This function must be called when a frame sent using attribute_resolver_send is done.

Parameters
statusStatus of transmission
nodeAttribute node for which the frame was sent.
transmit_timedureation of the transmission
rule_typeThe rule type that was used for resolution.