Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
Association Data Store
+ Collaboration diagram for Association Data Store:

Data Structures

struct  s_ZAF_ADS_SecurityHighestClass_t
 

Macros

#define ZAF_ADS_HEADER_SIZE   4
 
#define ZAF_ADS_ELEMENT_SIZE   20
 
#define ZAF_ADS_STORAGE_SIZE(num_elements)   (ZAF_ADS_HEADER_SIZE + (num_elements) * ZAF_ADS_ELEMENT_SIZE)
 
#define ZAF_ADS_STORAGE(name, num_elements)   union { void *align; uint8_t storage[ZAF_ADS_STORAGE_SIZE(num_elements)]; } name
 

Typedefs

typedef void * ZAF_ADS_Handle_t
 

Enumerations

enum  e_ZAF_ADS_SecurityHighestClassState_t {
  SECURITY_HIGHEST_CLASS_NOT_DISCOVERED ,
  SECURITY_HIGHEST_CLASS_DISCOVERED_NOT_GRANTED_TO_ME ,
  SECURITY_HIGHEST_CLASS_DISCOVERED
}
 
enum  e_ZAF_ADS_CC_Capability_t {
  CC_CAPABILITY_NOT_DISCOVERED ,
  CC_CAPABILITY_SUPPORTED ,
  CC_CAPABILITY_NOT_SUPPORTED
}
 
enum  e_ZAF_ADS_CommandClass_t {
  ZAF_ADS_CC_SUPERVISION ,
  ZAF_ADS_CC_MULTI_COMMAND ,
  ZAF_ADS_MAX_CC
}
 

Functions

ZAF_ADS_Handle_t ZAF_ADS_Init (void *pStorage, uint8_t MaxNodeCount)
 
bool ZAF_ADS_Delete (ZAF_ADS_Handle_t handle, uint8_t NodeID)
 
e_ZAF_ADS_SecurityHighestClassState_t ZAF_ADS_GetNodeHighestSecurityClass (ZAF_ADS_Handle_t handle, uint8_t NodeID, security_key_t *pHighestClass)
 
bool ZAF_ADS_SetNodeHighestSecurityClass (ZAF_ADS_Handle_t handle, uint8_t NodeID, security_key_t HighestClass)
 
e_ZAF_ADS_CC_Capability_t ZAF_ADS_IsNodeSupportingCC (ZAF_ADS_Handle_t handle, uint8_t NodeID, e_ZAF_ADS_CommandClass_t commandClass)
 
bool ZAF_ADS_SetNodeIsSupportingCC (ZAF_ADS_Handle_t handle, uint8_t NodeID, e_ZAF_ADS_CommandClass_t commandClass, e_ZAF_ADS_CC_Capability_t CC_Capability)
 

Detailed Description

Macro Definition Documentation

◆ ZAF_ADS_ELEMENT_SIZE

#define ZAF_ADS_ELEMENT_SIZE   20

◆ ZAF_ADS_HEADER_SIZE

#define ZAF_ADS_HEADER_SIZE   4

◆ ZAF_ADS_STORAGE

#define ZAF_ADS_STORAGE ( name,
num_elements )   union { void *align; uint8_t storage[ZAF_ADS_STORAGE_SIZE(num_elements)]; } name

Allocates storage at a word boundary (or any other boundary if needed)

Please see ZAF_ADS_Init.

◆ ZAF_ADS_STORAGE_SIZE

#define ZAF_ADS_STORAGE_SIZE ( num_elements)    (ZAF_ADS_HEADER_SIZE + (num_elements) * ZAF_ADS_ELEMENT_SIZE)

Typedef Documentation

◆ ZAF_ADS_Handle_t

typedef void* ZAF_ADS_Handle_t

Type to use when defining a handle for the ADS functions.

The handle is assigned by calling ZAF_ADS_Init.

Enumeration Type Documentation

◆ e_ZAF_ADS_CC_Capability_t

Defines the states of a command class discovery.

Enumerator
CC_CAPABILITY_NOT_DISCOVERED 

Support of the CC has not yet been discovered.

CC_CAPABILITY_SUPPORTED 

The CC is supported.

CC_CAPABILITY_NOT_SUPPORTED 

The CC is NOT supported.

◆ e_ZAF_ADS_CommandClass_t

Defines the list of command classes for which the support can be stored.

