Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 2 additions & 1 deletion libraries/Zigbee/src/ZigbeeCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ ZigbeeCore::ZigbeeCore() {
_started = false;
_connected = false;
_scan_duration = 4; // maximum 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
6 changes: 6 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 @@ -112,12 +113,17 @@ class ZigbeeCore {
void setHostConfig(esp_zb_host_config_t config);
esp_zb_host_config_t getHostConfig();

void setPrimaryChannelMask(uint32_t mask);
void setPrimaryChannelMask(uint32_t mask); // By default all channels are scanned (11-26) -> mask 0x07FFF800
void setScanDuration(uint8_t duration); // Can be set from 1 - 4. 1 is fastest, 4 is slowest
uint8_t getScanDuration() {
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