15#include "deconz/aps.h"
16#include "deconz/timeref.h"
27 Binding(
const quint64 src,
const quint64 dst,
const quint16 clusterId,
const quint8 srcEndpoint,
const quint8 dstEndpoint);
28 Binding(
const quint64 src,
const quint16 dstGroup,
const quint16 clusterId,
const quint8 srcEndpoint);
30 quint64 srcAddress()
const {
return m_srcAddr; }
31 void setSrcAddress(quint64 src) { m_srcAddr = src; }
32 uint8_t srcEndpoint()
const {
return m_srcEndpoint; }
33 void setSrcEndpoint(
const uint8_t srcEndpoint) { m_srcEndpoint = srcEndpoint; }
34 uint16_t clusterId()
const {
return m_cluster; }
35 void setClusterId(
const uint16_t clusterId) { m_cluster = clusterId; }
40 uint8_t dstEndpoint()
const {
return m_dstEndpoint; }
41 void setDstEndpoint(
const uint8_t dstEndpoint) { m_dstEndpoint = dstEndpoint; }
43 bool readFromStream(QDataStream &stream);
51 bool operator==(
const Binding &other)
const
53 if (dstAddress() == other.dstAddress() &&
54 dstAddressMode() == other.dstAddressMode() &&
55 srcAddress() == other.srcAddress() &&
56 srcEndpoint() == other.srcEndpoint() &&
57 dstEndpoint() == other.dstEndpoint() &&
58 clusterId() == other.clusterId())
66 bool operator !=(
const Binding &other)
68 return !(*
this == other);
74 quint64 m_srcAddr = 0;
76 uint16_t m_cluster = 0xffff;
77 uint8_t m_srcEndpoint = 0xff;
78 uint8_t m_dstEndpoint = 0xff;
86 using size_type = std::vector<Binding>::size_type;
87 using iterator = std::vector<Binding>::iterator;
88 using const_iterator = std::vector<Binding>::const_iterator;
90 bool add(
const Binding &binding);
91 bool remove(
const Binding &binding);
92 size_type size()
const {
return m_table.size(); }
93 bool contains(
const Binding &binding)
const;
94 const_iterator const_begin()
const;
95 const_iterator const_end()
const;
96 const_iterator cbegin()
const;
97 const_iterator cend()
const;
100 void clearOldBindings();
105 std::vector<Binding> m_table;
Convenience class to work with network, extended and group addresses.
Definition aps.h:111
Definition binding_table.h:82
Definition binding_table.h:24
deCONZ::SteadyTimeRef confirmedTimeRef() const
Timestamp when the binding was last confirmed.
Definition binding_table.h:48
The deCONZ namespace.
Definition aps.cpp:19
ApsAddressMode
Address modes used to specify source and destination addresses.
Definition aps.h:83
@ ApsNoAddress
No addressing specified.
Definition aps.h:84
Declaration of the most common deCONZ library types.