Data Structures | |
struct | ASSOCIATION_GROUP |
Contains associations for one group. More... | |
struct | ASSOCIATION_GROUP_PACKED |
Contains associations for one group packed for the file system. More... | |
struct | SAssociationInfo |
Macros | |
#define | FREE_VALUE 0x00FF |
#define | NOT_VALID_GROUP_ID 0 |
Invalid group ID. | |
#define | LIFELINE_GROUP_ID 1 |
LIFELINE group ID. | |
#define | LIFELINE_ENDPOINT_ALLOWED 0 |
The only allowed endpoint of the Lifeline group! | |
#define | ZAF_FILE_SIZE_ASSOCIATIONINFO (sizeof(SAssociationInfo)) |
Typedefs | |
typedef struct SAssociationInfo | SAssociationInfo |
Functions | |
NODE_LIST_STATUS | handleAssociationGetnodeList (uint8_t groupId, uint8_t ep, destination_info_t **ppListOfNodes, uint8_t *pListLen) |
void | AssociationGetDestinationInit (destination_info_t *pFirstDestination) |
bool | AssociationGetBitAdressingDestination (destination_info_t **ppNodeList, uint8_t *pListLength, destination_info_t *pNode) |
uint32_t | AssociationGetSinglecastNodeCount (void) |
destination_info_t * | AssociationGetNextSinglecastDestination (void) |
uint8_t | AssociationGetSinglecastEndpointDestinationCount (void) |
TRANSMIT_OPTIONS_TYPE_EX * | ReqNodeList (AGI_PROFILE const *const pProfile, cc_group_t const *const pCurrentCmdGrp, const uint8_t sourceEndpoint) |
CC Association and CC Multi Channel Association enable application level control of other devices.
For instance, a wall switch can control an LED bulb if an association to the LED bulb is created in the wall switch. Another example could be a motion sensor that turns on an LED bulb when motion is detected. Such associations can be created using either Association Set or Multi Channel Association Set.
Both CCs share a common module that stores the actual associations.
The specifications of CC Association and CC Multi Channel Association can be found in https://github.com/Z-Wave-Alliance/AWG/tree/main/source/management_command_classes/command_class_definitions
#define FREE_VALUE 0x00FF |
#define LIFELINE_ENDPOINT_ALLOWED 0 |
The only allowed endpoint of the Lifeline group!
#define LIFELINE_GROUP_ID 1 |
LIFELINE group ID.
#define NOT_VALID_GROUP_ID 0 |
Invalid group ID.
#define ZAF_FILE_SIZE_ASSOCIATIONINFO (sizeof(SAssociationInfo)) |
typedef struct SAssociationInfo SAssociationInfo |
enum NODE_LIST_STATUS |
Enum type NODE_LIST_STATUS is used for return status on API call AGI_NodeIdListGetNext. Enum types from NODE_LIST_STATUS_SUCCESS to NODE_LIST_STATUS_ERROR_LIST deliver status on the call and after NODE_LIST_STATUS_ERROR_LIST deliver an error identifiers pointing to a problem in application AGI/association configuarion.
bool AssociationGetBitAdressingDestination | ( | destination_info_t ** | ppNodeList, |
uint8_t * | pListLength, | ||
destination_info_t * | pNode ) |
Outputs a node where associations to multiple endpoints of that node exist. The pNode [OUT] (list) will contain all the endpoints using bit addressing, for endpoints equal or less than 7.
Operation: For the first encounter of a nodeID and an endpoint, this function will search for the same nodeID and add their endpoints to the endpoint-field as bit-flags. First time this function encounters a node without a valid endpoint for bit-addressing, it will terminate and return false because the list is sorted.
If there are zero nodes with multiple endpoints associated, the function will return false and write NULL to the pointer returned, pNode.
If further nodes with multiple endpoints associated exist after the initial list is created, the function will return true and indicate that this function is not finished.
If the function returns true, the invoker must invoke the function again to get the next node.
If there are no more nodes with multiple endpoints, the function will return false, as this function is only designed to return node-destinations with endpoints.
Example with 6 associations in total: (This is a pre-sorted list in accordance to requirements of this function!) 3.1 3.2 4.1 4.2 5.1 6.0
[in,out] | ppNodeList | - Address of pointer to an element in the node list. The pointer will be updated as this function travels through the node list. |
[in,out] | pListLength | - Pointer to length of the node list. The value will be updated by this function. |
[out] | pNode | - Address of the memory to where the node is written. |
void AssociationGetDestinationInit | ( | destination_info_t * | pFirstDestination | ) |
Initializes the fetching of nodes before e.g. a transmission. It places a destination_node_list into the system.
MUST be invoked before AssociationGetBitAdressingDestination(), AssociationGetSinglecastNodeCount() and AssociationGetNextSinglecastDestination().
[in] | pFirstDestination | Address of the first association in a group. Retrieved by invoking handleAssociationGetnodeList(). |
destination_info_t * AssociationGetNextSinglecastDestination | ( | void | ) |
Returns the address of the next association like an iterator. This function needs to know beforehand how many items it needs to iterate through.
If the number of iterations are more than totalNodeCount, there will be repeated return of the same item. If the number of iterations are less than totalNodeCount, it will impact the next transmission using this iterator.
AssociationGetDestinationInit() MUST have been invoked before this function.
This function must be invoked only AFTER AssociationGetBitAdressingDestination() has returned false.
Continuously invoking this function will return the next association. If there are no more associations in the group, the first one in the same group will be returned and so forth.
If the group is empty, the function will ASSERT.
uint8_t AssociationGetSinglecastEndpointDestinationCount | ( | void | ) |
Returns the number of endpoint destinations in the active node association list.
AssociationGetDestinationInit() MUST have been invoked before this function.
uint32_t AssociationGetSinglecastNodeCount | ( | void | ) |
Returns the number of associations after the bit addressing destinations are removed.
This function MUST be invoked AFTER AssociationGetBitAdressingDestination() has returned false.
NODE_LIST_STATUS handleAssociationGetnodeList | ( | uint8_t | groupId, |
uint8_t | ep, | ||
destination_info_t ** | ppListOfNodes, | ||
uint8_t * | pListLen ) |
Delivers a list of nodes in a given association group corresponding to a given endpoint.
[in] | groupId | Association group ID. |
[in] | ep | Endpoint. |
[out] | ppListOfNodes | is out double-pointer of type MULTICHAN_NODE_ID deliver node list |
[out] | pListLen | length of list |
TRANSMIT_OPTIONS_TYPE_EX * ReqNodeList | ( | AGI_PROFILE const *const | pProfile, |
cc_group_t const *const | pCurrentCmdGrp, | ||
const uint8_t | sourceEndpoint ) |
Returns TX options containing a list of nodes found in the association group that matches the given AGI profile, command class / command pair and source endpoint.
This function must be called to construct the TX options for ZW_TransportMulticast_SendRequest().
[in] | pProfile | Pointer to AGI profile. |
[in] | pCurrentCmdGrp | Pointer to command class / command pair. |
[in] | sourceEndpoint | The endpoint for which the nodes are associated. |