Z-Wave Protocol Controller Reference
zwave_tx_groups_internal.hpp
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 *****************************************************************************/
13
25#ifndef ZWAVE_TX_GROUPS_INTERNAL_HPP
26#define ZWAVE_TX_GROUPS_INTERNAL_HPP
27
28// Generic includes
29#include <set>
30
32
42 bool locked;
43};
44
45#ifdef __cplusplus
46extern "C" {
47#endif
48
54 const zwave_tx_group_t &rhs) const
55 {
56 return lhs.group_id > rhs.group_id;
57 }
58};
59
60// Our private list of groups
62{
63 private:
64 // List of assigned groups.
65 std::set<zwave_tx_group_t, zwave_tx_group_compare> groups;
66 // Variable to keep track of the next group to reuse
68
74
81
95 const zwave_nodemask_t group_nodes,
96 uint16_t *common_nodes) const;
103 bool is_node_list_empty(const zwave_nodemask_t nodes) const;
104
115
125 zwave_multicast_group_id_t group_id) const;
126
135
136 public:
145
159
178
190
205
220
230
237};
238
239#ifdef __cplusplus
240}
241#endif
242
243#endif //ZWAVE_TX_GROUPS_INTERNAL_HPP
Definition: zwave_tx_groups_internal.hpp:62
sl_status_t get_group_data(zwave_tx_group_t *group_data, zwave_multicast_group_id_t group_id) const
Returns the group data for a group.
zwave_multicast_group_id_t get_next_group_to_reuse()
Uses the next_group_id_to_reuse to re-use a already used group that is not currently locked.
std::set< zwave_tx_group_t, zwave_tx_group_compare > groups
Definition: zwave_tx_groups_internal.hpp:65
sl_status_t create_or_update_group(const zwave_tx_group_t &new_group)
Adds this group into the group list. If the Group ID is already in use update the existing group.
sl_status_t lock_group(zwave_multicast_group_id_t group_id)
Instructs the Z-Wave TX Group not to alter the list of NodeIDs part of a group, until the group is un...
sl_status_t assign_group(const zwave_nodemask_t nodes, zwave_multicast_group_id_t *group_id)
Assigns/returns a Group ID to the list of NodeIDs.
~zwave_tx_groups()
Class destructor.
void log(zwave_multicast_group_id_t group_id)
Logs the content / state of the group using sl_log.
sl_status_t add_node_to_group(zwave_node_id_t node_id, zwave_multicast_group_id_t group_id)
Forces to add a NodeID to a group.
bool is_group_locked(zwave_multicast_group_id_t group_id)
Verifies if a group is locked.
zwave_tx_groups()
Class constructor.
sl_status_t analyze_group_suitability(const zwave_nodemask_t nodes, const zwave_nodemask_t group_nodes, uint16_t *common_nodes) const
Tells how suitable is a group reuse for a node list.
sl_status_t unlock_group(zwave_multicast_group_id_t group_id)
Instructs the Z-Wave TX Group that the list of NodeIDs part of a group can be modified.
void increment_next_group_id()
Increments the next_group_id_to_reuse private variable and makes sure to roll around when we reached ...
bool is_node_list_empty(const zwave_nodemask_t nodes) const
Verify if a node list is empty.
zwave_multicast_group_id_t get_most_similar_subgroup(const zwave_nodemask_t nodes) const
Finds the best group to use or reuse for a given node list.
sl_status_t get_nodes(zwave_nodemask_t nodes, zwave_multicast_group_id_t group_id)
Returns the list of NodeIDs part of a group.
zwave_multicast_group_id_t next_group_id_to_reuse
Definition: zwave_tx_groups_internal.hpp:67
uint32_t sl_status_t
Definition: sl_status.h:139
uint8_t zwave_multicast_group_id_t
Definition: zwave_controller_types.h:43
uint8_t zwave_nodemask_t[ZW_LR_MAX_NODEMASK_LENGTH]
Node mask.
Definition: zwave_node_id_definitions.h:81
uint16_t zwave_node_id_t
Z-Wave NodeID type.
Definition: zwave_node_id_definitions.h:84
constexpr zwave_multicast_group_id_t MAXIMUM_ZWAVE_TX_GROUP_ID
Definition: zwave_tx_groups_internal.hpp:31
Helps to sort groups, based on their zwave_multicast_group_id_t Group ID.
Definition: zwave_tx_groups_internal.hpp:52
bool operator()(const zwave_tx_group_t &lhs, const zwave_tx_group_t &rhs) const
Definition: zwave_tx_groups_internal.hpp:53
Group data contained in a Z-Wave Tx Group.
Definition: zwave_tx_groups_internal.hpp:36
zwave_nodemask_t node_list
Node list for the group.
Definition: zwave_tx_groups_internal.hpp:40
zwave_multicast_group_id_t group_id
GroupID handle for the group. User components will use this.
Definition: zwave_tx_groups_internal.hpp:38
bool locked
Boolean indicating if the group can be modified by this component.
Definition: zwave_tx_groups_internal.hpp:42
const zwave_node_id_t node_id