Skip to content

Commit 267c042

Browse files
committed
feat(zigbee): Add the resetChannelMask to all Begin methods
1 parent 1ff918b commit 267c042

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

+5-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ bool ZigbeeCore::begin(esp_zb_cfg_t *role_cfg, bool erase_nvs) {
4848
}
4949
_role = (zigbee_role_t)role_cfg->esp_zb_role;
5050
if (xSemaphoreTake(lock, _begin_timeout) != pdTRUE) {
51-
log_e("ZigbeeCore begin timeout");
51+
log_e("ZigbeeCore begin failed or timeout");
52+
if(_role != ZIGBEE_COORDINATOR) { // Only End Device and Router can rejoin
53+
resetChannelMask();
54+
}
5255
}
5356
return started();
5457
}
@@ -81,7 +84,7 @@ bool ZigbeeCore::begin(zigbee_role_t role, bool erase_nvs) {
8184
}
8285
if (!status || xSemaphoreTake(lock, _begin_timeout) != pdTRUE) {
8386
log_e("ZigbeeCore begin failed or timeout");
84-
if(role != ZIGBEE_COORDINATOR) { // Only End Device and Router can rejoin
87+
if(_role != ZIGBEE_COORDINATOR) { // Only End Device and Router can rejoin
8588
resetChannelMask();
8689
}
8790
}

0 commit comments

Comments
 (0)