Skip to content

Commit f0566d8

Browse files
committed
ZigbeeEP: Remove static to support multiple endpoints.
Each instance must have it's own endpoint ID so it can´t be static.
1 parent 3bfa3e0 commit f0566d8

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Diff for: libraries/Zigbee/src/ZigbeeEP.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66

77
#include "esp_zigbee_cluster.h"
88

9-
uint8_t ZigbeeEP::_endpoint = 0;
10-
bool ZigbeeEP::_is_bound = false;
11-
bool ZigbeeEP::_allow_multiple_binding = false;
9+
1210

1311
/* Zigbee End Device Class */
1412
ZigbeeEP::ZigbeeEP(uint8_t endpoint) {
1513
_endpoint = endpoint;
14+
_is_bound = false;
15+
_allow_multiple_binding = false;
16+
1617
_ep_config.endpoint = 0;
1718
_cluster_list = nullptr;
1819
#if !CONFIG_DISABLE_HAL_LOCKS

Diff for: libraries/Zigbee/src/ZigbeeEP.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ class ZigbeeEP {
7272
return _bound_devices;
7373
}
7474

75-
static bool isBound() {
75+
bool isBound() {
7676
return _is_bound;
7777
}
78-
static void allowMultipleBinding(bool bind) {
78+
void allowMultipleBinding(bool bind) {
7979
_allow_multiple_binding = bind;
8080
}
8181

@@ -104,17 +104,17 @@ class ZigbeeEP {
104104
}
105105

106106
private:
107-
static bool _allow_multiple_binding;
107+
bool _allow_multiple_binding;
108108
char *_read_manufacturer;
109109
char *_read_model;
110110
void (*_on_identify)(uint16_t time);
111111

112112
protected:
113-
static uint8_t _endpoint;
113+
uint8_t _endpoint;
114114
esp_zb_ha_standard_devices_t _device_id;
115115
esp_zb_endpoint_config_t _ep_config;
116116
esp_zb_cluster_list_t *_cluster_list;
117-
static bool _is_bound;
117+
bool _is_bound;
118118
std::list<zb_device_params_t *> _bound_devices;
119119
SemaphoreHandle_t lock;
120120

0 commit comments

Comments
 (0)