Z-Wave Protocol Controller Reference
zwave_association_toolbox.hpp
Go to the documentation of this file.
1/******************************************************************************
2 * # License
3 * <b>Copyright 2022 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
23#ifndef ZWAVE_ASSOCIATION_TOOLBOX_HPP
24#define ZWAVE_ASSOCIATION_TOOLBOX_HPP
25
27
28// Generic C++ includes
29#include <set>
30#include <vector>
31
32// We want the NODE_ID associations to be first while iterating the set.
34 bool operator()(const association_t &lhs, const association_t &rhs) const
35 {
36 return ((lhs.type << 24) | (lhs.node_id << 8) | (lhs.endpoint_id))
37 < ((rhs.type << 24) | (rhs.node_id << 8) | (rhs.endpoint_id));
38 }
39};
40
41using association_set = std::set<association_t, association_compare>;
42using association_bytes = std::vector<uint8_t>;
43
52
62 association_set &target);
63
74 association_bytes &target);
75
87 association_bytes &target);
88
97 const association_set &set_2,
98 association_set &result);
99
108 const association_set &set_2,
109 association_set &result);
110#endif //ZWAVE_ASSOCIATION_TOOLBOX_HPP
void get_association_list(association_bytes source, association_set &target)
Converts a bytestream from the attribute store to a set of associations.
void substract_association_lists(const association_set &set_1, const association_set &set_2, association_set &result)
Substract set_1 from set_2.
void get_node_id_association_bytestream(association_set source, association_bytes &target)
Converts a set of associations to a bytestream that contains only NodeID associations.
std::set< association_t, association_compare > association_set
Definition: zwave_association_toolbox.hpp:41
void get_association_bytestream(association_set source, association_bytes &target)
Converts a set of associations to a bytestream for the attribute store.
void get_node_id_association_list(association_bytes source, association_set &target)
Converts a bytestream from the attribute store to a set of NodeID associations. Everything after the ...
std::vector< uint8_t > association_bytes
Definition: zwave_association_toolbox.hpp:42
void merge_association_lists(const association_set &set_1, const association_set &set_2, association_set &result)
Merge set_1 and set_2.
Definition: zwave_association_toolbox.hpp:33
bool operator()(const association_t &lhs, const association_t &rhs) const
Definition: zwave_association_toolbox.hpp:34
Association object.
Definition: zwave_command_class_association_types.h:39
zwave_node_id_t node_id
‍NodeID for the association. Always valid
Definition: zwave_command_class_association_types.h:43
zwave_endpoint_id_t endpoint_id
‍NodeID for the association. Valid only if type=ENDPOINT
Definition: zwave_command_class_association_types.h:45
association_type_t type
‍Association Type
Definition: zwave_command_class_association_types.h:41