@@ -178,7 +178,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
178
178
log_i (" Device started up in %s factory-reset mode" , esp_zb_bdb_is_factory_new () ? " " : " non" );
179
179
if (esp_zb_bdb_is_factory_new ()) {
180
180
// Role specific code
181
- if ((zigbee_role_t )Zigbee._role == ZIGBEE_COORDINATOR) {
181
+ if ((zigbee_role_t )Zigbee.getRole () == ZIGBEE_COORDINATOR) {
182
182
log_i (" Start network formation" );
183
183
esp_zb_bdb_start_top_level_commissioning (ESP_ZB_BDB_MODE_NETWORK_FORMATION);
184
184
} else {
@@ -190,7 +190,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
190
190
} else {
191
191
log_i (" Device rebooted" );
192
192
Zigbee._started = true ;
193
- if ((zigbee_role_t )Zigbee._role == ZIGBEE_COORDINATOR && Zigbee._open_network > 0 ) {
193
+ if ((zigbee_role_t )Zigbee.getRole () == ZIGBEE_COORDINATOR && Zigbee._open_network > 0 ) {
194
194
log_i (" Openning network for joining for %d seconds" , Zigbee._open_network );
195
195
esp_zb_bdb_open_network (Zigbee._open_network );
196
196
}
@@ -201,7 +201,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
201
201
}
202
202
break ;
203
203
case ESP_ZB_BDB_SIGNAL_FORMATION: // Coordinator
204
- if ((zigbee_role_t )Zigbee._role == ZIGBEE_COORDINATOR) {
204
+ if ((zigbee_role_t )Zigbee.getRole () == ZIGBEE_COORDINATOR) {
205
205
if (err_status == ESP_OK) {
206
206
esp_zb_ieee_addr_t extended_pan_id;
207
207
esp_zb_get_extended_pan_id (extended_pan_id);
@@ -219,7 +219,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
219
219
break ;
220
220
case ESP_ZB_BDB_SIGNAL_STEERING: // Router and End Device
221
221
Zigbee._started = true ;
222
- if ((zigbee_role_t )Zigbee._role == ZIGBEE_COORDINATOR) {
222
+ if ((zigbee_role_t )Zigbee.getRole () == ZIGBEE_COORDINATOR) {
223
223
if (err_status == ESP_OK) {
224
224
log_i (" Network steering started" );
225
225
}
@@ -240,7 +240,7 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
240
240
}
241
241
break ;
242
242
case ESP_ZB_ZDO_SIGNAL_DEVICE_ANNCE: // Coordinator
243
- if ((zigbee_role_t )Zigbee._role == ZIGBEE_COORDINATOR) {
243
+ if ((zigbee_role_t )Zigbee.getRole () == ZIGBEE_COORDINATOR) {
244
244
dev_annce_params = (esp_zb_zdo_signal_device_annce_params_t *)esp_zb_app_signal_get_params (p_sg_p);
245
245
log_i (" New device commissioned or rejoined (short: 0x%04hx)" , dev_annce_params->device_short_addr );
246
246
esp_zb_zdo_match_desc_req_param_t cmd_req;
@@ -259,16 +259,16 @@ void esp_zb_app_signal_handler(esp_zb_app_signal_t *signal_struct) {
259
259
Bit 7 – Reserved
260
260
*/
261
261
262
- // for each endpoint in the list call the find_endpoint function if not bounded or allowed to bind multiple devices
262
+ // for each endpoint in the list call the findEndpoint function if not bounded or allowed to bind multiple devices
263
263
for (std::list<ZigbeeEP*>::iterator it = Zigbee.ep_objects .begin (); it != Zigbee.ep_objects .end (); ++it) {
264
- if (!(*it)->_is_bound || (*it)->_allow_multiple_binding ) {
265
- (*it)->find_endpoint (&cmd_req);
264
+ if (!(*it)->isBound () || (*it)->epAllowMultipleBinding () ) {
265
+ (*it)->findEndpoint (&cmd_req);
266
266
}
267
267
}
268
268
}
269
269
break ;
270
270
case ESP_ZB_NWK_SIGNAL_PERMIT_JOIN_STATUS: // Coordinator
271
- if ((zigbee_role_t )Zigbee._role == ZIGBEE_COORDINATOR) {
271
+ if ((zigbee_role_t )Zigbee.getRole () == ZIGBEE_COORDINATOR) {
272
272
if (err_status == ESP_OK) {
273
273
if (*(uint8_t *)esp_zb_app_signal_get_params (p_sg_p)) {
274
274
log_i (" Network(0x%04hx) is open for %d seconds" , esp_zb_get_pan_id (), *(uint8_t *)esp_zb_app_signal_get_params (p_sg_p));
@@ -287,10 +287,6 @@ void ZigbeeCore::factoryReset() {
287
287
esp_zb_factory_reset ();
288
288
}
289
289
290
- bool ZigbeeCore::isStarted () {
291
- return _started;
292
- }
293
-
294
290
void ZigbeeCore::scanCompleteCallback (esp_zb_zdp_status_t zdo_status, uint8_t count, esp_zb_network_descriptor_t *nwk_descriptor){
295
291
log_v (" Zigbee network scan complete" );
296
292
if (zdo_status == ESP_ZB_ZDP_STATUS_SUCCESS) {
0 commit comments