The Zigbee Group Table Zigbee Specification r22.1.0, Section 2.2.8.3 and 3.6.6.1 The group table is a special table that is accessible by both the Zigbee NWK and APS layers. More...
#include "zigbee-group-table.h"
Public Member Functions | |
ZigbeeGroupTable () | |
Constructor for Zigbee group table. | |
~ZigbeeGroupTable () | |
Destructor for Zigbee group table. | |
bool | AddEntry (uint16_t groupId, uint8_t endPoint) |
Add a group ID and its related endpoint. | |
bool | IsGroupMember (uint16_t groupId) const |
Indicates whether the group ID exists in the group table. | |
bool | LookUpEndPoints (uint16_t groupId, std::vector< uint8_t > &endPoints) const |
Look up the endpoints associated with a given group ID. | |
bool | RemoveEntry (uint16_t groupId, uint8_t endPoint) |
Remove endpoint from a group. | |
bool | RemoveMembership (uint8_t endPoint) |
Remove the endPoint from all groups. | |
![]() | |
SimpleRefCount () | |
Default constructor. | |
SimpleRefCount (const SimpleRefCount &o) | |
Copy constructor. | |
uint32_t | GetReferenceCount () const |
Get the reference count of the object. | |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
Assignment operator. | |
void | Ref () const |
Increment the reference count. | |
void | Unref () const |
Decrement the reference count. | |
Private Attributes | |
std::unordered_map< uint16_t, std::bitset< MAX_ENDPOINT_ENTRIES > > | m_groupTable |
The group table object. | |
Static Private Attributes | |
static constexpr int | MAX_ENDPOINT_ENTRIES {256} |
The maximum amount of endpoints allowed per group id entry. | |
static constexpr int | MAX_GROUP_ID_ENTRIES {256} |
The maximum amount of group ID entries allowed in the table. | |
The Zigbee Group Table Zigbee Specification r22.1.0, Section 2.2.8.3 and 3.6.6.1 The group table is a special table that is accessible by both the Zigbee NWK and APS layers.
It is used to store group IDs and associated endpoints. The group table is used in GroupCasting operations (A type of multicast in Zigbee). In this implementation, the group table is represented as a map where the key is the group ID and the value is a bitset representing the endpoints associated with that group ID. Each bit in the bitset corresponds to an endpoint, where the index of the bit represents the endpoint number.
Definition at line 35 of file zigbee-group-table.h.
|
default |
Constructor for Zigbee group table.
|
default |
Destructor for Zigbee group table.
bool ns3::zigbee::ZigbeeGroupTable::AddEntry | ( | uint16_t | groupId, |
uint8_t | endPoint ) |
Add a group ID and its related endpoint.
If the group ID already exists, the endpoint is added to the existing group ID entry.
groupId | The group ID to add. |
endPoint | The endpoint to associate with the group ID. |
Definition at line 26 of file zigbee-group-table.cc.
References m_groupTable, MAX_GROUP_ID_ENTRIES, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_WARN.
bool ns3::zigbee::ZigbeeGroupTable::IsGroupMember | ( | uint16_t | groupId | ) | const |
Indicates whether the group ID exists in the group table.
groupId | The group ID to query. |
Definition at line 110 of file zigbee-group-table.cc.
References m_groupTable.
bool ns3::zigbee::ZigbeeGroupTable::LookUpEndPoints | ( | uint16_t | groupId, |
std::vector< uint8_t > & | endPoints ) const |
Look up the endpoints associated with a given group ID.
groupId | The group ID to look up. |
endPoints | A vector to store the endpoints associated with the group ID. |
Definition at line 116 of file zigbee-group-table.cc.
References m_groupTable, MAX_ENDPOINT_ENTRIES, and NS_LOG_WARN.
bool ns3::zigbee::ZigbeeGroupTable::RemoveEntry | ( | uint16_t | groupId, |
uint8_t | endPoint ) |
Remove endpoint from a group.
If the endpoint is the last one associated with the group ID, the group ID entry is removed.
groupId | The group ID of the group to remove the endpoint from. |
endPoint | The endpoint to remove from the group ID. |
Definition at line 51 of file zigbee-group-table.cc.
References m_groupTable, NS_LOG_FUNCTION, NS_LOG_INFO, and NS_LOG_WARN.
bool ns3::zigbee::ZigbeeGroupTable::RemoveMembership | ( | uint8_t | endPoint | ) |
Remove the endPoint from all groups.
endPoint | The endpoint to remove from all groups. If the removed endpoint is the last one associated with the group ID, the group ID entry is also removed. |
Definition at line 86 of file zigbee-group-table.cc.
References m_groupTable, NS_LOG_FUNCTION, and NS_LOG_INFO.
|
private |
The group table object.
Definition at line 104 of file zigbee-group-table.h.
Referenced by AddEntry(), IsGroupMember(), LookUpEndPoints(), RemoveEntry(), and RemoveMembership().
|
staticconstexprprivate |
The maximum amount of endpoints allowed per group id entry.
Definition at line 101 of file zigbee-group-table.h.
Referenced by LookUpEndPoints().
|
staticconstexprprivate |
The maximum amount of group ID entries allowed in the table.
Definition at line 99 of file zigbee-group-table.h.
Referenced by AddEntry().