Skip to content
Merged
Prev Previous commit
Next Next commit
feat(zigbee): Add the resetChannelMask to all Begin methods
  • Loading branch information
P-R-O-C-H-Y committed Mar 18, 2025
commit 267c042aa7e08e05af00287e34291f5ad08de3d3
7 changes: 5 additions & 2 deletions libraries/Zigbee/src/ZigbeeCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ bool ZigbeeCore::begin(esp_zb_cfg_t *role_cfg, bool erase_nvs) {
}
_role = (zigbee_role_t)role_cfg->esp_zb_role;
if (xSemaphoreTake(lock, _begin_timeout) != pdTRUE) {
log_e("ZigbeeCore begin timeout");
log_e("ZigbeeCore begin failed or timeout");
if(_role != ZIGBEE_COORDINATOR) { // Only End Device and Router can rejoin
resetChannelMask();
}
}
return started();
}
Expand Down Expand Up @@ -81,7 +84,7 @@ bool ZigbeeCore::begin(zigbee_role_t role, bool erase_nvs) {
}
if (!status || xSemaphoreTake(lock, _begin_timeout) != pdTRUE) {
log_e("ZigbeeCore begin failed or timeout");
if(role != ZIGBEE_COORDINATOR) { // Only End Device and Router can rejoin
if(_role != ZIGBEE_COORDINATOR) { // Only End Device and Router can rejoin
resetChannelMask();
}
}
Expand Down
Loading