Enumerator
ZAF_ADS_CC_SUPERVISION 

Command Class Supervision.

ZAF_ADS_CC_MULTI_COMMAND 

Command Class Multi Command.

ZAF_ADS_MAX_CC 

Must be the last element in this enum.

◆ e_ZAF_ADS_SecurityHighestClassState_t

Defines the states of a highest security class discovery.

Enumerator
SECURITY_HIGHEST_CLASS_NOT_DISCOVERED 

Not discovered yet.

SECURITY_HIGHEST_CLASS_DISCOVERED_NOT_GRANTED_TO_ME 

The security class has been discovered but was not granted to me.

SECURITY_HIGHEST_CLASS_DISCOVERED 

The Security class has been discovered and is granted to me.

Function Documentation

◆ ZAF_ADS_Delete()

bool ZAF_ADS_Delete ( ZAF_ADS_Handle_t handle,
uint8_t NodeID )

Removes all information related to a NodeID in the data store.

Parameters
handleADS handle returned from ZAF_ADS_Init.
NodeIDNode ID to remove.
Returns
Returns true if the node was removed, and false otherwise.

◆ ZAF_ADS_GetNodeHighestSecurityClass()

e_ZAF_ADS_SecurityHighestClassState_t ZAF_ADS_GetNodeHighestSecurityClass ( ZAF_ADS_Handle_t handle,
uint8_t NodeID,
security_key_t * pHighestClass )

Returns the highest security class for a given NodeID.

Parameters
handleADS handle returned from ZAF_ADS_Init.
NodeIDNode ID of which the highest security class must be read.
pHighestClassPointer to variable where the highest security class must be written.
Returns
Returns the state of the discovery for the given node ID.

◆ ZAF_ADS_Init()

ZAF_ADS_Handle_t ZAF_ADS_Init ( void * pStorage,
uint8_t MaxNodeCount )

Initializes the Association Data Store.

This function must be invoked before all the other ADS functions.

Parameters
pStoragePointer to allocated storage by ZAF_ADS_STORAGE. The name given in ZAF_ADS_STORAGE is what must be supplied as this argument.
MaxNodeCountMaxNodeCount should be set to the max number of nodes that can be associated in controlling association groups. A controlling group is one that can transmit set or get commands. If an application has one controlling group that sends Basic Set, and the group can contain 5 associations, the MaxNodeCount should be set to 5.

This value must match the number of elements given in ZAF_ADS_STORAGE.

Returns
Returns a handle to the allocated Association Data Store.

◆ ZAF_ADS_IsNodeSupportingCC()

e_ZAF_ADS_CC_Capability_t ZAF_ADS_IsNodeSupportingCC ( ZAF_ADS_Handle_t handle,
uint8_t NodeID,
e_ZAF_ADS_CommandClass_t commandClass )

Returns whether a node supports a given CC or not.

Parameters
handleADS handle returned from ZAF_ADS_Init.
NodeIDNode ID of which the check is made.
commandClassCommand class to check support for.
Returns
Returns the state of the CC support discovery.

◆ ZAF_ADS_SetNodeHighestSecurityClass()

bool ZAF_ADS_SetNodeHighestSecurityClass ( ZAF_ADS_Handle_t handle,
uint8_t NodeID,
security_key_t HighestClass )

Sets the highest security class of a node.

Parameters
handleADS handle returned from ZAF_ADS_Init.
NodeIDNode ID of which the highest security class must be set.
HighestClassSecurity class to be set as the highest.
Returns
Returns true if the class was set and false if there were no free slots in the ADS (increase the MaxNodeCount for the storage space used with ZAF_ADS_Init)

◆ ZAF_ADS_SetNodeIsSupportingCC()

bool ZAF_ADS_SetNodeIsSupportingCC ( ZAF_ADS_Handle_t handle,
uint8_t NodeID,
e_ZAF_ADS_CommandClass_t commandClass,
e_ZAF_ADS_CC_Capability_t CC_Capability )

Sets whether a given node supports a given CC.

Parameters
handleADS handle returned from ZAF_ADS_Init.
NodeIDNode ID of which the given CC must be set.
commandClassCC that is discovered.
CC_CapabilityState of the support.
Returns
Returns true if the state was set and false if there were no free slots in the ADS (increase the MaxNodeCount for the storage space used with ZAF_ADS_Init)