Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions libraries/Zigbee/src/ZigbeeCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ ZigbeeCore::ZigbeeCore() {
_scan_status = ZB_SCAN_FAILED;
_started = false;
_connected = false;
_scan_duration = 4; // maximum scan duration
_scan_duration = 3; // default scan duration
_rx_on_when_idle = true;
if (!lock) {
lock = xSemaphoreCreateBinary();
if (lock == NULL) {
Expand Down Expand Up @@ -98,7 +99,7 @@ static void esp_zb_task(void *pvParameters) {

//NOTE: This is a workaround to make battery powered devices to be discovered as battery powered
if (((zigbee_role_t)Zigbee.getRole() == ZIGBEE_END_DEVICE) && edBatteryPowered) {
zb_set_ed_node_descriptor(0, 0, 0);
zb_set_ed_node_descriptor(0, _rx_on_when_idle, 1);
}

esp_zb_stack_main_loop();
Expand Down
5 changes: 5 additions & 0 deletions libraries/Zigbee/src/ZigbeeCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class ZigbeeCore {
uint32_t _primary_channel_mask;
int16_t _scan_status;
uint8_t _scan_duration;
bool _rx_on_when_idle;

esp_zb_ep_list_t *_zb_ep_list;
zigbee_role_t _role;
Expand Down Expand Up @@ -118,6 +119,10 @@ class ZigbeeCore {
return _scan_duration;
}

void setRxOnWhenIdle(bool rx_on_when_idle) {
_rx_on_when_idle = rx_on_when_idle;
}

void setRebootOpenNetwork(uint8_t time);
void openNetwork(uint8_t time);

Expand Down
Loading